From b6d6767341018a27243527a71693473273e360e2 Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Fri, 18 Mar 2011 10:44:59 -0400 Subject: [PATCH] define for nfs4stateid.other constant --- daemon/callback_server.c | 2 +- daemon/callback_xdr.c | 2 +- daemon/nfs41_const.h | 1 + daemon/nfs41_types.h | 2 +- daemon/nfs41_xdr.c | 2 +- daemon/pnfs_layout.c | 3 ++- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/daemon/callback_server.c b/daemon/callback_server.c index 7609bf5..cc39639 100644 --- a/daemon/callback_server.c +++ b/daemon/callback_server.c @@ -177,7 +177,7 @@ static unsigned int WINAPI _handle_cb_recall(void *args) print_hexbuf(3, (unsigned char *)"_handle_cb_recall: fh ", cb_args->args->fh.fh, cb_args->args->fh.len); print_hexbuf(3, (unsigned char *)"_handle_cb_recall: stateid ", - cb_args->args->stateid.other, 12); + cb_args->args->stateid.other, NFS4_STATEID_OTHER); ZeroMemory(&path_fh, sizeof(nfs41_path_fh)); memcpy(&path_fh.fh, &cb_args->args->fh, sizeof(nfs41_fh)); path_fh.fh.superblock = NULL; diff --git a/daemon/callback_xdr.c b/daemon/callback_xdr.c index 215b717..c3e2d1f 100644 --- a/daemon/callback_xdr.c +++ b/daemon/callback_xdr.c @@ -34,7 +34,7 @@ static bool_t common_stateid(XDR *xdr, stateid4 *stateid) { return xdr_u_int32_t(xdr, &stateid->seqid) - && xdr_opaque(xdr, (char*)stateid->other, 12); + && xdr_opaque(xdr, (char*)stateid->other, NFS4_STATEID_OTHER); } static bool_t common_fh(XDR *xdr, nfs41_fh *fh) diff --git a/daemon/nfs41_const.h b/daemon/nfs41_const.h index fdbae06..533a9b7 100644 --- a/daemon/nfs41_const.h +++ b/daemon/nfs41_const.h @@ -32,6 +32,7 @@ #define NFS4_VERIFIER_SIZE 8 #define NFS4_OPAQUE_LIMIT 1024 #define NFS4_SESSIONID_SIZE 16 +#define NFS4_STATEID_OTHER 12 #define NFS41_MAX_FILEIO_SIZE (1024 * 1024) #define NFS41_MAX_SERVER_CACHE 1024 diff --git a/daemon/nfs41_types.h b/daemon/nfs41_types.h index e4bd7e5..5b181d0 100644 --- a/daemon/nfs41_types.h +++ b/daemon/nfs41_types.h @@ -128,7 +128,7 @@ typedef struct __nfsace4 { typedef struct __stateid4 { uint32_t seqid; - unsigned char other[12]; + unsigned char other[NFS4_STATEID_OTHER]; } stateid4; typedef struct __fattr4 { diff --git a/daemon/nfs41_xdr.c b/daemon/nfs41_xdr.c index b571764..bff1f09 100644 --- a/daemon/nfs41_xdr.c +++ b/daemon/nfs41_xdr.c @@ -139,7 +139,7 @@ static bool_t xdr_stateid4( if (!xdr_u_int32_t(xdr, &si->seqid)) return FALSE; - return xdr_opaque(xdr, (char *)si->other, 12); + return xdr_opaque(xdr, (char *)si->other, NFS4_STATEID_OTHER); } /* fattr4 */ diff --git a/daemon/pnfs_layout.c b/daemon/pnfs_layout.c index 87caa1e..8cd30de 100644 --- a/daemon/pnfs_layout.c +++ b/daemon/pnfs_layout.c @@ -239,7 +239,8 @@ static enum pnfs_status layout_update_stateid( if (state->stateid.seqid == 0) { /* save a new layout stateid */ memcpy(&state->stateid, stateid, sizeof(stateid4)); - } else if (memcmp(&state->stateid.other, stateid->other, 12) == 0) { + } else if (memcmp(&state->stateid.other, stateid->other, + NFS4_STATEID_OTHER) == 0) { /* update an existing layout stateid */ state->stateid.seqid = stateid->seqid; } else {