diff options
Diffstat (limited to 'rpc/xdr')
-rw-r--r-- | rpc/xdr/src/glusterfs3.h | 1408 | ||||
-rw-r--r-- | rpc/xdr/src/msg-nfs3.h | 134 | ||||
-rw-r--r-- | rpc/xdr/src/xdr-generic.h | 31 | ||||
-rw-r--r-- | rpc/xdr/src/xdr-nfs3.h | 1431 |
4 files changed, 1583 insertions, 1421 deletions
diff --git a/rpc/xdr/src/glusterfs3.h b/rpc/xdr/src/glusterfs3.h index 4ffad3c5b45..b8ef394abaf 100644 --- a/rpc/xdr/src/glusterfs3.h +++ b/rpc/xdr/src/glusterfs3.h @@ -20,867 +20,877 @@ #include "protocol-common.h" #include "upcall-utils.h" -#define xdr_decoded_remaining_addr(xdr) ((&xdr)->x_private) -#define xdr_decoded_remaining_len(xdr) ((&xdr)->x_handy) -#define xdr_encoded_length(xdr) (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base)) -#define xdr_decoded_length(xdr) (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base)) - - -#define GF_O_ACCMODE 003 -#define GF_O_RDONLY 00 -#define GF_O_WRONLY 01 -#define GF_O_RDWR 02 -#define GF_O_CREAT 0100 -#define GF_O_EXCL 0200 -#define GF_O_NOCTTY 0400 -#define GF_O_TRUNC 01000 -#define GF_O_APPEND 02000 -#define GF_O_NONBLOCK 04000 -#define GF_O_SYNC 010000 -#define GF_O_ASYNC 020000 - -#define GF_O_DIRECT 040000 -#define GF_O_DIRECTORY 0200000 -#define GF_O_NOFOLLOW 0400000 -#define GF_O_NOATIME 01000000 -#define GF_O_CLOEXEC 02000000 - -#define GF_O_LARGEFILE 0100000 - -#define GF_O_FMODE_EXEC 040 - -#define XLATE_BIT(from, to, bit) do { \ - if (from & bit) \ - to = to | GF_##bit; \ - } while (0) - -#define UNXLATE_BIT(from, to, bit) do { \ - if (from & GF_##bit) \ - to = to | bit; \ - } while (0) - -#define XLATE_ACCESSMODE(from, to) do { \ - switch (from & O_ACCMODE) { \ - case O_RDONLY: to |= GF_O_RDONLY; \ - break; \ - case O_WRONLY: to |= GF_O_WRONLY; \ - break; \ - case O_RDWR: to |= GF_O_RDWR; \ - break; \ - } \ - } while (0) - -#define UNXLATE_ACCESSMODE(from, to) do { \ - switch (from & GF_O_ACCMODE) { \ - case GF_O_RDONLY: to |= O_RDONLY; \ - break; \ - case GF_O_WRONLY: to |= O_WRONLY; \ - break; \ - case GF_O_RDWR: to |= O_RDWR; \ - break; \ - } \ - } while (0) +#define xdr_decoded_remaining_addr(xdr) ((&xdr)->x_private) +#define xdr_decoded_remaining_len(xdr) ((&xdr)->x_handy) +#define xdr_encoded_length(xdr) \ + (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base)) +#define xdr_decoded_length(xdr) \ + (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base)) + +#define GF_O_ACCMODE 003 +#define GF_O_RDONLY 00 +#define GF_O_WRONLY 01 +#define GF_O_RDWR 02 +#define GF_O_CREAT 0100 +#define GF_O_EXCL 0200 +#define GF_O_NOCTTY 0400 +#define GF_O_TRUNC 01000 +#define GF_O_APPEND 02000 +#define GF_O_NONBLOCK 04000 +#define GF_O_SYNC 010000 +#define GF_O_ASYNC 020000 + +#define GF_O_DIRECT 040000 +#define GF_O_DIRECTORY 0200000 +#define GF_O_NOFOLLOW 0400000 +#define GF_O_NOATIME 01000000 +#define GF_O_CLOEXEC 02000000 + +#define GF_O_LARGEFILE 0100000 + +#define GF_O_FMODE_EXEC 040 + +#define XLATE_BIT(from, to, bit) \ + do { \ + if (from & bit) \ + to = to | GF_##bit; \ + } while (0) + +#define UNXLATE_BIT(from, to, bit) \ + do { \ + if (from & GF_##bit) \ + to = to | bit; \ + } while (0) + +#define XLATE_ACCESSMODE(from, to) \ + do { \ + switch (from & O_ACCMODE) { \ + case O_RDONLY: \ + to |= GF_O_RDONLY; \ + break; \ + case O_WRONLY: \ + to |= GF_O_WRONLY; \ + break; \ + case O_RDWR: \ + to |= GF_O_RDWR; \ + break; \ + } \ + } while (0) + +#define UNXLATE_ACCESSMODE(from, to) \ + do { \ + switch (from & GF_O_ACCMODE) { \ + case GF_O_RDONLY: \ + to |= O_RDONLY; \ + break; \ + case GF_O_WRONLY: \ + to |= O_WRONLY; \ + break; \ + case GF_O_RDWR: \ + to |= O_RDWR; \ + break; \ + } \ + } while (0) static inline uint32_t -gf_flags_from_flags (uint32_t flags) +gf_flags_from_flags(uint32_t flags) { - uint32_t gf_flags = 0; - - XLATE_ACCESSMODE (flags, gf_flags); - - XLATE_BIT (flags, gf_flags, O_CREAT); - XLATE_BIT (flags, gf_flags, O_EXCL); - XLATE_BIT (flags, gf_flags, O_NOCTTY); - XLATE_BIT (flags, gf_flags, O_TRUNC); - XLATE_BIT (flags, gf_flags, O_APPEND); - XLATE_BIT (flags, gf_flags, O_NONBLOCK); - XLATE_BIT (flags, gf_flags, O_SYNC); - XLATE_BIT (flags, gf_flags, O_ASYNC); - - XLATE_BIT (flags, gf_flags, O_DIRECT); - XLATE_BIT (flags, gf_flags, O_DIRECTORY); - XLATE_BIT (flags, gf_flags, O_NOFOLLOW); + uint32_t gf_flags = 0; + + XLATE_ACCESSMODE(flags, gf_flags); + + XLATE_BIT(flags, gf_flags, O_CREAT); + XLATE_BIT(flags, gf_flags, O_EXCL); + XLATE_BIT(flags, gf_flags, O_NOCTTY); + XLATE_BIT(flags, gf_flags, O_TRUNC); + XLATE_BIT(flags, gf_flags, O_APPEND); + XLATE_BIT(flags, gf_flags, O_NONBLOCK); + XLATE_BIT(flags, gf_flags, O_SYNC); + XLATE_BIT(flags, gf_flags, O_ASYNC); + + XLATE_BIT(flags, gf_flags, O_DIRECT); + XLATE_BIT(flags, gf_flags, O_DIRECTORY); + XLATE_BIT(flags, gf_flags, O_NOFOLLOW); #ifdef O_NOATIME - XLATE_BIT (flags, gf_flags, O_NOATIME); + XLATE_BIT(flags, gf_flags, O_NOATIME); #endif #ifdef O_CLOEXEC - XLATE_BIT (flags, gf_flags, O_CLOEXEC); + XLATE_BIT(flags, gf_flags, O_CLOEXEC); #endif - XLATE_BIT (flags, gf_flags, O_LARGEFILE); - XLATE_BIT (flags, gf_flags, O_FMODE_EXEC); + XLATE_BIT(flags, gf_flags, O_LARGEFILE); + XLATE_BIT(flags, gf_flags, O_FMODE_EXEC); - return gf_flags; + return gf_flags; } static inline uint32_t -gf_flags_to_flags (uint32_t gf_flags) +gf_flags_to_flags(uint32_t gf_flags) { - uint32_t flags = 0; - - UNXLATE_ACCESSMODE (gf_flags, flags); - - UNXLATE_BIT (gf_flags, flags, O_CREAT); - UNXLATE_BIT (gf_flags, flags, O_EXCL); - UNXLATE_BIT (gf_flags, flags, O_NOCTTY); - UNXLATE_BIT (gf_flags, flags, O_TRUNC); - UNXLATE_BIT (gf_flags, flags, O_APPEND); - UNXLATE_BIT (gf_flags, flags, O_NONBLOCK); - UNXLATE_BIT (gf_flags, flags, O_SYNC); - UNXLATE_BIT (gf_flags, flags, O_ASYNC); - - UNXLATE_BIT (gf_flags, flags, O_DIRECT); - UNXLATE_BIT (gf_flags, flags, O_DIRECTORY); - UNXLATE_BIT (gf_flags, flags, O_NOFOLLOW); + uint32_t flags = 0; + + UNXLATE_ACCESSMODE(gf_flags, flags); + + UNXLATE_BIT(gf_flags, flags, O_CREAT); + UNXLATE_BIT(gf_flags, flags, O_EXCL); + UNXLATE_BIT(gf_flags, flags, O_NOCTTY); + UNXLATE_BIT(gf_flags, flags, O_TRUNC); + UNXLATE_BIT(gf_flags, flags, O_APPEND); + UNXLATE_BIT(gf_flags, flags, O_NONBLOCK); + UNXLATE_BIT(gf_flags, flags, O_SYNC); + UNXLATE_BIT(gf_flags, flags, O_ASYNC); + + UNXLATE_BIT(gf_flags, flags, O_DIRECT); + UNXLATE_BIT(gf_flags, flags, O_DIRECTORY); + UNXLATE_BIT(gf_flags, flags, O_NOFOLLOW); #ifdef O_NOATIME - UNXLATE_BIT (gf_flags, flags, O_NOATIME); + UNXLATE_BIT(gf_flags, flags, O_NOATIME); #endif #ifdef O_CLOEXEC - UNXLATE_BIT (gf_flags, flags, O_CLOEXEC); + UNXLATE_BIT(gf_flags, flags, O_CLOEXEC); #endif - UNXLATE_BIT (gf_flags, flags, O_LARGEFILE); - UNXLATE_BIT (gf_flags, flags, O_FMODE_EXEC); + UNXLATE_BIT(gf_flags, flags, O_LARGEFILE); + UNXLATE_BIT(gf_flags, flags, O_FMODE_EXEC); - return flags; + return flags; } - static inline void -gf_statfs_to_statfs (struct gf_statfs *gf_stat, struct statvfs *stat) +gf_statfs_to_statfs(struct gf_statfs *gf_stat, struct statvfs *stat) { - if (!stat || !gf_stat) - return; - - stat->f_bsize = (gf_stat->bsize); - stat->f_frsize = (gf_stat->frsize); - stat->f_blocks = (gf_stat->blocks); - stat->f_bfree = (gf_stat->bfree); - stat->f_bavail = (gf_stat->bavail); - stat->f_files = (gf_stat->files); - stat->f_ffree = (gf_stat->ffree); - stat->f_favail = (gf_stat->favail); - stat->f_fsid = (gf_stat->fsid); - stat->f_flag = (gf_stat->flag); - stat->f_namemax = (gf_stat->namemax); + if (!stat || !gf_stat) + return; + + stat->f_bsize = (gf_stat->bsize); + stat->f_frsize = (gf_stat->frsize); + stat->f_blocks = (gf_stat->blocks); + stat->f_bfree = (gf_stat->bfree); + stat->f_bavail = (gf_stat->bavail); + stat->f_files = (gf_stat->files); + stat->f_ffree = (gf_stat->ffree); + stat->f_favail = (gf_stat->favail); + stat->f_fsid = (gf_stat->fsid); + stat->f_flag = (gf_stat->flag); + stat->f_namemax = (gf_stat->namemax); } - static inline void -gf_statfs_from_statfs (struct gf_statfs *gf_stat, struct statvfs *stat) +gf_statfs_from_statfs(struct gf_statfs *gf_stat, struct statvfs *stat) { - if (!stat || !gf_stat) - return; - - gf_stat->bsize = stat->f_bsize; - gf_stat->frsize = stat->f_frsize; - gf_stat->blocks = stat->f_blocks; - gf_stat->bfree = stat->f_bfree; - gf_stat->bavail = stat->f_bavail; - gf_stat->files = stat->f_files; - gf_stat->ffree = stat->f_ffree; - gf_stat->favail = stat->f_favail; - gf_stat->fsid = stat->f_fsid; - gf_stat->flag = stat->f_flag; - gf_stat->namemax = stat->f_namemax; + if (!stat || !gf_stat) + return; + + gf_stat->bsize = stat->f_bsize; + gf_stat->frsize = stat->f_frsize; + gf_stat->blocks = stat->f_blocks; + gf_stat->bfree = stat->f_bfree; + gf_stat->bavail = stat->f_bavail; + gf_stat->files = stat->f_files; + gf_stat->ffree = stat->f_ffree; + gf_stat->favail = stat->f_favail; + gf_stat->fsid = stat->f_fsid; + gf_stat->flag = stat->f_flag; + gf_stat->namemax = stat->f_namemax; } static inline void -gf_proto_lease_to_lease (struct gf_proto_lease *gf_proto_lease, struct gf_lease *gf_lease) +gf_proto_lease_to_lease(struct gf_proto_lease *gf_proto_lease, + struct gf_lease *gf_lease) { - if (!gf_lease || !gf_proto_lease) - return; + if (!gf_lease || !gf_proto_lease) + return; - gf_lease->cmd = gf_proto_lease->cmd; - gf_lease->lease_type = gf_proto_lease->lease_type; - memcpy (gf_lease->lease_id, gf_proto_lease->lease_id, LEASE_ID_SIZE); + gf_lease->cmd = gf_proto_lease->cmd; + gf_lease->lease_type = gf_proto_lease->lease_type; + memcpy(gf_lease->lease_id, gf_proto_lease->lease_id, LEASE_ID_SIZE); } static inline void -gf_proto_lease_from_lease (struct gf_proto_lease *gf_proto_lease, struct gf_lease *gf_lease) +gf_proto_lease_from_lease(struct gf_proto_lease *gf_proto_lease, + struct gf_lease *gf_lease) { - if (!gf_lease || !gf_proto_lease) - return; + if (!gf_lease || !gf_proto_lease) + return; - gf_proto_lease->cmd = gf_lease->cmd; - gf_proto_lease->lease_type = gf_lease->lease_type; - memcpy (gf_proto_lease->lease_id, gf_lease->lease_id, LEASE_ID_SIZE); + gf_proto_lease->cmd = gf_lease->cmd; + gf_proto_lease->lease_type = gf_lease->lease_type; + memcpy(gf_proto_lease->lease_id, gf_lease->lease_id, LEASE_ID_SIZE); } static inline int -gf_proto_recall_lease_to_upcall (struct gfs3_recall_lease_req *recall_lease, - struct gf_upcall *gf_up_data) +gf_proto_recall_lease_to_upcall(struct gfs3_recall_lease_req *recall_lease, + struct gf_upcall *gf_up_data) { - struct gf_upcall_recall_lease *tmp = NULL; - int ret = 0; + struct gf_upcall_recall_lease *tmp = NULL; + int ret = 0; - GF_VALIDATE_OR_GOTO(THIS->name, recall_lease, out); - GF_VALIDATE_OR_GOTO(THIS->name, gf_up_data, out); + GF_VALIDATE_OR_GOTO(THIS->name, recall_lease, out); + GF_VALIDATE_OR_GOTO(THIS->name, gf_up_data, out); - tmp = (struct gf_upcall_recall_lease *)gf_up_data->data; - tmp->lease_type = recall_lease->lease_type; - memcpy (gf_up_data->gfid, recall_lease->gfid, 16); - memcpy (tmp->tid, recall_lease->tid, 16); + tmp = (struct gf_upcall_recall_lease *)gf_up_data->data; + tmp->lease_type = recall_lease->lease_type; + memcpy(gf_up_data->gfid, recall_lease->gfid, 16); + memcpy(tmp->tid, recall_lease->tid, 16); - GF_PROTOCOL_DICT_UNSERIALIZE (THIS, tmp->dict, - (recall_lease->xdata).xdata_val, - (recall_lease->xdata).xdata_len, ret, - errno, out); + GF_PROTOCOL_DICT_UNSERIALIZE( + THIS, tmp->dict, (recall_lease->xdata).xdata_val, + (recall_lease->xdata).xdata_len, ret, errno, out); out: - return ret; - + return ret; } static inline int -gf_proto_recall_lease_from_upcall (xlator_t *this, - struct gfs3_recall_lease_req *recall_lease, - struct gf_upcall *gf_up_data) +gf_proto_recall_lease_from_upcall(xlator_t *this, + struct gfs3_recall_lease_req *recall_lease, + struct gf_upcall *gf_up_data) { - struct gf_upcall_recall_lease *tmp = NULL; - int ret = 0; + struct gf_upcall_recall_lease *tmp = NULL; + int ret = 0; - GF_VALIDATE_OR_GOTO(this->name, recall_lease, out); - GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); + GF_VALIDATE_OR_GOTO(this->name, recall_lease, out); + GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); - tmp = (struct gf_upcall_recall_lease *)gf_up_data->data; - recall_lease->lease_type = tmp->lease_type; - memcpy (recall_lease->gfid, gf_up_data->gfid, 16); - memcpy (recall_lease->tid, tmp->tid, 16); + tmp = (struct gf_upcall_recall_lease *)gf_up_data->data; + recall_lease->lease_type = tmp->lease_type; + memcpy(recall_lease->gfid, gf_up_data->gfid, 16); + memcpy(recall_lease->tid, tmp->tid, 16); - GF_PROTOCOL_DICT_SERIALIZE (this, tmp->dict, - &(recall_lease->xdata).xdata_val, - (recall_lease->xdata).xdata_len, ret, out); + GF_PROTOCOL_DICT_SERIALIZE(this, tmp->dict, + &(recall_lease->xdata).xdata_val, + (recall_lease->xdata).xdata_len, ret, out); out: - return ret; - + return ret; } static inline void -gf_proto_flock_to_flock (struct gf_proto_flock *gf_proto_flock, struct gf_flock *gf_flock) +gf_proto_flock_to_flock(struct gf_proto_flock *gf_proto_flock, + struct gf_flock *gf_flock) { - if (!gf_flock || !gf_proto_flock) - return; - - gf_flock->l_type = gf_proto_flock->type; - gf_flock->l_whence = gf_proto_flock->whence; - gf_flock->l_start = gf_proto_flock->start; - gf_flock->l_len = gf_proto_flock->len; - gf_flock->l_pid = gf_proto_flock->pid; - gf_flock->l_owner.len = gf_proto_flock->lk_owner.lk_owner_len; - if (gf_flock->l_owner.len && - (gf_flock->l_owner.len < GF_MAX_LOCK_OWNER_LEN)) - memcpy (gf_flock->l_owner.data, gf_proto_flock->lk_owner.lk_owner_val, - gf_flock->l_owner.len); + if (!gf_flock || !gf_proto_flock) + return; + + gf_flock->l_type = gf_proto_flock->type; + gf_flock->l_whence = gf_proto_flock->whence; + gf_flock->l_start = gf_proto_flock->start; + gf_flock->l_len = gf_proto_flock->len; + gf_flock->l_pid = gf_proto_flock->pid; + gf_flock->l_owner.len = gf_proto_flock->lk_owner.lk_owner_len; + if (gf_flock->l_owner.len && + (gf_flock->l_owner.len < GF_MAX_LOCK_OWNER_LEN)) + memcpy(gf_flock->l_owner.data, gf_proto_flock->lk_owner.lk_owner_val, + gf_flock->l_owner.len); } - static inline void -gf_proto_flock_from_flock (struct gf_proto_flock *gf_proto_flock, struct gf_flock *gf_flock) +gf_proto_flock_from_flock(struct gf_proto_flock *gf_proto_flock, + struct gf_flock *gf_flock) { - if (!gf_flock || !gf_proto_flock) - return; - - gf_proto_flock->type = (gf_flock->l_type); - gf_proto_flock->whence = (gf_flock->l_whence); - gf_proto_flock->start = (gf_flock->l_start); - gf_proto_flock->len = (gf_flock->l_len); - gf_proto_flock->pid = (gf_flock->l_pid); - gf_proto_flock->lk_owner.lk_owner_len = gf_flock->l_owner.len; - if (gf_flock->l_owner.len) - gf_proto_flock->lk_owner.lk_owner_val = gf_flock->l_owner.data; + if (!gf_flock || !gf_proto_flock) + return; + + gf_proto_flock->type = (gf_flock->l_type); + gf_proto_flock->whence = (gf_flock->l_whence); + gf_proto_flock->start = (gf_flock->l_start); + gf_proto_flock->len = (gf_flock->l_len); + gf_proto_flock->pid = (gf_flock->l_pid); + gf_proto_flock->lk_owner.lk_owner_len = gf_flock->l_owner.len; + if (gf_flock->l_owner.len) + gf_proto_flock->lk_owner.lk_owner_val = gf_flock->l_owner.data; } static inline void -gf_stat_to_iatt (struct gf_iatt *gf_stat, struct iatt *iatt) +gf_stat_to_iatt(struct gf_iatt *gf_stat, struct iatt *iatt) { - if (!iatt || !gf_stat) - return; - - memcpy (iatt->ia_gfid, gf_stat->ia_gfid, 16); - iatt->ia_ino = gf_stat->ia_ino ; - iatt->ia_dev = gf_stat->ia_dev ; - iatt->ia_type = ia_type_from_st_mode (gf_stat->mode) ; - iatt->ia_prot = ia_prot_from_st_mode (gf_stat->mode) ; - iatt->ia_nlink = gf_stat->ia_nlink ; - iatt->ia_uid = gf_stat->ia_uid ; - iatt->ia_gid = gf_stat->ia_gid ; - iatt->ia_rdev = gf_stat->ia_rdev ; - iatt->ia_size = gf_stat->ia_size ; - iatt->ia_blksize = gf_stat->ia_blksize ; - iatt->ia_blocks = gf_stat->ia_blocks ; - iatt->ia_atime = gf_stat->ia_atime ; - iatt->ia_atime_nsec = gf_stat->ia_atime_nsec ; - iatt->ia_mtime = gf_stat->ia_mtime ; - iatt->ia_mtime_nsec = gf_stat->ia_mtime_nsec ; - iatt->ia_ctime = gf_stat->ia_ctime ; - iatt->ia_ctime_nsec = gf_stat->ia_ctime_nsec ; + if (!iatt || !gf_stat) + return; + + memcpy(iatt->ia_gfid, gf_stat->ia_gfid, 16); + iatt->ia_ino = gf_stat->ia_ino; + iatt->ia_dev = gf_stat->ia_dev; + iatt->ia_type = ia_type_from_st_mode(gf_stat->mode); + iatt->ia_prot = ia_prot_from_st_mode(gf_stat->mode); + iatt->ia_nlink = gf_stat->ia_nlink; + iatt->ia_uid = gf_stat->ia_uid; + iatt->ia_gid = gf_stat->ia_gid; + iatt->ia_rdev = gf_stat->ia_rdev; + iatt->ia_size = gf_stat->ia_size; + iatt->ia_blksize = gf_stat->ia_blksize; + iatt->ia_blocks = gf_stat->ia_blocks; + iatt->ia_atime = gf_stat->ia_atime; + iatt->ia_atime_nsec = gf_stat->ia_atime_nsec; + iatt->ia_mtime = gf_stat->ia_mtime; + iatt->ia_mtime_nsec = gf_stat->ia_mtime_nsec; + iatt->ia_ctime = gf_stat->ia_ctime; + iatt->ia_ctime_nsec = gf_stat->ia_ctime_nsec; } static inline void -gf_stat_from_iatt (struct gf_iatt *gf_stat, struct iatt *iatt) +gf_stat_from_iatt(struct gf_iatt *gf_stat, struct iatt *iatt) { - if (!iatt || !gf_stat) - return; - - memcpy (gf_stat->ia_gfid, iatt->ia_gfid, 16); - gf_stat->ia_ino = iatt->ia_ino ; - gf_stat->ia_dev = iatt->ia_dev ; - gf_stat->mode = st_mode_from_ia (iatt->ia_prot, iatt->ia_type); - gf_stat->ia_nlink = iatt->ia_nlink ; - gf_stat->ia_uid = iatt->ia_uid ; - gf_stat->ia_gid = iatt->ia_gid ; - gf_stat->ia_rdev = iatt->ia_rdev ; - gf_stat->ia_size = iatt->ia_size ; - gf_stat->ia_blksize = iatt->ia_blksize ; - gf_stat->ia_blocks = iatt->ia_blocks ; - gf_stat->ia_atime = iatt->ia_atime ; - gf_stat->ia_atime_nsec = iatt->ia_atime_nsec ; - gf_stat->ia_mtime = iatt->ia_mtime ; - gf_stat->ia_mtime_nsec = iatt->ia_mtime_nsec ; - gf_stat->ia_ctime = iatt->ia_ctime ; - gf_stat->ia_ctime_nsec = iatt->ia_ctime_nsec ; + if (!iatt || !gf_stat) + return; + + memcpy(gf_stat->ia_gfid, iatt->ia_gfid, 16); + gf_stat->ia_ino = iatt->ia_ino; + gf_stat->ia_dev = iatt->ia_dev; + gf_stat->mode = st_mode_from_ia(iatt->ia_prot, iatt->ia_type); + gf_stat->ia_nlink = iatt->ia_nlink; + gf_stat->ia_uid = iatt->ia_uid; + gf_stat->ia_gid = iatt->ia_gid; + gf_stat->ia_rdev = iatt->ia_rdev; + gf_stat->ia_size = iatt->ia_size; + gf_stat->ia_blksize = iatt->ia_blksize; + gf_stat->ia_blocks = iatt->ia_blocks; + gf_stat->ia_atime = iatt->ia_atime; + gf_stat->ia_atime_nsec = iatt->ia_atime_nsec; + gf_stat->ia_mtime = iatt->ia_mtime; + gf_stat->ia_mtime_nsec = iatt->ia_mtime_nsec; + gf_stat->ia_ctime = iatt->ia_ctime; + gf_stat->ia_ctime_nsec = iatt->ia_ctime_nsec; } static inline int -gf_proto_cache_invalidation_from_upcall (xlator_t *this, - gfs3_cbk_cache_invalidation_req *gf_c_req, - struct gf_upcall *gf_up_data) +gf_proto_cache_invalidation_from_upcall( + xlator_t *this, gfs3_cbk_cache_invalidation_req *gf_c_req, + struct gf_upcall *gf_up_data) { - struct gf_upcall_cache_invalidation *gf_c_data = NULL; - int is_cache_inval = 0; - int ret = -1; - - GF_VALIDATE_OR_GOTO(this->name, gf_c_req, out); - GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); - - is_cache_inval = ((gf_up_data->event_type == - GF_UPCALL_CACHE_INVALIDATION) ? 1 : 0); - GF_VALIDATE_OR_GOTO(this->name, is_cache_inval, out); - - gf_c_data = (struct gf_upcall_cache_invalidation *)gf_up_data->data; - GF_VALIDATE_OR_GOTO(this->name, gf_c_data, out); - - gf_c_req->gfid = uuid_utoa (gf_up_data->gfid); - gf_c_req->event_type = gf_up_data->event_type; - gf_c_req->flags = gf_c_data->flags; - gf_c_req->expire_time_attr = gf_c_data->expire_time_attr; - gf_stat_from_iatt (&gf_c_req->stat, &gf_c_data->stat); - gf_stat_from_iatt (&gf_c_req->parent_stat, &gf_c_data->p_stat); - gf_stat_from_iatt (&gf_c_req->oldparent_stat, &gf_c_data->oldp_stat); - - ret = 0; - GF_PROTOCOL_DICT_SERIALIZE (this, gf_c_data->dict, &(gf_c_req->xdata).xdata_val, - (gf_c_req->xdata).xdata_len, ret, out); + struct gf_upcall_cache_invalidation *gf_c_data = NULL; + int is_cache_inval = 0; + int ret = -1; + + GF_VALIDATE_OR_GOTO(this->name, gf_c_req, out); + GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); + + is_cache_inval = ((gf_up_data->event_type == GF_UPCALL_CACHE_INVALIDATION) + ? 1 + : 0); + GF_VALIDATE_OR_GOTO(this->name, is_cache_inval, out); + + gf_c_data = (struct gf_upcall_cache_invalidation *)gf_up_data->data; + GF_VALIDATE_OR_GOTO(this->name, gf_c_data, out); + + gf_c_req->gfid = uuid_utoa(gf_up_data->gfid); + gf_c_req->event_type = gf_up_data->event_type; + gf_c_req->flags = gf_c_data->flags; + gf_c_req->expire_time_attr = gf_c_data->expire_time_attr; + gf_stat_from_iatt(&gf_c_req->stat, &gf_c_data->stat); + gf_stat_from_iatt(&gf_c_req->parent_stat, &gf_c_data->p_stat); + gf_stat_from_iatt(&gf_c_req->oldparent_stat, &gf_c_data->oldp_stat); + + ret = 0; + GF_PROTOCOL_DICT_SERIALIZE(this, gf_c_data->dict, + &(gf_c_req->xdata).xdata_val, + (gf_c_req->xdata).xdata_len, ret, out); out: - return ret; + return ret; } static inline int -gf_proto_cache_invalidation_to_upcall (xlator_t *this, - gfs3_cbk_cache_invalidation_req *gf_c_req, - struct gf_upcall *gf_up_data) +gf_proto_cache_invalidation_to_upcall(xlator_t *this, + gfs3_cbk_cache_invalidation_req *gf_c_req, + struct gf_upcall *gf_up_data) { - struct gf_upcall_cache_invalidation *gf_c_data = NULL; - int ret = -1; - - GF_VALIDATE_OR_GOTO(this->name, gf_c_req, out); - GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); - - gf_c_data = (struct gf_upcall_cache_invalidation *)gf_up_data->data; - GF_VALIDATE_OR_GOTO(this->name, gf_c_data, out); - - ret = gf_uuid_parse (gf_c_req->gfid, gf_up_data->gfid); - if (ret) { - gf_log (this->name, GF_LOG_WARNING, "gf_uuid_parse(%s) failed", - gf_c_req->gfid); - gf_up_data->event_type = GF_UPCALL_EVENT_NULL; - goto out; - } - - gf_up_data->event_type = gf_c_req->event_type; - - gf_c_data->flags = gf_c_req->flags; - gf_c_data->expire_time_attr = gf_c_req->expire_time_attr; - gf_stat_to_iatt (&gf_c_req->stat, &gf_c_data->stat); - gf_stat_to_iatt (&gf_c_req->parent_stat, &gf_c_data->p_stat); - gf_stat_to_iatt (&gf_c_req->oldparent_stat, &gf_c_data->oldp_stat); - - ret = 0; - GF_PROTOCOL_DICT_UNSERIALIZE (this, gf_c_data->dict, - (gf_c_req->xdata).xdata_val, - (gf_c_req->xdata).xdata_len, ret, - ret, out); - - /* If no dict was sent, create an empty dict, so that each xlator - * need not check if empty then create new dict. Will be unref'd by the - * caller */ - if (!gf_c_data->dict) - gf_c_data->dict = dict_new (); - out: - return ret; + struct gf_upcall_cache_invalidation *gf_c_data = NULL; + int ret = -1; + + GF_VALIDATE_OR_GOTO(this->name, gf_c_req, out); + GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); + + gf_c_data = (struct gf_upcall_cache_invalidation *)gf_up_data->data; + GF_VALIDATE_OR_GOTO(this->name, gf_c_data, out); + + ret = gf_uuid_parse(gf_c_req->gfid, gf_up_data->gfid); + if (ret) { + gf_log(this->name, GF_LOG_WARNING, "gf_uuid_parse(%s) failed", + gf_c_req->gfid); + gf_up_data->event_type = GF_UPCALL_EVENT_NULL; + goto out; + } + + gf_up_data->event_type = gf_c_req->event_type; + + gf_c_data->flags = gf_c_req->flags; + gf_c_data->expire_time_attr = gf_c_req->expire_time_attr; + gf_stat_to_iatt(&gf_c_req->stat, &gf_c_data->stat); + gf_stat_to_iatt(&gf_c_req->parent_stat, &gf_c_data->p_stat); + gf_stat_to_iatt(&gf_c_req->oldparent_stat, &gf_c_data->oldp_stat); + + ret = 0; + GF_PROTOCOL_DICT_UNSERIALIZE(this, gf_c_data->dict, + (gf_c_req->xdata).xdata_val, + (gf_c_req->xdata).xdata_len, ret, ret, out); + + /* If no dict was sent, create an empty dict, so that each xlator + * need not check if empty then create new dict. Will be unref'd by the + * caller */ + if (!gf_c_data->dict) + gf_c_data->dict = dict_new(); +out: + return ret; } static inline int -gf_proto_inodelk_contention_to_upcall (struct gfs4_inodelk_contention_req *lc, - struct gf_upcall *gf_up_data) +gf_proto_inodelk_contention_to_upcall(struct gfs4_inodelk_contention_req *lc, + struct gf_upcall *gf_up_data) { - struct gf_upcall_inodelk_contention *tmp = NULL; - xlator_t *this = NULL; - int ret = -1; - int op_errno = EINVAL; + struct gf_upcall_inodelk_contention *tmp = NULL; + xlator_t *this = NULL; + int ret = -1; + int op_errno = EINVAL; - this = THIS; + this = THIS; - GF_VALIDATE_OR_GOTO(this->name, lc, out); - GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); + GF_VALIDATE_OR_GOTO(this->name, lc, out); + GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); - tmp = (struct gf_upcall_inodelk_contention *)gf_up_data->data; + tmp = (struct gf_upcall_inodelk_contention *)gf_up_data->data; - gf_uuid_copy(gf_up_data->gfid, (unsigned char *)lc->gfid); + gf_uuid_copy(gf_up_data->gfid, (unsigned char *)lc->gfid); - gf_proto_flock_to_flock(&lc->flock, &tmp->flock); - tmp->pid = lc->pid; - tmp->domain = lc->domain; - if ((tmp->domain != NULL) && (*tmp->domain == 0)) { - tmp->domain = NULL; - } + gf_proto_flock_to_flock(&lc->flock, &tmp->flock); + tmp->pid = lc->pid; + tmp->domain = lc->domain; + if ((tmp->domain != NULL) && (*tmp->domain == 0)) { + tmp->domain = NULL; + } - GF_PROTOCOL_DICT_UNSERIALIZE (this, tmp->xdata, lc->xdata.xdata_val, - lc->xdata.xdata_len, ret, op_errno, out); + GF_PROTOCOL_DICT_UNSERIALIZE(this, tmp->xdata, lc->xdata.xdata_val, + lc->xdata.xdata_len, ret, op_errno, out); - ret = 0; + ret = 0; out: - if (ret < 0) { - ret = -op_errno; - } + if (ret < 0) { + ret = -op_errno; + } - return ret; + return ret; } static inline int -gf_proto_inodelk_contention_from_upcall (xlator_t *this, - struct gfs4_inodelk_contention_req *lc, - struct gf_upcall *gf_up_data) +gf_proto_inodelk_contention_from_upcall(xlator_t *this, + struct gfs4_inodelk_contention_req *lc, + struct gf_upcall *gf_up_data) { - struct gf_upcall_inodelk_contention *tmp = NULL; - int ret = -1; - int op_errno = EINVAL; + struct gf_upcall_inodelk_contention *tmp = NULL; + int ret = -1; + int op_errno = EINVAL; - GF_VALIDATE_OR_GOTO(this->name, lc, out); - GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); + GF_VALIDATE_OR_GOTO(this->name, lc, out); + GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); - tmp = (struct gf_upcall_inodelk_contention *)gf_up_data->data; + tmp = (struct gf_upcall_inodelk_contention *)gf_up_data->data; - gf_uuid_copy((unsigned char *)lc->gfid, gf_up_data->gfid); + gf_uuid_copy((unsigned char *)lc->gfid, gf_up_data->gfid); - gf_proto_flock_from_flock(&lc->flock, &tmp->flock); - lc->pid = tmp->pid; - lc->domain = (char *)tmp->domain; - if (lc->domain == NULL) { - lc->domain = ""; - } + gf_proto_flock_from_flock(&lc->flock, &tmp->flock); + lc->pid = tmp->pid; + lc->domain = (char *)tmp->domain; + if (lc->domain == NULL) { + lc->domain = ""; + } - GF_PROTOCOL_DICT_SERIALIZE (this, tmp->xdata, &lc->xdata.xdata_val, - lc->xdata.xdata_len, op_errno, out); + GF_PROTOCOL_DICT_SERIALIZE(this, tmp->xdata, &lc->xdata.xdata_val, + lc->xdata.xdata_len, op_errno, out); - ret = 0; + ret = 0; out: - if (ret < 0) { - ret = -op_errno; - } + if (ret < 0) { + ret = -op_errno; + } - return ret; + return ret; } static inline int -gf_proto_entrylk_contention_to_upcall (struct gfs4_entrylk_contention_req *lc, - struct gf_upcall *gf_up_data) +gf_proto_entrylk_contention_to_upcall(struct gfs4_entrylk_contention_req *lc, + struct gf_upcall *gf_up_data) { - struct gf_upcall_entrylk_contention *tmp = NULL; - xlator_t *this = NULL; - int ret = -1; - int op_errno = EINVAL; + struct gf_upcall_entrylk_contention *tmp = NULL; + xlator_t *this = NULL; + int ret = -1; + int op_errno = EINVAL; - this = THIS; + this = THIS; - GF_VALIDATE_OR_GOTO(this->name, lc, out); - GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); + GF_VALIDATE_OR_GOTO(this->name, lc, out); + GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); - tmp = (struct gf_upcall_entrylk_contention *)gf_up_data->data; + tmp = (struct gf_upcall_entrylk_contention *)gf_up_data->data; - gf_uuid_copy(gf_up_data->gfid, (unsigned char *)lc->gfid); + gf_uuid_copy(gf_up_data->gfid, (unsigned char *)lc->gfid); - tmp->type = lc->type; - tmp->name = lc->name; - if ((tmp->name != NULL) && (*tmp->name == 0)) { - tmp->name = NULL; - } - tmp->pid = lc->pid; - tmp->domain = lc->domain; - if ((tmp->domain != NULL) && (*tmp->domain == 0)) { - tmp->domain = NULL; - } + tmp->type = lc->type; + tmp->name = lc->name; + if ((tmp->name != NULL) && (*tmp->name == 0)) { + tmp->name = NULL; + } + tmp->pid = lc->pid; + tmp->domain = lc->domain; + if ((tmp->domain != NULL) && (*tmp->domain == 0)) { + tmp->domain = NULL; + } - GF_PROTOCOL_DICT_UNSERIALIZE (this, tmp->xdata, lc->xdata.xdata_val, - lc->xdata.xdata_len, ret, op_errno, out); + GF_PROTOCOL_DICT_UNSERIALIZE(this, tmp->xdata, lc->xdata.xdata_val, + lc->xdata.xdata_len, ret, op_errno, out); - ret = 0; + ret = 0; out: - if (ret < 0) { - ret = -op_errno; - } + if (ret < 0) { + ret = -op_errno; + } - return ret; + return ret; } static inline int -gf_proto_entrylk_contention_from_upcall (xlator_t *this, - struct gfs4_entrylk_contention_req *lc, - struct gf_upcall *gf_up_data) +gf_proto_entrylk_contention_from_upcall(xlator_t *this, + struct gfs4_entrylk_contention_req *lc, + struct gf_upcall *gf_up_data) { - struct gf_upcall_entrylk_contention *tmp = NULL; - int ret = -1; - int op_errno = EINVAL; + struct gf_upcall_entrylk_contention *tmp = NULL; + int ret = -1; + int op_errno = EINVAL; - GF_VALIDATE_OR_GOTO(this->name, lc, out); - GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); + GF_VALIDATE_OR_GOTO(this->name, lc, out); + GF_VALIDATE_OR_GOTO(this->name, gf_up_data, out); - tmp = (struct gf_upcall_entrylk_contention *)gf_up_data->data; + tmp = (struct gf_upcall_entrylk_contention *)gf_up_data->data; - gf_uuid_copy((unsigned char *)lc->gfid, gf_up_data->gfid); + gf_uuid_copy((unsigned char *)lc->gfid, gf_up_data->gfid); - lc->type = tmp->type; - lc->name = (char *)tmp->name; - if (lc->name == NULL) { - lc->name = ""; - } - lc->pid = tmp->pid; - lc->domain = (char *)tmp->domain; - if (lc->domain == NULL) { - lc->domain = ""; - } + lc->type = tmp->type; + lc->name = (char *)tmp->name; + if (lc->name == NULL) { + lc->name = ""; + } + lc->pid = tmp->pid; + lc->domain = (char *)tmp->domain; + if (lc->domain == NULL) { + lc->domain = ""; + } - GF_PROTOCOL_DICT_SERIALIZE (this, tmp->xdata, &lc->xdata.xdata_val, - lc->xdata.xdata_len, op_errno, out); + GF_PROTOCOL_DICT_SERIALIZE(this, tmp->xdata, &lc->xdata.xdata_val, + lc->xdata.xdata_len, op_errno, out); - ret = 0; + ret = 0; out: - if (ret < 0) { - ret = -op_errno; - } + if (ret < 0) { + ret = -op_errno; + } - return ret; + return ret; } static inline void -gfx_stat_to_iattx (struct gfx_iattx *gf_stat, struct iatt *iatt) +gfx_stat_to_iattx(struct gfx_iattx *gf_stat, struct iatt *iatt) { - if (!iatt || !gf_stat) - return; - - memcpy (iatt->ia_gfid, gf_stat->ia_gfid, 16); - - iatt->ia_flags = gf_stat->ia_flags; - iatt->ia_ino = gf_stat->ia_ino ; - iatt->ia_dev = gf_stat->ia_dev ; - iatt->ia_rdev = gf_stat->ia_rdev ; - iatt->ia_size = gf_stat->ia_size ; - iatt->ia_nlink = gf_stat->ia_nlink ; - iatt->ia_uid = gf_stat->ia_uid ; - iatt->ia_gid = gf_stat->ia_gid ; - iatt->ia_blksize = gf_stat->ia_blksize ; - iatt->ia_blocks = gf_stat->ia_blocks ; - iatt->ia_atime = gf_stat->ia_atime ; - iatt->ia_atime_nsec = gf_stat->ia_atime_nsec ; - iatt->ia_mtime = gf_stat->ia_mtime ; - iatt->ia_mtime_nsec = gf_stat->ia_mtime_nsec ; - iatt->ia_ctime = gf_stat->ia_ctime ; - iatt->ia_ctime_nsec = gf_stat->ia_ctime_nsec ; - iatt->ia_btime = gf_stat->ia_btime ; - iatt->ia_btime_nsec = gf_stat->ia_btime_nsec ; - iatt->ia_attributes = gf_stat->ia_attributes; - iatt->ia_attributes_mask = gf_stat->ia_attributes_mask; - - iatt->ia_type = ia_type_from_st_mode (gf_stat->mode); - iatt->ia_prot = ia_prot_from_st_mode (gf_stat->mode); + if (!iatt || !gf_stat) + return; + + memcpy(iatt->ia_gfid, gf_stat->ia_gfid, 16); + + iatt->ia_flags = gf_stat->ia_flags; + iatt->ia_ino = gf_stat->ia_ino; + iatt->ia_dev = gf_stat->ia_dev; + iatt->ia_rdev = gf_stat->ia_rdev; + iatt->ia_size = gf_stat->ia_size; + iatt->ia_nlink = gf_stat->ia_nlink; + iatt->ia_uid = gf_stat->ia_uid; + iatt->ia_gid = gf_stat->ia_gid; + iatt->ia_blksize = gf_stat->ia_blksize; + iatt->ia_blocks = gf_stat->ia_blocks; + iatt->ia_atime = gf_stat->ia_atime; + iatt->ia_atime_nsec = gf_stat->ia_atime_nsec; + iatt->ia_mtime = gf_stat->ia_mtime; + iatt->ia_mtime_nsec = gf_stat->ia_mtime_nsec; + iatt->ia_ctime = gf_stat->ia_ctime; + iatt->ia_ctime_nsec = gf_stat->ia_ctime_nsec; + iatt->ia_btime = gf_stat->ia_btime; + iatt->ia_btime_nsec = gf_stat->ia_btime_nsec; + iatt->ia_attributes = gf_stat->ia_attributes; + iatt->ia_attributes_mask = gf_stat->ia_attributes_mask; + + iatt->ia_type = ia_type_from_st_mode(gf_stat->mode); + iatt->ia_prot = ia_prot_from_st_mode(gf_stat->mode); } - static inline void -gfx_stat_from_iattx (struct gfx_iattx *gf_stat, struct iatt *iatt) +gfx_stat_from_iattx(struct gfx_iattx *gf_stat, struct iatt *iatt) { - if (!iatt || !gf_stat) - return; - - memcpy (gf_stat->ia_gfid, iatt->ia_gfid, 16); - gf_stat->ia_ino = iatt->ia_ino ; - gf_stat->ia_dev = iatt->ia_dev ; - - gf_stat->ia_nlink = iatt->ia_nlink ; - gf_stat->ia_uid = iatt->ia_uid ; - gf_stat->ia_gid = iatt->ia_gid ; - gf_stat->ia_rdev = iatt->ia_rdev ; - gf_stat->ia_size = iatt->ia_size ; - gf_stat->ia_blksize = iatt->ia_blksize ; - gf_stat->ia_blocks = iatt->ia_blocks ; - gf_stat->ia_atime = iatt->ia_atime ; - gf_stat->ia_atime_nsec = iatt->ia_atime_nsec ; - gf_stat->ia_mtime = iatt->ia_mtime ; - gf_stat->ia_mtime_nsec = iatt->ia_mtime_nsec ; - gf_stat->ia_ctime = iatt->ia_ctime ; - gf_stat->ia_ctime_nsec = iatt->ia_ctime_nsec ; - - gf_stat->ia_flags = iatt->ia_flags; - gf_stat->ia_btime = iatt->ia_btime ; - gf_stat->ia_btime_nsec = iatt->ia_btime_nsec ; - gf_stat->ia_attributes = iatt->ia_attributes; - gf_stat->ia_attributes_mask = iatt->ia_attributes_mask; - - gf_stat->mode = st_mode_from_ia (iatt->ia_prot, iatt->ia_type); + if (!iatt || !gf_stat) + return; + + memcpy(gf_stat->ia_gfid, iatt->ia_gfid, 16); + gf_stat->ia_ino = iatt->ia_ino; + gf_stat->ia_dev = iatt->ia_dev; + + gf_stat->ia_nlink = iatt->ia_nlink; + gf_stat->ia_uid = iatt->ia_uid; + gf_stat->ia_gid = iatt->ia_gid; + gf_stat->ia_rdev = iatt->ia_rdev; + gf_stat->ia_size = iatt->ia_size; + gf_stat->ia_blksize = iatt->ia_blksize; + gf_stat->ia_blocks = iatt->ia_blocks; + gf_stat->ia_atime = iatt->ia_atime; + gf_stat->ia_atime_nsec = iatt->ia_atime_nsec; + gf_stat->ia_mtime = iatt->ia_mtime; + gf_stat->ia_mtime_nsec = iatt->ia_mtime_nsec; + gf_stat->ia_ctime = iatt->ia_ctime; + gf_stat->ia_ctime_nsec = iatt->ia_ctime_nsec; + + gf_stat->ia_flags = iatt->ia_flags; + gf_stat->ia_btime = iatt->ia_btime; + gf_stat->ia_btime_nsec = iatt->ia_btime_nsec; + gf_stat->ia_attributes = iatt->ia_attributes; + gf_stat->ia_attributes_mask = iatt->ia_attributes_mask; + + gf_stat->mode = st_mode_from_ia(iatt->ia_prot, iatt->ia_type); } /* dict_to_xdr () */ static inline int -dict_to_xdr (dict_t *this, gfx_dict *dict) +dict_to_xdr(dict_t *this, gfx_dict *dict) { - int ret = -1; - int i = 0; - int index = 0; - data_pair_t *dpair = NULL; - gfx_dict_pair *xpair = NULL; - ssize_t size = 0; - - /* This is a failure as we expect destination to be valid */ - if (!dict) - goto out; - - /* This is OK as dictionary can be null, in which case, destination - should also know that it is NULL. */ - if (!this) { - /* encode special meaning data here, - while decoding, you know it is NULL dict */ - dict->count = -1; - /* everything else is normal */ - dict->pairs.pairs_len = 0; - ret = 0; - goto out; - } - - /* Do the whole operation in locked region */ - LOCK (&this->lock); - - dict->pairs.pairs_val = GF_CALLOC (1, (this->count * - sizeof (gfx_dict_pair)), - gf_common_mt_char); - if (!dict->pairs.pairs_val) - goto out; - - dpair = this->members_list; - for (i = 0; i < this->count; i++) { - xpair = &dict->pairs.pairs_val[index]; - - xpair->key.key_val = dpair->key; - xpair->key.key_len = strlen (dpair->key) + 1; - xpair->value.type = dpair->value->data_type; - switch (dpair->value->data_type) { - /* Add more type here */ - case GF_DATA_TYPE_INT: - index++; - xpair->value.gfx_value_u.value_int = - strtoll (dpair->value->data, NULL, 0); - break; - case GF_DATA_TYPE_UINT: - index++; - xpair->value.gfx_value_u.value_uint = - strtoull (dpair->value->data, NULL, 0); - break; - case GF_DATA_TYPE_DOUBLE: - index++; - xpair->value.gfx_value_u.value_dbl = - strtod (dpair->value->data, NULL); - break; - case GF_DATA_TYPE_STR: - index++; - xpair->value.gfx_value_u.val_string.val_string_val = dpair->value->data; - xpair->value.gfx_value_u.val_string.val_string_len = dpair->value->len; - break; - case GF_DATA_TYPE_IATT: - index++; - gfx_stat_from_iattx (&xpair->value.gfx_value_u.iatt, - (struct iatt *)dpair->value->data); - break; - case GF_DATA_TYPE_GFUUID: - index++; - memcpy (&xpair->value.gfx_value_u.uuid, - dpair->value->data, sizeof (uuid_t)); - break; - - case GF_DATA_TYPE_PTR: - index++; - /* Ideally, each type of data stored in dictionary - should have type. A pointer type shouldn't be - sent on wire */ - - /* This is done for backward compatibility as dict is - heavily used for transporting data over wire. - Ideally, wherever there is an issue, fix and - move on */ - xpair->value.gfx_value_u.other.other_val = - dpair->value->data; - xpair->value.gfx_value_u.other.other_len = - dpair->value->len; - - /* Change this to INFO, after taking the above down */ - gf_msg ("dict", GF_LOG_INFO, EINVAL, - LG_MSG_DICT_SERIAL_FAILED, - "key '%s' would not be sent on wire in the future", - dpair->key); - break; - default: - /* Unknown type and ptr type is not sent on wire */ - gf_msg ("dict", GF_LOG_WARNING, EINVAL, LG_MSG_DICT_SERIAL_FAILED, - "key '%s' is not sent on wire", dpair->key); - break; - } - dpair = dpair->next; + int ret = -1; + int i = 0; + int index = 0; + data_pair_t *dpair = NULL; + gfx_dict_pair *xpair = NULL; + ssize_t size = 0; + + /* This is a failure as we expect destination to be valid */ + if (!dict) + goto out; + + /* This is OK as dictionary can be null, in which case, destination + should also know that it is NULL. */ + if (!this) { + /* encode special meaning data here, + while decoding, you know it is NULL dict */ + dict->count = -1; + /* everything else is normal */ + dict->pairs.pairs_len = 0; + ret = 0; + goto out; + } + + /* Do the whole operation in locked region */ + LOCK(&this->lock); + + dict->pairs.pairs_val = GF_CALLOC(1, (this->count * sizeof(gfx_dict_pair)), + gf_common_mt_char); + if (!dict->pairs.pairs_val) + goto out; + + dpair = this->members_list; + for (i = 0; i < this->count; i++) { + xpair = &dict->pairs.pairs_val[index]; + + xpair->key.key_val = dpair->key; + xpair->key.key_len = strlen(dpair->key) + 1; + xpair->value.type = dpair->value->data_type; + switch (dpair->value->data_type) { + /* Add more type here */ + case GF_DATA_TYPE_INT: + index++; + xpair->value.gfx_value_u.value_int = strtoll(dpair->value->data, + NULL, 0); + break; + case GF_DATA_TYPE_UINT: + index++; + xpair->value.gfx_value_u.value_uint = strtoull( + dpair->value->data, NULL, 0); + break; + case GF_DATA_TYPE_DOUBLE: + index++; + xpair->value.gfx_value_u.value_dbl = strtod(dpair->value->data, + NULL); + break; + case GF_DATA_TYPE_STR: + index++; + xpair->value.gfx_value_u.val_string + .val_string_val = dpair->value->data; + xpair->value.gfx_value_u.val_string + .val_string_len = dpair->value->len; + break; + case GF_DATA_TYPE_IATT: + index++; + gfx_stat_from_iattx(&xpair->value.gfx_value_u.iatt, + (struct iatt *)dpair->value->data); + break; + case GF_DATA_TYPE_GFUUID: + index++; + memcpy(&xpair->value.gfx_value_u.uuid, dpair->value->data, + sizeof(uuid_t)); + break; + + case GF_DATA_TYPE_PTR: + index++; + /* Ideally, each type of data stored in dictionary + should have type. A pointer type shouldn't be + sent on wire */ + + /* This is done for backward compatibility as dict is + heavily used for transporting data over wire. + Ideally, wherever there is an issue, fix and + move on */ + xpair->value.gfx_value_u.other.other_val = dpair->value->data; + xpair->value.gfx_value_u.other.other_len = dpair->value->len; + + /* Change this to INFO, after taking the above down */ + gf_msg("dict", GF_LOG_INFO, EINVAL, LG_MSG_DICT_SERIAL_FAILED, + "key '%s' would not be sent on wire in the future", + dpair->key); + break; + default: + /* Unknown type and ptr type is not sent on wire */ + gf_msg("dict", GF_LOG_WARNING, EINVAL, + LG_MSG_DICT_SERIAL_FAILED, + "key '%s' is not sent on wire", dpair->key); + break; } + dpair = dpair->next; + } - dict->pairs.pairs_len = index; - dict->count = index; + dict->pairs.pairs_len = index; + dict->count = index; - /* This is required mainly in the RPC layer to understand the - boundary for proper payload. Hence only send the size of - variable XDR size. ie, the formula should be: - xdr_size = total size - (xdr_size + count + pairs.pairs_len)) */ - size = xdr_sizeof ((xdrproc_t) xdr_gfx_dict, dict); + /* This is required mainly in the RPC layer to understand the + boundary for proper payload. Hence only send the size of + variable XDR size. ie, the formula should be: + xdr_size = total size - (xdr_size + count + pairs.pairs_len)) */ + size = xdr_sizeof((xdrproc_t)xdr_gfx_dict, dict); - dict->xdr_size = (size > 12) ? (size - 12) : 0; + dict->xdr_size = (size > 12) ? (size - 12) : 0; - ret = 0; + ret = 0; out: - /* this can be null here, so unlock only if its not null */ - if (this) - UNLOCK (&this->lock); + /* this can be null here, so unlock only if its not null */ + if (this) + UNLOCK(&this->lock); - return ret; + return ret; } static inline int -xdr_to_dict (gfx_dict *dict, dict_t **to) +xdr_to_dict(gfx_dict *dict, dict_t **to) { - int ret = -1; - int index = 0; - char *key = NULL; - char *value = NULL; - gfx_dict_pair *xpair = NULL; - dict_t *this = NULL; - unsigned char *uuid = NULL; - struct iatt *iatt = NULL; - - if (!to || !dict) - goto out; - - if (dict->count < 0) { - /* indicates NULL dict was passed for encoding */ - ret = 0; - goto out; - } - - this = dict_new(); - if (!this) - goto out; - - for (index = 0; index < dict->pairs.pairs_len; index++) { - ret = -1; - xpair = &dict->pairs.pairs_val[index]; - - key = xpair->key.key_val; - switch (xpair->value.type) { - /* Add more type here */ - case GF_DATA_TYPE_INT: - ret = dict_set_int64 (this, key, - xpair->value.gfx_value_u.value_int); - break; - case GF_DATA_TYPE_UINT: - ret = dict_set_uint64 (this, key, - xpair->value.gfx_value_u.value_uint); - break; - case GF_DATA_TYPE_DOUBLE: - ret = dict_set_double (this, key, - xpair->value.gfx_value_u.value_dbl); - break; - case GF_DATA_TYPE_STR: - value = GF_MALLOC (xpair->value.gfx_value_u.val_string.val_string_len + 1, - gf_common_mt_char); - if (!value) { - errno = ENOMEM; - goto out; - } - memcpy (value, xpair->value.gfx_value_u.val_string.val_string_val, - xpair->value.gfx_value_u.val_string.val_string_len); - value[xpair->value.gfx_value_u.val_string.val_string_len] = '\0'; - free (xpair->value.gfx_value_u.val_string.val_string_val); - ret = dict_set_dynstr (this, key, value); - break; - case GF_DATA_TYPE_GFUUID: - uuid = GF_MALLOC (sizeof (uuid_t), gf_common_mt_uuid_t); - if (!uuid) { - errno = ENOMEM; - goto out; - } - memcpy (uuid, xpair->value.gfx_value_u.uuid, sizeof (uuid_t)); - ret = dict_set_gfuuid (this, key, uuid, false); - break; - case GF_DATA_TYPE_IATT: - iatt = GF_CALLOC (1, sizeof (struct iatt), gf_common_mt_char); - if (!iatt) { - errno = ENOMEM; - goto out; - } - gfx_stat_to_iattx (&xpair->value.gfx_value_u.iatt, iatt); - ret = dict_set_iatt (this, key, iatt, false); - break; - case GF_DATA_TYPE_PTR: - value = GF_MALLOC (xpair->value.gfx_value_u.other.other_len + 1, - gf_common_mt_char); - if (!value) { - errno = ENOMEM; - goto out; - } - memcpy (value, xpair->value.gfx_value_u.other.other_val, - xpair->value.gfx_value_u.other.other_len); - value[xpair->value.gfx_value_u.other.other_len] = '\0'; - free (xpair->value.gfx_value_u.other.other_val); - ret = dict_set_dynptr (this, key, value, - xpair->value.gfx_value_u.other.other_len); - break; - default: - ret = 0; - /* Unknown type and ptr type is not sent on wire */ - break; + int ret = -1; + int index = 0; + char *key = NULL; + char *value = NULL; + gfx_dict_pair *xpair = NULL; + dict_t *this = NULL; + unsigned char *uuid = NULL; + struct iatt *iatt = NULL; + + if (!to || !dict) + goto out; + + if (dict->count < 0) { + /* indicates NULL dict was passed for encoding */ + ret = 0; + goto out; + } + + this = dict_new(); + if (!this) + goto out; + + for (index = 0; index < dict->pairs.pairs_len; index++) { + ret = -1; + xpair = &dict->pairs.pairs_val[index]; + + key = xpair->key.key_val; + switch (xpair->value.type) { + /* Add more type here */ + case GF_DATA_TYPE_INT: + ret = dict_set_int64(this, key, + xpair->value.gfx_value_u.value_int); + break; + case GF_DATA_TYPE_UINT: + ret = dict_set_uint64(this, key, + xpair->value.gfx_value_u.value_uint); + break; + case GF_DATA_TYPE_DOUBLE: + ret = dict_set_double(this, key, + xpair->value.gfx_value_u.value_dbl); + break; + case GF_DATA_TYPE_STR: + value = GF_MALLOC( + xpair->value.gfx_value_u.val_string.val_string_len + 1, + gf_common_mt_char); + if (!value) { + errno = ENOMEM; + goto out; } - if (ret) { - gf_msg_debug (THIS->name, ENOMEM, - "failed to set the key (%s) into dict", - key); + memcpy(value, + xpair->value.gfx_value_u.val_string.val_string_val, + xpair->value.gfx_value_u.val_string.val_string_len); + value[xpair->value.gfx_value_u.val_string.val_string_len] = + '\0'; + free(xpair->value.gfx_value_u.val_string.val_string_val); + ret = dict_set_dynstr(this, key, value); + break; + case GF_DATA_TYPE_GFUUID: + uuid = GF_MALLOC(sizeof(uuid_t), gf_common_mt_uuid_t); + if (!uuid) { + errno = ENOMEM; + goto out; } - free (xpair->key.key_val); + memcpy(uuid, xpair->value.gfx_value_u.uuid, sizeof(uuid_t)); + ret = dict_set_gfuuid(this, key, uuid, false); + break; + case GF_DATA_TYPE_IATT: + iatt = GF_CALLOC(1, sizeof(struct iatt), gf_common_mt_char); + if (!iatt) { + errno = ENOMEM; + goto out; + } + gfx_stat_to_iattx(&xpair->value.gfx_value_u.iatt, iatt); + ret = dict_set_iatt(this, key, iatt, false); + break; + case GF_DATA_TYPE_PTR: + value = GF_MALLOC(xpair->value.gfx_value_u.other.other_len + 1, + gf_common_mt_char); + if (!value) { + errno = ENOMEM; + goto out; + } + memcpy(value, xpair->value.gfx_value_u.other.other_val, + xpair->value.gfx_value_u.other.other_len); + value[xpair->value.gfx_value_u.other.other_len] = '\0'; + free(xpair->value.gfx_value_u.other.other_val); + ret = dict_set_dynptr(this, key, value, + xpair->value.gfx_value_u.other.other_len); + break; + default: + ret = 0; + /* Unknown type and ptr type is not sent on wire */ + break; } + if (ret) { + gf_msg_debug(THIS->name, ENOMEM, + "failed to set the key (%s) into dict", key); + } + free(xpair->key.key_val); + } - free (dict->pairs.pairs_val); - ret = 0; + free(dict->pairs.pairs_val); + ret = 0; - /* If everything is fine, assign the dictionary to target */ - *to = this; - this = NULL; + /* If everything is fine, assign the dictionary to target */ + *to = this; + this = NULL; out: - if (this) - dict_unref (this); + if (this) + dict_unref(this); - return ret; + return ret; } #endif /* !_GLUSTERFS3_H */ diff --git a/rpc/xdr/src/msg-nfs3.h b/rpc/xdr/src/msg-nfs3.h index 628daea5547..869ddc3524a 100644 --- a/rpc/xdr/src/msg-nfs3.h +++ b/rpc/xdr/src/msg-nfs3.h @@ -18,202 +18,202 @@ #include <sys/uio.h> extern ssize_t -xdr_to_mountpath (struct iovec outpath, struct iovec inmsg); +xdr_to_mountpath(struct iovec outpath, struct iovec inmsg); extern ssize_t -xdr_serialize_mountres3 (struct iovec outmsg, mountres3 *res); +xdr_serialize_mountres3(struct iovec outmsg, mountres3 *res); extern ssize_t -xdr_serialize_mountbody (struct iovec outmsg, mountbody *mb); +xdr_serialize_mountbody(struct iovec outmsg, mountbody *mb); extern ssize_t -xdr_to_getattr3args (struct iovec inmsg, getattr3args *ga); +xdr_to_getattr3args(struct iovec inmsg, getattr3args *ga); extern ssize_t -xdr_serialize_getattr3res (struct iovec outmsg, getattr3res *res); +xdr_serialize_getattr3res(struct iovec outmsg, getattr3res *res); extern ssize_t -xdr_serialize_setattr3res (struct iovec outmsg, setattr3res *res); +xdr_serialize_setattr3res(struct iovec outmsg, setattr3res *res); extern ssize_t -xdr_to_setattr3args (struct iovec inmsg, setattr3args *sa); +xdr_to_setattr3args(struct iovec inmsg, setattr3args *sa); extern ssize_t -xdr_serialize_lookup3res (struct iovec outmsg, lookup3res *res); +xdr_serialize_lookup3res(struct iovec outmsg, lookup3res *res); extern ssize_t -xdr_to_lookup3args (struct iovec inmsg, lookup3args *la); +xdr_to_lookup3args(struct iovec inmsg, lookup3args *la); extern ssize_t -xdr_to_access3args (struct iovec inmsg, access3args *ac); +xdr_to_access3args(struct iovec inmsg, access3args *ac); extern ssize_t -xdr_serialize_access3res (struct iovec outmsg, access3res *res); +xdr_serialize_access3res(struct iovec outmsg, access3res *res); extern ssize_t -xdr_to_readlink3args (struct iovec inmsg, readlink3args *ra); +xdr_to_readlink3args(struct iovec inmsg, readlink3args *ra); extern ssize_t -xdr_serialize_readlink3res (struct iovec outmsg, readlink3res *res); +xdr_serialize_readlink3res(struct iovec outmsg, readlink3res *res); extern ssize_t -xdr_to_read3args (struct iovec inmsg, read3args *ra); +xdr_to_read3args(struct iovec inmsg, read3args *ra); extern ssize_t -xdr_serialize_read3res (struct iovec outmsg, read3res *res); +xdr_serialize_read3res(struct iovec outmsg, read3res *res); extern ssize_t -xdr_serialize_read3res_nocopy (struct iovec outmsg, read3res *res); +xdr_serialize_read3res_nocopy(struct iovec outmsg, read3res *res); extern ssize_t -xdr_to_write3args (struct iovec inmsg, write3args *wa); +xdr_to_write3args(struct iovec inmsg, write3args *wa); extern ssize_t -xdr_to_write3args_nocopy (struct iovec inmsg, write3args *wa, - struct iovec *payload); +xdr_to_write3args_nocopy(struct iovec inmsg, write3args *wa, + struct iovec *payload); extern ssize_t -xdr_serialize_write3res (struct iovec outmsg, write3res *res); +xdr_serialize_write3res(struct iovec outmsg, write3res *res); extern ssize_t -xdr_to_create3args (struct iovec inmsg, create3args *ca); +xdr_to_create3args(struct iovec inmsg, create3args *ca); extern ssize_t -xdr_serialize_create3res (struct iovec outmsg, create3res *res); +xdr_serialize_create3res(struct iovec outmsg, create3res *res); extern ssize_t -xdr_serialize_mkdir3res (struct iovec outmsg, mkdir3res *res); +xdr_serialize_mkdir3res(struct iovec outmsg, mkdir3res *res); extern ssize_t -xdr_to_mkdir3args (struct iovec inmsg, mkdir3args *ma); +xdr_to_mkdir3args(struct iovec inmsg, mkdir3args *ma); extern ssize_t -xdr_to_symlink3args (struct iovec inmsg, symlink3args *sa); +xdr_to_symlink3args(struct iovec inmsg, symlink3args *sa); extern ssize_t -xdr_serialize_symlink3res (struct iovec outmsg, symlink3res *res); +xdr_serialize_symlink3res(struct iovec outmsg, symlink3res *res); extern ssize_t -xdr_to_mknod3args (struct iovec inmsg, mknod3args *ma); +xdr_to_mknod3args(struct iovec inmsg, mknod3args *ma); extern ssize_t -xdr_serialize_mknod3res (struct iovec outmsg, mknod3res *res); +xdr_serialize_mknod3res(struct iovec outmsg, mknod3res *res); extern ssize_t -xdr_to_remove3args (struct iovec inmsg, remove3args *ra); +xdr_to_remove3args(struct iovec inmsg, remove3args *ra); extern ssize_t -xdr_serialize_remove3res (struct iovec outmsg, remove3res *res); +xdr_serialize_remove3res(struct iovec outmsg, remove3res *res); extern ssize_t -xdr_to_rmdir3args (struct iovec inmsg, rmdir3args *ra); +xdr_to_rmdir3args(struct iovec inmsg, rmdir3args *ra); extern ssize_t -xdr_serialize_rmdir3res (struct iovec outmsg, rmdir3res *res); +xdr_serialize_rmdir3res(struct iovec outmsg, rmdir3res *res); extern ssize_t -xdr_serialize_rename3res (struct iovec outmsg, rename3res *res); +xdr_serialize_rename3res(struct iovec outmsg, rename3res *res); extern ssize_t -xdr_to_rename3args (struct iovec inmsg, rename3args *ra); +xdr_to_rename3args(struct iovec inmsg, rename3args *ra); extern ssize_t -xdr_serialize_link3res (struct iovec outmsg, link3res *li); +xdr_serialize_link3res(struct iovec outmsg, link3res *li); extern ssize_t -xdr_to_link3args (struct iovec inmsg, link3args *la); +xdr_to_link3args(struct iovec inmsg, link3args *la); extern ssize_t -xdr_to_readdir3args (struct iovec inmsg, readdir3args *rd); +xdr_to_readdir3args(struct iovec inmsg, readdir3args *rd); extern ssize_t -xdr_serialize_readdir3res (struct iovec outmsg, readdir3res *res); +xdr_serialize_readdir3res(struct iovec outmsg, readdir3res *res); extern ssize_t -xdr_to_readdirp3args (struct iovec inmsg, readdirp3args *rp); +xdr_to_readdirp3args(struct iovec inmsg, readdirp3args *rp); extern ssize_t -xdr_serialize_readdirp3res (struct iovec outmsg, readdirp3res *res); +xdr_serialize_readdirp3res(struct iovec outmsg, readdirp3res *res); extern ssize_t -xdr_to_fsstat3args (struct iovec inmsg, fsstat3args *fa); +xdr_to_fsstat3args(struct iovec inmsg, fsstat3args *fa); extern ssize_t -xdr_serialize_fsstat3res (struct iovec outmsg, fsstat3res *res); +xdr_serialize_fsstat3res(struct iovec outmsg, fsstat3res *res); extern ssize_t -xdr_to_fsinfo3args (struct iovec inmsg, fsinfo3args *fi); +xdr_to_fsinfo3args(struct iovec inmsg, fsinfo3args *fi); extern ssize_t -xdr_serialize_fsinfo3res (struct iovec outmsg, fsinfo3res *res); +xdr_serialize_fsinfo3res(struct iovec outmsg, fsinfo3res *res); extern ssize_t -xdr_to_pathconf3args (struct iovec inmsg, pathconf3args *pc); +xdr_to_pathconf3args(struct iovec inmsg, pathconf3args *pc); extern ssize_t -xdr_serialize_pathconf3res (struct iovec outmsg, pathconf3res *res); +xdr_serialize_pathconf3res(struct iovec outmsg, pathconf3res *res); extern ssize_t -xdr_to_commit3args (struct iovec inmsg, commit3args *ca); +xdr_to_commit3args(struct iovec inmsg, commit3args *ca); extern ssize_t -xdr_serialize_commit3res (struct iovec outmsg, commit3res *res); +xdr_serialize_commit3res(struct iovec outmsg, commit3res *res); extern ssize_t -xdr_serialize_exports (struct iovec outmsg, exports *elist); +xdr_serialize_exports(struct iovec outmsg, exports *elist); extern ssize_t -xdr_serialize_mountlist (struct iovec outmsg, mountlist *ml); +xdr_serialize_mountlist(struct iovec outmsg, mountlist *ml); extern ssize_t -xdr_serialize_mountstat3 (struct iovec outmsg, mountstat3 *m); +xdr_serialize_mountstat3(struct iovec outmsg, mountstat3 *m); extern ssize_t -xdr_serialize_nfsstat3 (struct iovec outmsg, nfsstat3 *s); +xdr_serialize_nfsstat3(struct iovec outmsg, nfsstat3 *s); extern ssize_t -xdr_to_nlm4_testargs (struct iovec inmsg, nlm4_testargs *args); +xdr_to_nlm4_testargs(struct iovec inmsg, nlm4_testargs *args); extern ssize_t -xdr_serialize_nlm4_testres (struct iovec outmsg, nlm4_testres *res); +xdr_serialize_nlm4_testres(struct iovec outmsg, nlm4_testres *res); extern ssize_t -xdr_to_nlm4_lockargs (struct iovec inmsg, nlm4_lockargs *args); +xdr_to_nlm4_lockargs(struct iovec inmsg, nlm4_lockargs *args); extern ssize_t -xdr_serialize_nlm4_res (struct iovec outmsg, nlm4_res *res); +xdr_serialize_nlm4_res(struct iovec outmsg, nlm4_res *res); extern ssize_t -xdr_to_nlm4_cancelargs (struct iovec inmsg, nlm4_cancargs *args); +xdr_to_nlm4_cancelargs(struct iovec inmsg, nlm4_cancargs *args); extern ssize_t -xdr_to_nlm4_unlockargs (struct iovec inmsg, nlm4_unlockargs *args); +xdr_to_nlm4_unlockargs(struct iovec inmsg, nlm4_unlockargs *args); extern ssize_t -xdr_to_nlm4_shareargs (struct iovec inmsg, nlm4_shareargs *args); +xdr_to_nlm4_shareargs(struct iovec inmsg, nlm4_shareargs *args); extern ssize_t -xdr_serialize_nlm4_shareres (struct iovec outmsg, nlm4_shareres *res); +xdr_serialize_nlm4_shareres(struct iovec outmsg, nlm4_shareres *res); extern ssize_t -xdr_serialize_nlm4_testargs (struct iovec outmsg, nlm4_testargs *args); +xdr_serialize_nlm4_testargs(struct iovec outmsg, nlm4_testargs *args); extern ssize_t -xdr_to_nlm4_res (struct iovec inmsg, nlm4_res *args); +xdr_to_nlm4_res(struct iovec inmsg, nlm4_res *args); extern ssize_t -xdr_to_nlm4_freeallargs (struct iovec inmsg, nlm4_freeallargs *args); +xdr_to_nlm4_freeallargs(struct iovec inmsg, nlm4_freeallargs *args); extern ssize_t -xdr_to_getaclargs (struct iovec inmsg, getaclargs *args); +xdr_to_getaclargs(struct iovec inmsg, getaclargs *args); extern ssize_t -xdr_to_setaclargs (struct iovec inmsg, setaclargs *args); +xdr_to_setaclargs(struct iovec inmsg, setaclargs *args); extern ssize_t -xdr_serialize_getaclreply (struct iovec inmsg, getaclreply *res); +xdr_serialize_getaclreply(struct iovec inmsg, getaclreply *res); extern ssize_t -xdr_serialize_setaclreply (struct iovec inmsg, setaclreply *res); +xdr_serialize_setaclreply(struct iovec inmsg, setaclreply *res); #endif diff --git a/rpc/xdr/src/xdr-generic.h b/rpc/xdr/src/xdr-generic.h index 2f12290ef02..367ef555dd3 100644 --- a/rpc/xdr/src/xdr-generic.h +++ b/rpc/xdr/src/xdr-generic.h @@ -17,12 +17,14 @@ #include "compat.h" -#define xdr_decoded_remaining_addr(xdr) ((&xdr)->x_private) -#define xdr_decoded_remaining_len(xdr) ((&xdr)->x_handy) -#define xdr_encoded_length(xdr) (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base)) -#define xdr_decoded_length(xdr) (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base)) +#define xdr_decoded_remaining_addr(xdr) ((&xdr)->x_private) +#define xdr_decoded_remaining_len(xdr) ((&xdr)->x_handy) +#define xdr_encoded_length(xdr) \ + (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base)) +#define xdr_decoded_length(xdr) \ + (((size_t)(&xdr)->x_private) - ((size_t)(&xdr)->x_base)) -#define XDR_BYTES_PER_UNIT 4 +#define XDR_BYTES_PER_UNIT 4 /* On OSX > 10.9 @@ -47,29 +49,28 @@ */ #if defined(__NetBSD__) -#define PROC(xdr, res) proc(xdr, res) +#define PROC(xdr, res) proc(xdr, res) #else -#define PROC(xdr, res) proc(xdr, res, 0) +#define PROC(xdr, res) proc(xdr, res, 0) #endif ssize_t -xdr_serialize_generic (struct iovec outmsg, void *res, xdrproc_t proc); +xdr_serialize_generic(struct iovec outmsg, void *res, xdrproc_t proc); ssize_t -xdr_to_generic (struct iovec inmsg, void *args, xdrproc_t proc); +xdr_to_generic(struct iovec inmsg, void *args, xdrproc_t proc); ssize_t -xdr_to_generic_payload (struct iovec inmsg, void *args, xdrproc_t proc, - struct iovec *pendingpayload); - +xdr_to_generic_payload(struct iovec inmsg, void *args, xdrproc_t proc, + struct iovec *pendingpayload); extern int -xdr_bytes_round_up (struct iovec *vec, size_t bufsize); +xdr_bytes_round_up(struct iovec *vec, size_t bufsize); extern ssize_t -xdr_length_round_up (size_t len, size_t bufsize); +xdr_length_round_up(size_t len, size_t bufsize); void -xdr_vector_round_up (struct iovec *vec, int vcount, uint32_t count); +xdr_vector_round_up(struct iovec *vec, int vcount, uint32_t count); #endif /* !_XDR_GENERIC_H */ diff --git a/rpc/xdr/src/xdr-nfs3.h b/rpc/xdr/src/xdr-nfs3.h index 3861771e299..b7f5abefffd 100644 --- a/rpc/xdr/src/xdr-nfs3.h +++ b/rpc/xdr/src/xdr-nfs3.h @@ -14,25 +14,27 @@ #include <rpc/rpc.h> #include <sys/types.h> -#define NFS3_FHSIZE 64 -#define NFS3_COOKIEVERFSIZE 8 -#define NFS3_CREATEVERFSIZE 8 -#define NFS3_WRITEVERFSIZE 8 +#define NFS3_FHSIZE 64 +#define NFS3_COOKIEVERFSIZE 8 +#define NFS3_CREATEVERFSIZE 8 +#define NFS3_WRITEVERFSIZE 8 -#define NFS3_ENTRY3_FIXED_SIZE 24 -#define NFS3_POSTOPATTR_SIZE 88 -#define NFS3_READDIR_RESOK_SIZE (NFS3_POSTOPATTR_SIZE + sizeof (bool_t) + NFS3_COOKIEVERFSIZE) +#define NFS3_ENTRY3_FIXED_SIZE 24 +#define NFS3_POSTOPATTR_SIZE 88 +#define NFS3_READDIR_RESOK_SIZE \ + (NFS3_POSTOPATTR_SIZE + sizeof(bool_t) + NFS3_COOKIEVERFSIZE) /* In size of post_op_fh3, the length of the file handle will have to be * included separately since we have variable length fh. Here we only account * for the field for handle_follows and for the file handle length field. */ -#define NFS3_POSTOPFH3_FIXED_SIZE (sizeof (bool_t) + sizeof (uint32_t)) +#define NFS3_POSTOPFH3_FIXED_SIZE (sizeof(bool_t) + sizeof(uint32_t)) /* Similarly, the size of the entry will have to include the variable length * file handle and the length of the entry name. */ -#define NFS3_ENTRYP3_FIXED_SIZE (NFS3_ENTRY3_FIXED_SIZE + NFS3_POSTOPATTR_SIZE + NFS3_POSTOPFH3_FIXED_SIZE) +#define NFS3_ENTRYP3_FIXED_SIZE \ + (NFS3_ENTRY3_FIXED_SIZE + NFS3_POSTOPATTR_SIZE + NFS3_POSTOPFH3_FIXED_SIZE) typedef uint64_t uint64; typedef int64_t int64; @@ -52,284 +54,284 @@ typedef uint64 offset3; typedef uint32 mode3; typedef uint32 count3; -#define NFS3MODE_SETXUID 0x00800 -#define NFS3MODE_SETXGID 0x00400 -#define NFS3MODE_SAVESWAPTXT 0x00200 -#define NFS3MODE_ROWNER 0x00100 -#define NFS3MODE_WOWNER 0x00080 -#define NFS3MODE_XOWNER 0x00040 -#define NFS3MODE_RGROUP 0x00020 -#define NFS3MODE_WGROUP 0x00010 -#define NFS3MODE_XGROUP 0x00008 -#define NFS3MODE_ROTHER 0x00004 -#define NFS3MODE_WOTHER 0x00002 -#define NFS3MODE_XOTHER 0x00001 +#define NFS3MODE_SETXUID 0x00800 +#define NFS3MODE_SETXGID 0x00400 +#define NFS3MODE_SAVESWAPTXT 0x00200 +#define NFS3MODE_ROWNER 0x00100 +#define NFS3MODE_WOWNER 0x00080 +#define NFS3MODE_XOWNER 0x00040 +#define NFS3MODE_RGROUP 0x00020 +#define NFS3MODE_WGROUP 0x00010 +#define NFS3MODE_XGROUP 0x00008 +#define NFS3MODE_ROTHER 0x00004 +#define NFS3MODE_WOTHER 0x00002 +#define NFS3MODE_XOTHER 0x00001 enum nfsstat3 { - NFS3_OK = 0, - NFS3ERR_PERM = 1, - NFS3ERR_NOENT = 2, - NFS3ERR_IO = 5, - NFS3ERR_NXIO = 6, - NFS3ERR_ACCES = 13, - NFS3ERR_EXIST = 17, - NFS3ERR_XDEV = 18, - NFS3ERR_NODEV = 19, - NFS3ERR_NOTDIR = 20, - NFS3ERR_ISDIR = 21, - NFS3ERR_INVAL = 22, - NFS3ERR_FBIG = 27, - NFS3ERR_NOSPC = 28, - NFS3ERR_ROFS = 30, - NFS3ERR_MLINK = 31, - NFS3ERR_NAMETOOLONG = 63, - NFS3ERR_NOTEMPTY = 66, - NFS3ERR_DQUOT = 69, - NFS3ERR_STALE = 70, - NFS3ERR_REMOTE = 71, - NFS3ERR_BADHANDLE = 10001, - NFS3ERR_NOT_SYNC = 10002, - NFS3ERR_BAD_COOKIE = 10003, - NFS3ERR_NOTSUPP = 10004, - NFS3ERR_TOOSMALL = 10005, - NFS3ERR_SERVERFAULT = 10006, - NFS3ERR_BADTYPE = 10007, - NFS3ERR_JUKEBOX = 10008, - NFS3ERR_END_OF_LIST = -1, + NFS3_OK = 0, + NFS3ERR_PERM = 1, + NFS3ERR_NOENT = 2, + NFS3ERR_IO = 5, + NFS3ERR_NXIO = 6, + NFS3ERR_ACCES = 13, + NFS3ERR_EXIST = 17, + NFS3ERR_XDEV = 18, + NFS3ERR_NODEV = 19, + NFS3ERR_NOTDIR = 20, + NFS3ERR_ISDIR = 21, + NFS3ERR_INVAL = 22, + NFS3ERR_FBIG = 27, + NFS3ERR_NOSPC = 28, + NFS3ERR_ROFS = 30, + NFS3ERR_MLINK = 31, + NFS3ERR_NAMETOOLONG = 63, + NFS3ERR_NOTEMPTY = 66, + NFS3ERR_DQUOT = 69, + NFS3ERR_STALE = 70, + NFS3ERR_REMOTE = 71, + NFS3ERR_BADHANDLE = 10001, + NFS3ERR_NOT_SYNC = 10002, + NFS3ERR_BAD_COOKIE = 10003, + NFS3ERR_NOTSUPP = 10004, + NFS3ERR_TOOSMALL = 10005, + NFS3ERR_SERVERFAULT = 10006, + NFS3ERR_BADTYPE = 10007, + NFS3ERR_JUKEBOX = 10008, + NFS3ERR_END_OF_LIST = -1, }; typedef enum nfsstat3 nfsstat3; enum ftype3 { - NF3REG = 1, - NF3DIR = 2, - NF3BLK = 3, - NF3CHR = 4, - NF3LNK = 5, - NF3SOCK = 6, - NF3FIFO = 7, + NF3REG = 1, + NF3DIR = 2, + NF3BLK = 3, + NF3CHR = 4, + NF3LNK = 5, + NF3SOCK = 6, + NF3FIFO = 7, }; typedef enum ftype3 ftype3; struct specdata3 { - uint32 specdata1; - uint32 specdata2; + uint32 specdata1; + uint32 specdata2; }; typedef struct specdata3 specdata3; struct nfs_fh3 { - struct { - u_int data_len; - char *data_val; - } data; + struct { + u_int data_len; + char *data_val; + } data; }; typedef struct nfs_fh3 nfs_fh3; struct nfstime3 { - uint32 seconds; - uint32 nseconds; + uint32 seconds; + uint32 nseconds; }; typedef struct nfstime3 nfstime3; struct fattr3 { - ftype3 type; - mode3 mode; - uint32 nlink; - uid3 uid; - gid3 gid; - size3 size; - size3 used; - specdata3 rdev; - uint64 fsid; - fileid3 fileid; - nfstime3 atime; - nfstime3 mtime; - nfstime3 ctime; + ftype3 type; + mode3 mode; + uint32 nlink; + uid3 uid; + gid3 gid; + size3 size; + size3 used; + specdata3 rdev; + uint64 fsid; + fileid3 fileid; + nfstime3 atime; + nfstime3 mtime; + nfstime3 ctime; }; typedef struct fattr3 fattr3; struct post_op_attr { - bool_t attributes_follow; - union { - fattr3 attributes; - } post_op_attr_u; + bool_t attributes_follow; + union { + fattr3 attributes; + } post_op_attr_u; }; typedef struct post_op_attr post_op_attr; struct wcc_attr { - size3 size; - nfstime3 mtime; - nfstime3 ctime; + size3 size; + nfstime3 mtime; + nfstime3 ctime; }; typedef struct wcc_attr wcc_attr; struct pre_op_attr { - bool_t attributes_follow; - union { - wcc_attr attributes; - } pre_op_attr_u; + bool_t attributes_follow; + union { + wcc_attr attributes; + } pre_op_attr_u; }; typedef struct pre_op_attr pre_op_attr; struct wcc_data { - pre_op_attr before; - post_op_attr after; + pre_op_attr before; + post_op_attr after; }; typedef struct wcc_data wcc_data; struct post_op_fh3 { - bool_t handle_follows; - union { - nfs_fh3 handle; - } post_op_fh3_u; + bool_t handle_follows; + union { + nfs_fh3 handle; + } post_op_fh3_u; }; typedef struct post_op_fh3 post_op_fh3; enum time_how { - DONT_CHANGE = 0, - SET_TO_SERVER_TIME = 1, - SET_TO_CLIENT_TIME = 2, + DONT_CHANGE = 0, + SET_TO_SERVER_TIME = 1, + SET_TO_CLIENT_TIME = 2, }; typedef enum time_how time_how; struct set_mode3 { - bool_t set_it; - union { - mode3 mode; - } set_mode3_u; + bool_t set_it; + union { + mode3 mode; + } set_mode3_u; }; typedef struct set_mode3 set_mode3; struct set_uid3 { - bool_t set_it; - union { - uid3 uid; - } set_uid3_u; + bool_t set_it; + union { + uid3 uid; + } set_uid3_u; }; typedef struct set_uid3 set_uid3; struct set_gid3 { - bool_t set_it; - union { - gid3 gid; - } set_gid3_u; + bool_t set_it; + union { + gid3 gid; + } set_gid3_u; }; typedef struct set_gid3 set_gid3; struct set_size3 { - bool_t set_it; - union { - size3 size; - } set_size3_u; + bool_t set_it; + union { + size3 size; + } set_size3_u; }; typedef struct set_size3 set_size3; struct set_atime { - time_how set_it; - union { - nfstime3 atime; - } set_atime_u; + time_how set_it; + union { + nfstime3 atime; + } set_atime_u; }; typedef struct set_atime set_atime; struct set_mtime { - time_how set_it; - union { - nfstime3 mtime; - } set_mtime_u; + time_how set_it; + union { + nfstime3 mtime; + } set_mtime_u; }; typedef struct set_mtime set_mtime; struct sattr3 { - set_mode3 mode; - set_uid3 uid; - set_gid3 gid; - set_size3 size; - set_atime atime; - set_mtime mtime; + set_mode3 mode; + set_uid3 uid; + set_gid3 gid; + set_size3 size; + set_atime atime; + set_mtime mtime; }; typedef struct sattr3 sattr3; struct diropargs3 { - nfs_fh3 dir; - filename3 name; + nfs_fh3 dir; + filename3 name; }; typedef struct diropargs3 diropargs3; struct getattr3args { - nfs_fh3 object; + nfs_fh3 object; }; typedef struct getattr3args getattr3args; struct getattr3resok { - fattr3 obj_attributes; + fattr3 obj_attributes; }; typedef struct getattr3resok getattr3resok; struct getattr3res { - nfsstat3 status; - union { - getattr3resok resok; - } getattr3res_u; + nfsstat3 status; + union { + getattr3resok resok; + } getattr3res_u; }; typedef struct getattr3res getattr3res; struct sattrguard3 { - bool_t check; - union { - nfstime3 obj_ctime; - } sattrguard3_u; + bool_t check; + union { + nfstime3 obj_ctime; + } sattrguard3_u; }; typedef struct sattrguard3 sattrguard3; struct setattr3args { - nfs_fh3 object; - sattr3 new_attributes; - sattrguard3 guard; + nfs_fh3 object; + sattr3 new_attributes; + sattrguard3 guard; }; typedef struct setattr3args setattr3args; struct setattr3resok { - wcc_data obj_wcc; + wcc_data obj_wcc; }; typedef struct setattr3resok setattr3resok; struct setattr3resfail { - wcc_data obj_wcc; + wcc_data obj_wcc; }; typedef struct setattr3resfail setattr3resfail; struct setattr3res { - nfsstat3 status; - union { - setattr3resok resok; - setattr3resfail resfail; - } setattr3res_u; + nfsstat3 status; + union { + setattr3resok resok; + setattr3resfail resfail; + } setattr3res_u; }; typedef struct setattr3res setattr3res; struct lookup3args { - diropargs3 what; + diropargs3 what; }; typedef struct lookup3args lookup3args; struct lookup3resok { - nfs_fh3 object; - post_op_attr obj_attributes; - post_op_attr dir_attributes; + nfs_fh3 object; + post_op_attr obj_attributes; + post_op_attr dir_attributes; }; typedef struct lookup3resok lookup3resok; struct lookup3resfail { - post_op_attr dir_attributes; + post_op_attr dir_attributes; }; typedef struct lookup3resfail lookup3resfail; struct lookup3res { - nfsstat3 status; - union { - lookup3resok resok; - lookup3resfail resfail; - } lookup3res_u; + nfsstat3 status; + union { + lookup3resok resok; + lookup3resfail resfail; + } lookup3res_u; }; typedef struct lookup3res lookup3res; #define ACCESS3_READ 0x0001 @@ -340,104 +342,104 @@ typedef struct lookup3res lookup3res; #define ACCESS3_EXECUTE 0x0020 struct access3args { - nfs_fh3 object; - uint32 access; + nfs_fh3 object; + uint32 access; }; typedef struct access3args access3args; struct access3resok { - post_op_attr obj_attributes; - uint32 access; + post_op_attr obj_attributes; + uint32 access; }; typedef struct access3resok access3resok; struct access3resfail { - post_op_attr obj_attributes; + post_op_attr obj_attributes; }; typedef struct access3resfail access3resfail; struct access3res { - nfsstat3 status; - union { - access3resok resok; - access3resfail resfail; - } access3res_u; + nfsstat3 status; + union { + access3resok resok; + access3resfail resfail; + } access3res_u; }; typedef struct access3res access3res; struct readlink3args { - nfs_fh3 symlink; + nfs_fh3 symlink; }; typedef struct readlink3args readlink3args; struct readlink3resok { - post_op_attr symlink_attributes; - nfspath3 data; + post_op_attr symlink_attributes; + nfspath3 data; }; typedef struct readlink3resok readlink3resok; struct readlink3resfail { - post_op_attr symlink_attributes; + post_op_attr symlink_attributes; }; typedef struct readlink3resfail readlink3resfail; struct readlink3res { - nfsstat3 status; - union { - readlink3resok resok; - readlink3resfail resfail; - } readlink3res_u; + nfsstat3 status; + union { + readlink3resok resok; + readlink3resfail resfail; + } readlink3res_u; }; typedef struct readlink3res readlink3res; struct read3args { - nfs_fh3 file; - offset3 offset; - count3 count; + nfs_fh3 file; + offset3 offset; + count3 count; }; typedef struct read3args read3args; struct read3resok { - post_op_attr file_attributes; - count3 count; - bool_t eof; - struct { - u_int data_len; - char *data_val; - } data; + post_op_attr file_attributes; + count3 count; + bool_t eof; + struct { + u_int data_len; + char *data_val; + } data; }; typedef struct read3resok read3resok; struct read3resfail { - post_op_attr file_attributes; + post_op_attr file_attributes; }; typedef struct read3resfail read3resfail; struct read3res { - nfsstat3 status; - union { - read3resok resok; - read3resfail resfail; - } read3res_u; + nfsstat3 status; + union { + read3resok resok; + read3resfail resfail; + } read3res_u; }; typedef struct read3res read3res; enum stable_how { - UNSTABLE = 0, - DATA_SYNC = 1, - FILE_SYNC = 2, + UNSTABLE = 0, + DATA_SYNC = 1, + FILE_SYNC = 2, }; typedef enum stable_how stable_how; struct write3args { - nfs_fh3 file; - offset3 offset; - count3 count; - stable_how stable; - struct { - u_int data_len; - char *data_val; - } data; + nfs_fh3 file; + offset3 offset; + count3 count; + stable_how stable; + struct { + u_int data_len; + char *data_val; + } data; }; typedef struct write3args write3args; @@ -446,393 +448,395 @@ typedef struct write3args write3args; * sizeof (nfs_fh3) rather than first trying to extract the fh size of the * network followed by a sized-read of the file handle. */ -#define NFS3_WRITE3ARGS_SIZE (sizeof (uint32_t) + NFS3_FHSIZE + sizeof (offset3) + sizeof (count3) + sizeof (uint32_t)) +#define NFS3_WRITE3ARGS_SIZE \ + (sizeof(uint32_t) + NFS3_FHSIZE + sizeof(offset3) + sizeof(count3) + \ + sizeof(uint32_t)) struct write3resok { - wcc_data file_wcc; - count3 count; - stable_how committed; - writeverf3 verf; + wcc_data file_wcc; + count3 count; + stable_how committed; + writeverf3 verf; }; typedef struct write3resok write3resok; struct write3resfail { - wcc_data file_wcc; + wcc_data file_wcc; }; typedef struct write3resfail write3resfail; struct write3res { - nfsstat3 status; - union { - write3resok resok; - write3resfail resfail; - } write3res_u; + nfsstat3 status; + union { + write3resok resok; + write3resfail resfail; + } write3res_u; }; typedef struct write3res write3res; enum createmode3 { - UNCHECKED = 0, - GUARDED = 1, - EXCLUSIVE = 2, + UNCHECKED = 0, + GUARDED = 1, + EXCLUSIVE = 2, }; typedef enum createmode3 createmode3; struct createhow3 { - createmode3 mode; - union { - sattr3 obj_attributes; - createverf3 verf; - } createhow3_u; + createmode3 mode; + union { + sattr3 obj_attributes; + createverf3 verf; + } createhow3_u; }; typedef struct createhow3 createhow3; struct create3args { - diropargs3 where; - createhow3 how; + diropargs3 where; + createhow3 how; }; typedef struct create3args create3args; struct create3resok { - post_op_fh3 obj; - post_op_attr obj_attributes; - wcc_data dir_wcc; + post_op_fh3 obj; + post_op_attr obj_attributes; + wcc_data dir_wcc; }; typedef struct create3resok create3resok; struct create3resfail { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct create3resfail create3resfail; struct create3res { - nfsstat3 status; - union { - create3resok resok; - create3resfail resfail; - } create3res_u; + nfsstat3 status; + union { + create3resok resok; + create3resfail resfail; + } create3res_u; }; typedef struct create3res create3res; struct mkdir3args { - diropargs3 where; - sattr3 attributes; + diropargs3 where; + sattr3 attributes; }; typedef struct mkdir3args mkdir3args; struct mkdir3resok { - post_op_fh3 obj; - post_op_attr obj_attributes; - wcc_data dir_wcc; + post_op_fh3 obj; + post_op_attr obj_attributes; + wcc_data dir_wcc; }; typedef struct mkdir3resok mkdir3resok; struct mkdir3resfail { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct mkdir3resfail mkdir3resfail; struct mkdir3res { - nfsstat3 status; - union { - mkdir3resok resok; - mkdir3resfail resfail; - } mkdir3res_u; + nfsstat3 status; + union { + mkdir3resok resok; + mkdir3resfail resfail; + } mkdir3res_u; }; typedef struct mkdir3res mkdir3res; struct symlinkdata3 { - sattr3 symlink_attributes; - nfspath3 symlink_data; + sattr3 symlink_attributes; + nfspath3 symlink_data; }; typedef struct symlinkdata3 symlinkdata3; struct symlink3args { - diropargs3 where; - symlinkdata3 symlink; + diropargs3 where; + symlinkdata3 symlink; }; typedef struct symlink3args symlink3args; struct symlink3resok { - post_op_fh3 obj; - post_op_attr obj_attributes; - wcc_data dir_wcc; + post_op_fh3 obj; + post_op_attr obj_attributes; + wcc_data dir_wcc; }; typedef struct symlink3resok symlink3resok; struct symlink3resfail { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct symlink3resfail symlink3resfail; struct symlink3res { - nfsstat3 status; - union { - symlink3resok resok; - symlink3resfail resfail; - } symlink3res_u; + nfsstat3 status; + union { + symlink3resok resok; + symlink3resfail resfail; + } symlink3res_u; }; typedef struct symlink3res symlink3res; struct devicedata3 { - sattr3 dev_attributes; - specdata3 spec; + sattr3 dev_attributes; + specdata3 spec; }; typedef struct devicedata3 devicedata3; struct mknoddata3 { - ftype3 type; - union { - devicedata3 device; - sattr3 pipe_attributes; - } mknoddata3_u; + ftype3 type; + union { + devicedata3 device; + sattr3 pipe_attributes; + } mknoddata3_u; }; typedef struct mknoddata3 mknoddata3; struct mknod3args { - diropargs3 where; - mknoddata3 what; + diropargs3 where; + mknoddata3 what; }; typedef struct mknod3args mknod3args; struct mknod3resok { - post_op_fh3 obj; - post_op_attr obj_attributes; - wcc_data dir_wcc; + post_op_fh3 obj; + post_op_attr obj_attributes; + wcc_data dir_wcc; }; typedef struct mknod3resok mknod3resok; struct mknod3resfail { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct mknod3resfail mknod3resfail; struct mknod3res { - nfsstat3 status; - union { - mknod3resok resok; - mknod3resfail resfail; - } mknod3res_u; + nfsstat3 status; + union { + mknod3resok resok; + mknod3resfail resfail; + } mknod3res_u; }; typedef struct mknod3res mknod3res; struct remove3args { - diropargs3 object; + diropargs3 object; }; typedef struct remove3args remove3args; struct remove3resok { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct remove3resok remove3resok; struct remove3resfail { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct remove3resfail remove3resfail; struct remove3res { - nfsstat3 status; - union { - remove3resok resok; - remove3resfail resfail; - } remove3res_u; + nfsstat3 status; + union { + remove3resok resok; + remove3resfail resfail; + } remove3res_u; }; typedef struct remove3res remove3res; struct rmdir3args { - diropargs3 object; + diropargs3 object; }; typedef struct rmdir3args rmdir3args; struct rmdir3resok { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct rmdir3resok rmdir3resok; struct rmdir3resfail { - wcc_data dir_wcc; + wcc_data dir_wcc; }; typedef struct rmdir3resfail rmdir3resfail; struct rmdir3res { - nfsstat3 status; - union { - rmdir3resok resok; - rmdir3resfail resfail; - } rmdir3res_u; + nfsstat3 status; + union { + rmdir3resok resok; + rmdir3resfail resfail; + } rmdir3res_u; }; typedef struct rmdir3res rmdir3res; struct rename3args { - diropargs3 from; - diropargs3 to; + diropargs3 from; + diropargs3 to; }; typedef struct rename3args rename3args; struct rename3resok { - wcc_data fromdir_wcc; - wcc_data todir_wcc; + wcc_data fromdir_wcc; + wcc_data todir_wcc; }; typedef struct rename3resok rename3resok; struct rename3resfail { - wcc_data fromdir_wcc; - wcc_data todir_wcc; + wcc_data fromdir_wcc; + wcc_data todir_wcc; }; typedef struct rename3resfail rename3resfail; struct rename3res { - nfsstat3 status; - union { - rename3resok resok; - rename3resfail resfail; - } rename3res_u; + nfsstat3 status; + union { + rename3resok resok; + rename3resfail resfail; + } rename3res_u; }; typedef struct rename3res rename3res; struct link3args { - nfs_fh3 file; - diropargs3 link; + nfs_fh3 file; + diropargs3 link; }; typedef struct link3args link3args; struct link3resok { - post_op_attr file_attributes; - wcc_data linkdir_wcc; + post_op_attr file_attributes; + wcc_data linkdir_wcc; }; typedef struct link3resok link3resok; struct link3resfail { - post_op_attr file_attributes; - wcc_data linkdir_wcc; + post_op_attr file_attributes; + wcc_data linkdir_wcc; }; typedef struct link3resfail link3resfail; struct link3res { - nfsstat3 status; - union { - link3resok resok; - link3resfail resfail; - } link3res_u; + nfsstat3 status; + union { + link3resok resok; + link3resfail resfail; + } link3res_u; }; typedef struct link3res link3res; struct readdir3args { - nfs_fh3 dir; - cookie3 cookie; - cookieverf3 cookieverf; - count3 count; + nfs_fh3 dir; + cookie3 cookie; + cookieverf3 cookieverf; + count3 count; }; typedef struct readdir3args readdir3args; struct entry3 { - fileid3 fileid; - filename3 name; - cookie3 cookie; - struct entry3 *nextentry; + fileid3 fileid; + filename3 name; + cookie3 cookie; + struct entry3 *nextentry; }; typedef struct entry3 entry3; struct dirlist3 { - entry3 *entries; - bool_t eof; + entry3 *entries; + bool_t eof; }; typedef struct dirlist3 dirlist3; struct readdir3resok { - post_op_attr dir_attributes; - cookieverf3 cookieverf; - dirlist3 reply; + post_op_attr dir_attributes; + cookieverf3 cookieverf; + dirlist3 reply; }; typedef struct readdir3resok readdir3resok; struct readdir3resfail { - post_op_attr dir_attributes; + post_op_attr dir_attributes; }; typedef struct readdir3resfail readdir3resfail; struct readdir3res { - nfsstat3 status; - union { - readdir3resok resok; - readdir3resfail resfail; - } readdir3res_u; + nfsstat3 status; + union { + readdir3resok resok; + readdir3resfail resfail; + } readdir3res_u; }; typedef struct readdir3res readdir3res; struct readdirp3args { - nfs_fh3 dir; - cookie3 cookie; - cookieverf3 cookieverf; - count3 dircount; - count3 maxcount; + nfs_fh3 dir; + cookie3 cookie; + cookieverf3 cookieverf; + count3 dircount; + count3 maxcount; }; typedef struct readdirp3args readdirp3args; struct entryp3 { - fileid3 fileid; - filename3 name; - cookie3 cookie; - post_op_attr name_attributes; - post_op_fh3 name_handle; - struct entryp3 *nextentry; + fileid3 fileid; + filename3 name; + cookie3 cookie; + post_op_attr name_attributes; + post_op_fh3 name_handle; + struct entryp3 *nextentry; }; typedef struct entryp3 entryp3; struct dirlistp3 { - entryp3 *entries; - bool_t eof; + entryp3 *entries; + bool_t eof; }; typedef struct dirlistp3 dirlistp3; struct readdirp3resok { - post_op_attr dir_attributes; - cookieverf3 cookieverf; - dirlistp3 reply; + post_op_attr dir_attributes; + cookieverf3 cookieverf; + dirlistp3 reply; }; typedef struct readdirp3resok readdirp3resok; struct readdirp3resfail { - post_op_attr dir_attributes; + post_op_attr dir_attributes; }; typedef struct readdirp3resfail readdirp3resfail; struct readdirp3res { - nfsstat3 status; - union { - readdirp3resok resok; - readdirp3resfail resfail; - } readdirp3res_u; + nfsstat3 status; + union { + readdirp3resok resok; + readdirp3resfail resfail; + } readdirp3res_u; }; typedef struct readdirp3res readdirp3res; struct fsstat3args { - nfs_fh3 fsroot; + nfs_fh3 fsroot; }; typedef struct fsstat3args fsstat3args; struct fsstat3resok { - post_op_attr obj_attributes; - size3 tbytes; - size3 fbytes; - size3 abytes; - size3 tfiles; - size3 ffiles; - size3 afiles; - uint32 invarsec; + post_op_attr obj_attributes; + size3 tbytes; + size3 fbytes; + size3 abytes; + size3 tfiles; + size3 ffiles; + size3 afiles; + uint32 invarsec; }; typedef struct fsstat3resok fsstat3resok; struct fsstat3resfail { - post_op_attr obj_attributes; + post_op_attr obj_attributes; }; typedef struct fsstat3resfail fsstat3resfail; struct fsstat3res { - nfsstat3 status; - union { - fsstat3resok resok; - fsstat3resfail resfail; - } fsstat3res_u; + nfsstat3 status; + union { + fsstat3resok resok; + fsstat3resfail resfail; + } fsstat3res_u; }; typedef struct fsstat3res fsstat3res; #define FSF3_LINK 0x0001 @@ -841,93 +845,93 @@ typedef struct fsstat3res fsstat3res; #define FSF3_CANSETTIME 0x0010 struct fsinfo3args { - nfs_fh3 fsroot; + nfs_fh3 fsroot; }; typedef struct fsinfo3args fsinfo3args; struct fsinfo3resok { - post_op_attr obj_attributes; - uint32 rtmax; - uint32 rtpref; - uint32 rtmult; - uint32 wtmax; - uint32 wtpref; - uint32 wtmult; - uint32 dtpref; - size3 maxfilesize; - nfstime3 time_delta; - uint32 properties; + post_op_attr obj_attributes; + uint32 rtmax; + uint32 rtpref; + uint32 rtmult; + uint32 wtmax; + uint32 wtpref; + uint32 wtmult; + uint32 dtpref; + size3 maxfilesize; + nfstime3 time_delta; + uint32 properties; }; typedef struct fsinfo3resok fsinfo3resok; struct fsinfo3resfail { - post_op_attr obj_attributes; + post_op_attr obj_attributes; }; typedef struct fsinfo3resfail fsinfo3resfail; struct fsinfo3res { - nfsstat3 status; - union { - fsinfo3resok resok; - fsinfo3resfail resfail; - } fsinfo3res_u; + nfsstat3 status; + union { + fsinfo3resok resok; + fsinfo3resfail resfail; + } fsinfo3res_u; }; typedef struct fsinfo3res fsinfo3res; struct pathconf3args { - nfs_fh3 object; + nfs_fh3 object; }; typedef struct pathconf3args pathconf3args; struct pathconf3resok { - post_op_attr obj_attributes; - uint32 linkmax; - uint32 name_max; - bool_t no_trunc; - bool_t chown_restricted; - bool_t case_insensitive; - bool_t case_preserving; + post_op_attr obj_attributes; + uint32 linkmax; + uint32 name_max; + bool_t no_trunc; + bool_t chown_restricted; + bool_t case_insensitive; + bool_t case_preserving; }; typedef struct pathconf3resok pathconf3resok; struct pathconf3resfail { - post_op_attr obj_attributes; + post_op_attr obj_attributes; }; typedef struct pathconf3resfail pathconf3resfail; struct pathconf3res { - nfsstat3 status; - union { - pathconf3resok resok; - pathconf3resfail resfail; - } pathconf3res_u; + nfsstat3 status; + union { + pathconf3resok resok; + pathconf3resfail resfail; + } pathconf3res_u; }; typedef struct pathconf3res pathconf3res; struct commit3args { - nfs_fh3 file; - offset3 offset; - count3 count; + nfs_fh3 file; + offset3 offset; + count3 count; }; typedef struct commit3args commit3args; struct commit3resok { - wcc_data file_wcc; - writeverf3 verf; + wcc_data file_wcc; + writeverf3 verf; }; typedef struct commit3resok commit3resok; struct commit3resfail { - wcc_data file_wcc; + wcc_data file_wcc; }; typedef struct commit3resfail commit3resfail; struct commit3res { - nfsstat3 status; - union { - commit3resok resok; - commit3resfail resfail; - } commit3res_u; + nfsstat3 status; + union { + commit3resok resok; + commit3resfail resfail; + } commit3res_u; }; typedef struct commit3res commit3res; #define MNTPATHLEN 1024 @@ -935,8 +939,8 @@ typedef struct commit3res commit3res; #define FHSIZE3 NFS3_FHSIZE typedef struct { - u_int fhandle3_len; - char *fhandle3_val; + u_int fhandle3_len; + char *fhandle3_val; } fhandle3; typedef char *dirpath; @@ -944,257 +948,404 @@ typedef char *dirpath; typedef char *name; enum mountstat3 { - MNT3_OK = 0, - MNT3ERR_PERM = 1, - MNT3ERR_NOENT = 2, - MNT3ERR_IO = 5, - MNT3ERR_ACCES = 13, - MNT3ERR_NOTDIR = 20, - MNT3ERR_INVAL = 22, - MNT3ERR_NAMETOOLONG = 63, - MNT3ERR_NOTSUPP = 10004, - MNT3ERR_SERVERFAULT = 10006, + MNT3_OK = 0, + MNT3ERR_PERM = 1, + MNT3ERR_NOENT = 2, + MNT3ERR_IO = 5, + MNT3ERR_ACCES = 13, + MNT3ERR_NOTDIR = 20, + MNT3ERR_INVAL = 22, + MNT3ERR_NAMETOOLONG = 63, + MNT3ERR_NOTSUPP = 10004, + MNT3ERR_SERVERFAULT = 10006, }; typedef enum mountstat3 mountstat3; struct mountres3_ok { - fhandle3 fhandle; - struct { - u_int auth_flavors_len; - int *auth_flavors_val; - } auth_flavors; + fhandle3 fhandle; + struct { + u_int auth_flavors_len; + int *auth_flavors_val; + } auth_flavors; }; typedef struct mountres3_ok mountres3_ok; struct mountres3 { - mountstat3 fhs_status; - union { - mountres3_ok mountinfo; - } mountres3_u; + mountstat3 fhs_status; + union { + mountres3_ok mountinfo; + } mountres3_u; }; typedef struct mountres3 mountres3; typedef struct mountbody *mountlist; struct mountbody { - name ml_hostname; - dirpath ml_directory; - mountlist ml_next; + name ml_hostname; + dirpath ml_directory; + mountlist ml_next; }; typedef struct mountbody mountbody; typedef struct groupnode *groups; struct groupnode { - name gr_name; - groups gr_next; + name gr_name; + groups gr_next; }; typedef struct groupnode groupnode; typedef struct exportnode *exports; struct exportnode { - dirpath ex_dir; - groups ex_groups; - exports ex_next; + dirpath ex_dir; + groups ex_groups; + exports ex_next; }; typedef struct exportnode exportnode; -#define NFS_PROGRAM 100003 -#define NFS_V3 3 - -#define NFS3_NULL 0 -#define NFS3_GETATTR 1 -#define NFS3_SETATTR 2 -#define NFS3_LOOKUP 3 -#define NFS3_ACCESS 4 -#define NFS3_READLINK 5 -#define NFS3_READ 6 -#define NFS3_WRITE 7 -#define NFS3_CREATE 8 -#define NFS3_MKDIR 9 -#define NFS3_SYMLINK 10 -#define NFS3_MKNOD 11 -#define NFS3_REMOVE 12 -#define NFS3_RMDIR 13 -#define NFS3_RENAME 14 -#define NFS3_LINK 15 -#define NFS3_READDIR 16 -#define NFS3_READDIRP 17 -#define NFS3_FSSTAT 18 -#define NFS3_FSINFO 19 -#define NFS3_PATHCONF 20 -#define NFS3_COMMIT 21 -#define NFS3_PROC_COUNT 22 - -#define MOUNT_PROGRAM 100005 -#define MOUNT_V3 3 -#define MOUNT_V1 1 - -#define MOUNT3_NULL 0 -#define MOUNT3_MNT 1 -#define MOUNT3_DUMP 2 -#define MOUNT3_UMNT 3 -#define MOUNT3_UMNTALL 4 -#define MOUNT3_EXPORT 5 -#define MOUNT3_PROC_COUNT 6 - -#define MOUNT1_NULL 0 -#define MOUNT1_MNT 1 -#define MOUNT1_DUMP 2 -#define MOUNT1_UMNT 3 -#define MOUNT1_UMNTALL 4 -#define MOUNT1_EXPORT 5 -#define MOUNT1_PROC_COUNT 6 +#define NFS_PROGRAM 100003 +#define NFS_V3 3 + +#define NFS3_NULL 0 +#define NFS3_GETATTR 1 +#define NFS3_SETATTR 2 +#define NFS3_LOOKUP 3 +#define NFS3_ACCESS 4 +#define NFS3_READLINK 5 +#define NFS3_READ 6 +#define NFS3_WRITE 7 +#define NFS3_CREATE 8 +#define NFS3_MKDIR 9 +#define NFS3_SYMLINK 10 +#define NFS3_MKNOD 11 +#define NFS3_REMOVE 12 +#define NFS3_RMDIR 13 +#define NFS3_RENAME 14 +#define NFS3_LINK 15 +#define NFS3_READDIR 16 +#define NFS3_READDIRP 17 +#define NFS3_FSSTAT 18 +#define NFS3_FSINFO 19 +#define NFS3_PATHCONF 20 +#define NFS3_COMMIT 21 +#define NFS3_PROC_COUNT 22 + +#define MOUNT_PROGRAM 100005 +#define MOUNT_V3 3 +#define MOUNT_V1 1 + +#define MOUNT3_NULL 0 +#define MOUNT3_MNT 1 +#define MOUNT3_DUMP 2 +#define MOUNT3_UMNT 3 +#define MOUNT3_UMNTALL 4 +#define MOUNT3_EXPORT 5 +#define MOUNT3_PROC_COUNT 6 + +#define MOUNT1_NULL 0 +#define MOUNT1_MNT 1 +#define MOUNT1_DUMP 2 +#define MOUNT1_UMNT 3 +#define MOUNT1_UMNTALL 4 +#define MOUNT1_EXPORT 5 +#define MOUNT1_PROC_COUNT 6 /* the xdr functions */ -extern bool_t xdr_uint64 (XDR *, uint64*); -extern bool_t xdr_int64 (XDR *, int64*); -extern bool_t xdr_uint32 (XDR *, uint32*); -extern bool_t xdr_int32 (XDR *, int32*); -extern bool_t xdr_filename3 (XDR *, filename3*); -extern bool_t xdr_nfspath3 (XDR *, nfspath3*); -extern bool_t xdr_fileid3 (XDR *, fileid3*); -extern bool_t xdr_cookie3 (XDR *, cookie3*); -extern bool_t xdr_cookieverf3 (XDR *, cookieverf3); -extern bool_t xdr_createverf3 (XDR *, createverf3); -extern bool_t xdr_writeverf3 (XDR *, writeverf3); -extern bool_t xdr_uid3 (XDR *, uid3*); -extern bool_t xdr_gid3 (XDR *, gid3*); -extern bool_t xdr_size3 (XDR *, size3*); -extern bool_t xdr_offset3 (XDR *, offset3*); -extern bool_t xdr_mode3 (XDR *, mode3*); -extern bool_t xdr_count3 (XDR *, count3*); -extern bool_t xdr_nfsstat3 (XDR *, nfsstat3*); -extern bool_t xdr_ftype3 (XDR *, ftype3*); -extern bool_t xdr_specdata3 (XDR *, specdata3*); -extern bool_t xdr_nfs_fh3 (XDR *, nfs_fh3*); -extern bool_t xdr_nfstime3 (XDR *, nfstime3*); -extern bool_t xdr_fattr3 (XDR *, fattr3*); -extern bool_t xdr_post_op_attr (XDR *, post_op_attr*); -extern bool_t xdr_wcc_attr (XDR *, wcc_attr*); -extern bool_t xdr_pre_op_attr (XDR *, pre_op_attr*); -extern bool_t xdr_wcc_data (XDR *, wcc_data*); -extern bool_t xdr_post_op_fh3 (XDR *, post_op_fh3*); -extern bool_t xdr_time_how (XDR *, time_how*); -extern bool_t xdr_set_mode3 (XDR *, set_mode3*); -extern bool_t xdr_set_uid3 (XDR *, set_uid3*); -extern bool_t xdr_set_gid3 (XDR *, set_gid3*); -extern bool_t xdr_set_size3 (XDR *, set_size3*); -extern bool_t xdr_set_atime (XDR *, set_atime*); -extern bool_t xdr_set_mtime (XDR *, set_mtime*); -extern bool_t xdr_sattr3 (XDR *, sattr3*); -extern bool_t xdr_diropargs3 (XDR *, diropargs3*); -extern bool_t xdr_getattr3args (XDR *, getattr3args*); -extern bool_t xdr_getattr3resok (XDR *, getattr3resok*); -extern bool_t xdr_getattr3res (XDR *, getattr3res*); -extern bool_t xdr_sattrguard3 (XDR *, sattrguard3*); -extern bool_t xdr_setattr3args (XDR *, setattr3args*); -extern bool_t xdr_setattr3resok (XDR *, setattr3resok*); -extern bool_t xdr_setattr3resfail (XDR *, setattr3resfail*); -extern bool_t xdr_setattr3res (XDR *, setattr3res*); -extern bool_t xdr_lookup3args (XDR *, lookup3args*); -extern bool_t xdr_lookup3resok (XDR *, lookup3resok*); -extern bool_t xdr_lookup3resfail (XDR *, lookup3resfail*); -extern bool_t xdr_lookup3res (XDR *, lookup3res*); -extern bool_t xdr_access3args (XDR *, access3args*); -extern bool_t xdr_access3resok (XDR *, access3resok*); -extern bool_t xdr_access3resfail (XDR *, access3resfail*); -extern bool_t xdr_access3res (XDR *, access3res*); -extern bool_t xdr_readlink3args (XDR *, readlink3args*); -extern bool_t xdr_readlink3resok (XDR *, readlink3resok*); -extern bool_t xdr_readlink3resfail (XDR *, readlink3resfail*); -extern bool_t xdr_readlink3res (XDR *, readlink3res*); -extern bool_t xdr_read3args (XDR *, read3args*); -extern bool_t xdr_read3resok (XDR *, read3resok*); -extern bool_t xdr_read3resfail (XDR *, read3resfail*); -extern bool_t xdr_read3res (XDR *, read3res*); -extern bool_t xdr_read3res_nocopy (XDR *xdrs, read3res *objp); -extern bool_t xdr_stable_how (XDR *, stable_how*); -extern bool_t xdr_write3args (XDR *, write3args*); -extern bool_t xdr_write3resok (XDR *, write3resok*); -extern bool_t xdr_write3resfail (XDR *, write3resfail*); -extern bool_t xdr_write3res (XDR *, write3res*); -extern bool_t xdr_createmode3 (XDR *, createmode3*); -extern bool_t xdr_createhow3 (XDR *, createhow3*); -extern bool_t xdr_create3args (XDR *, create3args*); -extern bool_t xdr_create3resok (XDR *, create3resok*); -extern bool_t xdr_create3resfail (XDR *, create3resfail*); -extern bool_t xdr_create3res (XDR *, create3res*); -extern bool_t xdr_mkdir3args (XDR *, mkdir3args*); -extern bool_t xdr_mkdir3resok (XDR *, mkdir3resok*); -extern bool_t xdr_mkdir3resfail (XDR *, mkdir3resfail*); -extern bool_t xdr_mkdir3res (XDR *, mkdir3res*); -extern bool_t xdr_symlinkdata3 (XDR *, symlinkdata3*); -extern bool_t xdr_symlink3args (XDR *, symlink3args*); -extern bool_t xdr_symlink3resok (XDR *, symlink3resok*); -extern bool_t xdr_symlink3resfail (XDR *, symlink3resfail*); -extern bool_t xdr_symlink3res (XDR *, symlink3res*); -extern bool_t xdr_devicedata3 (XDR *, devicedata3*); -extern bool_t xdr_mknoddata3 (XDR *, mknoddata3*); -extern bool_t xdr_mknod3args (XDR *, mknod3args*); -extern bool_t xdr_mknod3resok (XDR *, mknod3resok*); -extern bool_t xdr_mknod3resfail (XDR *, mknod3resfail*); -extern bool_t xdr_mknod3res (XDR *, mknod3res*); -extern bool_t xdr_remove3args (XDR *, remove3args*); -extern bool_t xdr_remove3resok (XDR *, remove3resok*); -extern bool_t xdr_remove3resfail (XDR *, remove3resfail*); -extern bool_t xdr_remove3res (XDR *, remove3res*); -extern bool_t xdr_rmdir3args (XDR *, rmdir3args*); -extern bool_t xdr_rmdir3resok (XDR *, rmdir3resok*); -extern bool_t xdr_rmdir3resfail (XDR *, rmdir3resfail*); -extern bool_t xdr_rmdir3res (XDR *, rmdir3res*); -extern bool_t xdr_rename3args (XDR *, rename3args*); -extern bool_t xdr_rename3resok (XDR *, rename3resok*); -extern bool_t xdr_rename3resfail (XDR *, rename3resfail*); -extern bool_t xdr_rename3res (XDR *, rename3res*); -extern bool_t xdr_link3args (XDR *, link3args*); -extern bool_t xdr_link3resok (XDR *, link3resok*); -extern bool_t xdr_link3resfail (XDR *, link3resfail*); -extern bool_t xdr_link3res (XDR *, link3res*); -extern bool_t xdr_readdir3args (XDR *, readdir3args*); -extern bool_t xdr_entry3 (XDR *, entry3*); -extern bool_t xdr_dirlist3 (XDR *, dirlist3*); -extern bool_t xdr_readdir3resok (XDR *, readdir3resok*); -extern bool_t xdr_readdir3resfail (XDR *, readdir3resfail*); -extern bool_t xdr_readdir3res (XDR *, readdir3res*); -extern bool_t xdr_readdirp3args (XDR *, readdirp3args*); -extern bool_t xdr_entryp3 (XDR *, entryp3*); -extern bool_t xdr_dirlistp3 (XDR *, dirlistp3*); -extern bool_t xdr_readdirp3resok (XDR *, readdirp3resok*); -extern bool_t xdr_readdirp3resfail (XDR *, readdirp3resfail*); -extern bool_t xdr_readdirp3res (XDR *, readdirp3res*); -extern bool_t xdr_fsstat3args (XDR *, fsstat3args*); -extern bool_t xdr_fsstat3resok (XDR *, fsstat3resok*); -extern bool_t xdr_fsstat3resfail (XDR *, fsstat3resfail*); -extern bool_t xdr_fsstat3res (XDR *, fsstat3res*); -extern bool_t xdr_fsinfo3args (XDR *, fsinfo3args*); -extern bool_t xdr_fsinfo3resok (XDR *, fsinfo3resok*); -extern bool_t xdr_fsinfo3resfail (XDR *, fsinfo3resfail*); -extern bool_t xdr_fsinfo3res (XDR *, fsinfo3res*); -extern bool_t xdr_pathconf3args (XDR *, pathconf3args*); -extern bool_t xdr_pathconf3resok (XDR *, pathconf3resok*); -extern bool_t xdr_pathconf3resfail (XDR *, pathconf3resfail*); -extern bool_t xdr_pathconf3res (XDR *, pathconf3res*); -extern bool_t xdr_commit3args (XDR *, commit3args*); -extern bool_t xdr_commit3resok (XDR *, commit3resok*); -extern bool_t xdr_commit3resfail (XDR *, commit3resfail*); -extern bool_t xdr_commit3res (XDR *, commit3res*); -extern bool_t xdr_fhandle3 (XDR *, fhandle3*); -extern bool_t xdr_dirpath (XDR *, dirpath*); -extern bool_t xdr_name (XDR *, name*); -extern bool_t xdr_mountstat3 (XDR *, mountstat3*); -extern bool_t xdr_mountres3_ok (XDR *, mountres3_ok*); -extern bool_t xdr_mountres3 (XDR *, mountres3*); -extern bool_t xdr_mountlist (XDR *, mountlist*); -extern bool_t xdr_mountbody (XDR *, mountbody*); -extern bool_t xdr_groups (XDR *, groups*); -extern bool_t xdr_groupnode (XDR *, groupnode*); -extern bool_t xdr_exports (XDR *, exports*); -extern bool_t xdr_exportnode (XDR *, exportnode*); - -extern void xdr_free_exports_list (struct exportnode *first); -extern void xdr_free_mountlist (mountlist ml); - -extern void xdr_free_write3args_nocopy (write3args *wa); +extern bool_t +xdr_uint64(XDR *, uint64 *); +extern bool_t +xdr_int64(XDR *, int64 *); +extern bool_t +xdr_uint32(XDR *, uint32 *); +extern bool_t +xdr_int32(XDR *, int32 *); +extern bool_t +xdr_filename3(XDR *, filename3 *); +extern bool_t +xdr_nfspath3(XDR *, nfspath3 *); +extern bool_t +xdr_fileid3(XDR *, fileid3 *); +extern bool_t +xdr_cookie3(XDR *, cookie3 *); +extern bool_t +xdr_cookieverf3(XDR *, cookieverf3); +extern bool_t +xdr_createverf3(XDR *, createverf3); +extern bool_t +xdr_writeverf3(XDR *, writeverf3); +extern bool_t +xdr_uid3(XDR *, uid3 *); +extern bool_t +xdr_gid3(XDR *, gid3 *); +extern bool_t +xdr_size3(XDR *, size3 *); +extern bool_t +xdr_offset3(XDR *, offset3 *); +extern bool_t +xdr_mode3(XDR *, mode3 *); +extern bool_t +xdr_count3(XDR *, count3 *); +extern bool_t +xdr_nfsstat3(XDR *, nfsstat3 *); +extern bool_t +xdr_ftype3(XDR *, ftype3 *); +extern bool_t +xdr_specdata3(XDR *, specdata3 *); +extern bool_t +xdr_nfs_fh3(XDR *, nfs_fh3 *); +extern bool_t +xdr_nfstime3(XDR *, nfstime3 *); +extern bool_t +xdr_fattr3(XDR *, fattr3 *); +extern bool_t +xdr_post_op_attr(XDR *, post_op_attr *); +extern bool_t +xdr_wcc_attr(XDR *, wcc_attr *); +extern bool_t +xdr_pre_op_attr(XDR *, pre_op_attr *); +extern bool_t +xdr_wcc_data(XDR *, wcc_data *); +extern bool_t +xdr_post_op_fh3(XDR *, post_op_fh3 *); +extern bool_t +xdr_time_how(XDR *, time_how *); +extern bool_t +xdr_set_mode3(XDR *, set_mode3 *); +extern bool_t +xdr_set_uid3(XDR *, set_uid3 *); +extern bool_t +xdr_set_gid3(XDR *, set_gid3 *); +extern bool_t +xdr_set_size3(XDR *, set_size3 *); +extern bool_t +xdr_set_atime(XDR *, set_atime *); +extern bool_t +xdr_set_mtime(XDR *, set_mtime *); +extern bool_t +xdr_sattr3(XDR *, sattr3 *); +extern bool_t +xdr_diropargs3(XDR *, diropargs3 *); +extern bool_t +xdr_getattr3args(XDR *, getattr3args *); +extern bool_t +xdr_getattr3resok(XDR *, getattr3resok *); +extern bool_t +xdr_getattr3res(XDR *, getattr3res *); +extern bool_t +xdr_sattrguard3(XDR *, sattrguard3 *); +extern bool_t +xdr_setattr3args(XDR *, setattr3args *); +extern bool_t +xdr_setattr3resok(XDR *, setattr3resok *); +extern bool_t +xdr_setattr3resfail(XDR *, setattr3resfail *); +extern bool_t +xdr_setattr3res(XDR *, setattr3res *); +extern bool_t +xdr_lookup3args(XDR *, lookup3args *); +extern bool_t +xdr_lookup3resok(XDR *, lookup3resok *); +extern bool_t +xdr_lookup3resfail(XDR *, lookup3resfail *); +extern bool_t +xdr_lookup3res(XDR *, lookup3res *); +extern bool_t +xdr_access3args(XDR *, access3args *); +extern bool_t +xdr_access3resok(XDR *, access3resok *); +extern bool_t +xdr_access3resfail(XDR *, access3resfail *); +extern bool_t +xdr_access3res(XDR *, access3res *); +extern bool_t +xdr_readlink3args(XDR *, readlink3args *); +extern bool_t +xdr_readlink3resok(XDR *, readlink3resok *); +extern bool_t +xdr_readlink3resfail(XDR *, readlink3resfail *); +extern bool_t +xdr_readlink3res(XDR *, readlink3res *); +extern bool_t +xdr_read3args(XDR *, read3args *); +extern bool_t +xdr_read3resok(XDR *, read3resok *); +extern bool_t +xdr_read3resfail(XDR *, read3resfail *); +extern bool_t +xdr_read3res(XDR *, read3res *); +extern bool_t +xdr_read3res_nocopy(XDR *xdrs, read3res *objp); +extern bool_t +xdr_stable_how(XDR *, stable_how *); +extern bool_t +xdr_write3args(XDR *, write3args *); +extern bool_t +xdr_write3resok(XDR *, write3resok *); +extern bool_t +xdr_write3resfail(XDR *, write3resfail *); +extern bool_t +xdr_write3res(XDR *, write3res *); +extern bool_t +xdr_createmode3(XDR *, createmode3 *); +extern bool_t +xdr_createhow3(XDR *, createhow3 *); +extern bool_t +xdr_create3args(XDR *, create3args *); +extern bool_t +xdr_create3resok(XDR *, create3resok *); +extern bool_t +xdr_create3resfail(XDR *, create3resfail *); +extern bool_t +xdr_create3res(XDR *, create3res *); +extern bool_t +xdr_mkdir3args(XDR *, mkdir3args *); +extern bool_t +xdr_mkdir3resok(XDR *, mkdir3resok *); +extern bool_t +xdr_mkdir3resfail(XDR *, mkdir3resfail *); +extern bool_t +xdr_mkdir3res(XDR *, mkdir3res *); +extern bool_t +xdr_symlinkdata3(XDR *, symlinkdata3 *); +extern bool_t +xdr_symlink3args(XDR *, symlink3args *); +extern bool_t +xdr_symlink3resok(XDR *, symlink3resok *); +extern bool_t +xdr_symlink3resfail(XDR *, symlink3resfail *); +extern bool_t +xdr_symlink3res(XDR *, symlink3res *); +extern bool_t +xdr_devicedata3(XDR *, devicedata3 *); +extern bool_t +xdr_mknoddata3(XDR *, mknoddata3 *); +extern bool_t +xdr_mknod3args(XDR *, mknod3args *); +extern bool_t +xdr_mknod3resok(XDR *, mknod3resok *); +extern bool_t +xdr_mknod3resfail(XDR *, mknod3resfail *); +extern bool_t +xdr_mknod3res(XDR *, mknod3res *); +extern bool_t +xdr_remove3args(XDR *, remove3args *); +extern bool_t +xdr_remove3resok(XDR *, remove3resok *); +extern bool_t +xdr_remove3resfail(XDR *, remove3resfail *); +extern bool_t +xdr_remove3res(XDR *, remove3res *); +extern bool_t +xdr_rmdir3args(XDR *, rmdir3args *); +extern bool_t +xdr_rmdir3resok(XDR *, rmdir3resok *); +extern bool_t +xdr_rmdir3resfail(XDR *, rmdir3resfail *); +extern bool_t +xdr_rmdir3res(XDR *, rmdir3res *); +extern bool_t +xdr_rename3args(XDR *, rename3args *); +extern bool_t +xdr_rename3resok(XDR *, rename3resok *); +extern bool_t +xdr_rename3resfail(XDR *, rename3resfail *); +extern bool_t +xdr_rename3res(XDR *, rename3res *); +extern bool_t +xdr_link3args(XDR *, link3args *); +extern bool_t +xdr_link3resok(XDR *, link3resok *); +extern bool_t +xdr_link3resfail(XDR *, link3resfail *); +extern bool_t +xdr_link3res(XDR *, link3res *); +extern bool_t +xdr_readdir3args(XDR *, readdir3args *); +extern bool_t +xdr_entry3(XDR *, entry3 *); +extern bool_t +xdr_dirlist3(XDR *, dirlist3 *); +extern bool_t +xdr_readdir3resok(XDR *, readdir3resok *); +extern bool_t +xdr_readdir3resfail(XDR *, readdir3resfail *); +extern bool_t +xdr_readdir3res(XDR *, readdir3res *); +extern bool_t +xdr_readdirp3args(XDR *, readdirp3args *); +extern bool_t +xdr_entryp3(XDR *, entryp3 *); +extern bool_t +xdr_dirlistp3(XDR *, dirlistp3 *); +extern bool_t +xdr_readdirp3resok(XDR *, readdirp3resok *); +extern bool_t +xdr_readdirp3resfail(XDR *, readdirp3resfail *); +extern bool_t +xdr_readdirp3res(XDR *, readdirp3res *); +extern bool_t +xdr_fsstat3args(XDR *, fsstat3args *); +extern bool_t +xdr_fsstat3resok(XDR *, fsstat3resok *); +extern bool_t +xdr_fsstat3resfail(XDR *, fsstat3resfail *); +extern bool_t +xdr_fsstat3res(XDR *, fsstat3res *); +extern bool_t +xdr_fsinfo3args(XDR *, fsinfo3args *); +extern bool_t +xdr_fsinfo3resok(XDR *, fsinfo3resok *); +extern bool_t +xdr_fsinfo3resfail(XDR *, fsinfo3resfail *); +extern bool_t +xdr_fsinfo3res(XDR *, fsinfo3res *); +extern bool_t +xdr_pathconf3args(XDR *, pathconf3args *); +extern bool_t +xdr_pathconf3resok(XDR *, pathconf3resok *); +extern bool_t +xdr_pathconf3resfail(XDR *, pathconf3resfail *); +extern bool_t +xdr_pathconf3res(XDR *, pathconf3res *); +extern bool_t +xdr_commit3args(XDR *, commit3args *); +extern bool_t +xdr_commit3resok(XDR *, commit3resok *); +extern bool_t +xdr_commit3resfail(XDR *, commit3resfail *); +extern bool_t +xdr_commit3res(XDR *, commit3res *); +extern bool_t +xdr_fhandle3(XDR *, fhandle3 *); +extern bool_t +xdr_dirpath(XDR *, dirpath *); +extern bool_t +xdr_name(XDR *, name *); +extern bool_t +xdr_mountstat3(XDR *, mountstat3 *); +extern bool_t +xdr_mountres3_ok(XDR *, mountres3_ok *); +extern bool_t +xdr_mountres3(XDR *, mountres3 *); +extern bool_t +xdr_mountlist(XDR *, mountlist *); +extern bool_t +xdr_mountbody(XDR *, mountbody *); +extern bool_t +xdr_groups(XDR *, groups *); +extern bool_t +xdr_groupnode(XDR *, groupnode *); +extern bool_t +xdr_exports(XDR *, exports *); +extern bool_t +xdr_exportnode(XDR *, exportnode *); + +extern void +xdr_free_exports_list(struct exportnode *first); +extern void +xdr_free_mountlist(mountlist ml); + +extern void +xdr_free_write3args_nocopy(write3args *wa); #endif |