79 dprintf(
CBSLVL,
" OP_CB_LAYOUTRECALL { %s, %s, recall %u } %s\n",
93 args->target_highest_slotid);
112 *session_out = cb_session;
117 eprintf(
"[cb] received sessionid doesn't match session\n");
123 if (
args->slotid != 0) {
124 eprintf(
"[cb] received unexpected slotid=%d\n",
args->slotid);
128 if (
args->highest_slotid != 0) {
129 eprintf(
"[cb] received unexpected highest_slotid=%d\n",
130 args->highest_slotid);
137 if (!cb_session->
replay.res.length) {
151 eprintf(
"[cb] bad received seq#=%d, expected=%d\n",
158 *cachethis =
args->cachethis;
161 res->ok.sequenceid =
args->sequenceid;
163 res->ok.highest_slotid =
args->highest_slotid;
164 res->ok.target_highest_slotid =
args->highest_slotid;
167 dprintf(
CBSLVL,
" OP_CB_SEQUENCE { seqid %u, slot %u, cachethis %d } " 168 "%s\n",
args->sequenceid,
args->slotid,
args->cachethis,
204 for (
i = 0;
i <
args->change_count;
i++) {
206 &
args->change_list[
i]);
221 session->replay.arg.length = 0;
222 session->replay.res.length = 0;
240 }
else if (cachethis) {
245 for (
i = 0;
i <
res->resarray_count;
i++) {
246 if (!
res->resarray[
i].xdr_ok) {
248 res->resarray_count =
i + 1;
281 for (
i = 0;
i <
res->resarray_count;
i++) {
283 if (
i >=
args->argarray_count)
287 if (
args->argarray[
i].opnum !=
res->resarray[
i].opnum)
290 if (
res->resarray[
i].res.status)
307 if (replay ==
NULL) {
308 eprintf(
"[cb] failed to allocate replay buffer\n");
317 eprintf(
"[cb] failed to decode replay buffer\n");
319 goto out_free_replay;
323 if (
session->replay.arg.length) {
325 eprintf(
"[cb] retry attempt with different arguments\n");
327 goto out_free_replay;
331 eprintf(
"[cb] retry attempt with different operations\n");
333 goto out_free_replay;
341 dprintf(2,
"[cb] retry: returning cached response\n");
370 eprintf(
"failed to decode compound arguments\n");
390 if (
args.minorversion != 1) {
392 eprintf(
"args.minorversion %u != 1\n",
args.minorversion);
398 argop = &
args.argarray[
i];
399 resop = &
res->resarray[
i];
401 res->resarray_count++;
422 switch (argop->
opnum) {
424 dprintf(1,
"OP_CB_LAYOUTRECALL\n");
429 dprintf(1,
"OP_CB_RECALL_SLOT\n");
434 dprintf(1,
"OP_CB_SEQUENCE\n");
463 dprintf(1,
"OP_CB_PUSH_DELEG\n");
467 dprintf(1,
"OP_CB_RECALL_ANY\n");
471 dprintf(1,
"OP_CB_RECALLABLE_OBJ_AVAIL\n");
475 dprintf(1,
"OP_CB_WANTS_CANCELLED\n");
479 dprintf(1,
"OP_CB_NOTIFY_LOCK\n");
483 dprintf(1,
"OP_CB_NOTIFY_DEVICEID\n");
506 dprintf(
CBSLVL,
"<-- handle_cb_compound() returning %s (%u results)\n",
508 res ?
res->resarray_count : 0);
523 dprintf(1,
"nfs41_handle_callback: received call\n");
struct cb_getattr_res getattr
static bool_t replay_validate_args(IN struct cb_compound_args *args, IN const struct replay_cache *cache)
const char * pnfs_iomode_string(enum pnfs_iomode iomode)
struct cb_recall_slot_res recall_slot
static bool_t replay_validate_ops(IN const struct cb_compound_args *args, IN const struct cb_compound_res *res)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
static enum_t handle_cb_getattr(IN nfs41_rpc_clnt *rpc_clnt, IN struct cb_getattr_args *args, OUT struct cb_getattr_res *res)
struct cb_recall_args recall
#define NFS4_SESSIONID_SIZE
ACPI_SIZE strlen(const char *String)
struct cb_recall_res recall
static void handle_cb_compound(nfs41_rpc_clnt *rpc_clnt, cb_req *req, struct cb_compound_res **reply)
void nfs41_callback_session_init(IN nfs41_session *session)
int nfs41_delegation_recall(IN nfs41_client *client, IN nfs41_fh *fh, IN const stateid4 *stateid, IN bool_t truncate)
void eprintf(LPCSTR format,...)
const unsigned char * cb_sessionid
#define NFS41_RPC_CBPROGRAM
static const char g_server_tag[]
int nfs41_handle_callback(void *rpc_clnt, void *cb, struct cb_compound_res **reply)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static enum_t handle_cb_layoutrecall(IN nfs41_rpc_clnt *rpc_clnt, IN struct cb_layoutrecall_args *args, OUT struct cb_layoutrecall_res *res)
struct __nfs41_cb_session::@28 replay
struct cb_layoutrecall_res layoutrecall
const char * pnfs_layout_type_string(enum pnfs_layout_type type)
int nfs41_session_recall_slot(IN nfs41_session *session, IN OUT uint32_t target_highest_slotid)
static enum_t handle_cb_notify_deviceid(IN nfs41_rpc_clnt *rpc_clnt, IN struct cb_notify_deviceid_args *args, OUT struct cb_notify_deviceid_res *res)
#define CB_COMPOUND_MAX_TAG
const char * nfs_error_string(int status)
static enum_t handle_cb_sequence(IN nfs41_rpc_clnt *rpc_clnt, IN struct cb_sequence_args *args, OUT struct cb_sequence_res *res, OUT nfs41_cb_session **session_out, OUT bool_t *cachethis)
struct cb_getattr_args getattr
#define memcpy(s1, s2, n)
#define NFS41_MAX_SERVER_CACHE
struct cb_layoutrecall_args layoutrecall
STRSAFEAPI StringCchCopyA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc)
struct cb_sequence_args sequence
static enum_t handle_cb_recall_slot(IN nfs41_rpc_clnt *rpc_clnt, IN struct cb_recall_slot_args *args, OUT struct cb_recall_slot_res *res)
void xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op)
int nfs41_delegation_getattr(IN nfs41_client *client, IN const nfs41_fh *fh, IN const bitmap4 *attr_request, OUT nfs41_file_info *info)
static int replay_cache_read(IN nfs41_cb_session *session, IN struct cb_compound_args *args, OUT struct cb_compound_res **res_out)
static HMODULE MODULEINFO DWORD cb
struct cb_sequence_res sequence
static enum_t handle_cb_recall(IN nfs41_rpc_clnt *rpc_clnt, IN struct cb_recall_args *args, OUT struct cb_recall_res *res)
static void replay_cache_write(IN nfs41_cb_session *session, IN struct cb_compound_args *args, IN struct cb_compound_res *res, IN bool_t cachethis)
bool_t proc_cb_compound_args(XDR *xdr, struct cb_compound_args *args)
bool_t proc_cb_compound_res(XDR *xdr, struct cb_compound_res *res)
static SERVICE_STATUS status
enum pnfs_status pnfs_file_layout_recall(IN struct __nfs41_client *client, IN const struct cb_layoutrecall_args *recall)
enum pnfs_status pnfs_file_device_notify(IN struct pnfs_file_device_list *devices, IN const struct notify_deviceid4 *change)
struct cb_recall_slot_args recall_slot
PULONG MinorVersion OPTIONAL