From 283ec9608e6cbc9393941d5fae901e558360d2bd Mon Sep 17 00:00:00 2001 From: "Anand V. Avati" Date: Tue, 16 Mar 2010 09:46:33 +0000 Subject: iatt: changes across the codebase - libglusterfs -- call-stub -- inode -- protocol - libglusterfsclient - cluster/replicate - cluster/{dht,nufa,switch} - cluster/unify - cluster/HA - cluster/map - cluster/stripe - debug/error-gen - debug/trace - debug/io-stats - encryption/rot-13 - features/filter - features/locks - features/path-converter - features/quota - features/trash - mount/fuse - performance/io-threads - performance/io-cache - performance/quick-read - performance/read-ahead - performance/stat-prefetch - performance/symlink-cache - performance/write-behind - protocol/client - protocol/server - storage-posix Signed-off-by: Anand V. Avati Signed-off-by: Anand V. Avati BUG: 361 (GlusterFS 3.0 should work on Mac OS/X) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=361 --- xlators/protocol/server/src/server-helpers.c | 48 +++--- xlators/protocol/server/src/server-helpers.h | 2 +- xlators/protocol/server/src/server-protocol.c | 212 +++++++++++++------------- xlators/protocol/server/src/server-protocol.h | 2 +- xlators/protocol/server/src/server-resolve.c | 4 +- 5 files changed, 134 insertions(+), 134 deletions(-) (limited to 'xlators/protocol/server/src') diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c index f627b6b530e..dc2620c9055 100644 --- a/xlators/protocol/server/src/server-helpers.c +++ b/xlators/protocol/server/src/server-helpers.c @@ -112,34 +112,34 @@ out: } /* - * stat_to_str - convert struct stat to a ASCII string - * @stbuf: struct stat pointer + * stat_to_str - convert struct iatt to a ASCII string + * @stbuf: struct iatt pointer * * not for external reference */ char * -stat_to_str (struct stat *stbuf) +stat_to_str (struct iatt *stbuf) { int ret = 0; char *tmp_buf = NULL; - uint64_t dev = stbuf->st_dev; - uint64_t ino = stbuf->st_ino; - uint32_t mode = stbuf->st_mode; - uint32_t nlink = stbuf->st_nlink; - uint32_t uid = stbuf->st_uid; - uint32_t gid = stbuf->st_gid; - uint64_t rdev = stbuf->st_rdev; - uint64_t size = stbuf->st_size; - uint32_t blksize = stbuf->st_blksize; - uint64_t blocks = stbuf->st_blocks; - uint32_t atime = stbuf->st_atime; - uint32_t mtime = stbuf->st_mtime; - uint32_t ctime = stbuf->st_ctime; - - uint32_t atime_nsec = ST_ATIM_NSEC(stbuf); - uint32_t mtime_nsec = ST_MTIM_NSEC(stbuf); - uint32_t ctime_nsec = ST_CTIM_NSEC(stbuf); + uint64_t dev = stbuf->ia_gen; + uint64_t ino = stbuf->ia_ino; + uint32_t mode = st_mode_from_ia (stbuf->ia_prot, stbuf->ia_type); + uint32_t nlink = stbuf->ia_nlink; + uint32_t uid = stbuf->ia_uid; + uint32_t gid = stbuf->ia_gid; + uint64_t rdev = stbuf->ia_rdev; + uint64_t size = stbuf->ia_size; + uint32_t blksize = stbuf->ia_blksize; + uint64_t blocks = stbuf->ia_blocks; + uint32_t atime = stbuf->ia_atime; + uint32_t mtime = stbuf->ia_mtime; + uint32_t ctime = stbuf->ia_ctime; + + uint32_t atime_nsec = stbuf->ia_atime_nsec; + uint32_t mtime_nsec = stbuf->ia_mtime_nsec; + uint32_t ctime_nsec = stbuf->ia_ctime_nsec; ret = asprintf (&tmp_buf, @@ -307,10 +307,10 @@ gf_add_locker (struct _lock_table *table, const char *volume, if (fd == NULL) { loc_copy (&new->loc, loc); - dir = S_ISDIR (new->loc.inode->st_mode); + dir = IA_ISDIR (new->loc.inode->ia_type); } else { new->fd = fd_ref (fd); - dir = S_ISDIR (fd->inode->st_mode); + dir = IA_ISDIR (fd->inode->ia_type); } new->pid = pid; @@ -342,9 +342,9 @@ gf_del_locker (struct _lock_table *table, const char *volume, INIT_LIST_HEAD (&del); if (fd) { - dir = S_ISDIR (fd->inode->st_mode); + dir = IA_ISDIR (fd->inode->ia_type); } else { - dir = S_ISDIR (loc->inode->st_mode); + dir = IA_ISDIR (loc->inode->ia_type); } LOCK (&table->lock); diff --git a/xlators/protocol/server/src/server-helpers.h b/xlators/protocol/server/src/server-helpers.h index 867035d3334..cbf57ae44d1 100644 --- a/xlators/protocol/server/src/server-helpers.h +++ b/xlators/protocol/server/src/server-helpers.h @@ -42,7 +42,7 @@ #define IS_NOT_ROOT(pathlen) ((pathlen > 2)? 1 : 0) char * -stat_to_str (struct stat *stbuf); +stat_to_str (struct iatt *stbuf); call_frame_t * server_copy_frame (call_frame_t *frame); diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c index 4562eaea3ce..57e32039310 100644 --- a/xlators/protocol/server/src/server-protocol.c +++ b/xlators/protocol/server/src/server-protocol.c @@ -668,8 +668,8 @@ server_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int server_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *preparent, - struct stat *postparent) + int32_t op_ret, int32_t op_errno, struct iatt *preparent, + struct iatt *postparent) { gf_hdr_common_t *hdr = NULL; gf_fop_rmdir_rsp_t *rsp = NULL; @@ -705,8 +705,8 @@ server_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); if (op_ret == 0) { - gf_stat_from_stat (&rsp->preparent, preparent); - gf_stat_from_stat (&rsp->postparent, postparent); + gf_stat_from_iatt (&rsp->preparent, preparent); + gf_stat_from_iatt (&rsp->postparent, postparent); } protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_RMDIR, @@ -729,8 +729,8 @@ server_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int server_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, - struct stat *stbuf, struct stat *preparent, - struct stat *postparent) + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent) { gf_hdr_common_t *hdr = NULL; gf_fop_mkdir_rsp_t *rsp = NULL; @@ -750,9 +750,9 @@ server_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); if (op_ret >= 0) { - gf_stat_from_stat (&rsp->stat, stbuf); - gf_stat_from_stat (&rsp->preparent, preparent); - gf_stat_from_stat (&rsp->postparent, postparent); + gf_stat_from_iatt (&rsp->stat, stbuf); + gf_stat_from_iatt (&rsp->preparent, preparent); + gf_stat_from_iatt (&rsp->postparent, postparent); link_inode = inode_link (inode, state->loc.parent, state->loc.name, stbuf); @@ -785,8 +785,8 @@ server_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int server_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, - inode_t *inode, struct stat *stbuf, struct stat *preparent, - struct stat *postparent) + inode_t *inode, struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent) { gf_hdr_common_t *hdr = NULL; gf_fop_mknod_rsp_t *rsp = NULL; @@ -806,9 +806,9 @@ server_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); if (op_ret >= 0) { - gf_stat_from_stat (&rsp->stat, stbuf); - gf_stat_from_stat (&rsp->preparent, preparent); - gf_stat_from_stat (&rsp->postparent, postparent); + gf_stat_from_iatt (&rsp->stat, stbuf); + gf_stat_from_iatt (&rsp->preparent, preparent); + gf_stat_from_iatt (&rsp->postparent, postparent); link_inode = inode_link (inode, state->loc.parent, state->loc.name, stbuf); @@ -1383,9 +1383,9 @@ server_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int server_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *stbuf, - struct stat *preoldparent, struct stat *postoldparent, - struct stat *prenewparent, struct stat *postnewparent) + int32_t op_ret, int32_t op_errno, struct iatt *stbuf, + struct iatt *preoldparent, struct iatt *postoldparent, + struct iatt *prenewparent, struct iatt *postnewparent) { gf_hdr_common_t *hdr = NULL; gf_fop_rename_rsp_t *rsp = NULL; @@ -1404,8 +1404,8 @@ server_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); if (op_ret == 0) { - stbuf->st_ino = state->loc.inode->ino; - stbuf->st_mode = state->loc.inode->st_mode; + stbuf->ia_ino = state->loc.inode->ino; + stbuf->ia_type = state->loc.inode->ia_type; gf_log (state->bound_xl->name, GF_LOG_TRACE, "%"PRId64": RENAME_CBK (%"PRId64") %"PRId64"/%s " @@ -1418,13 +1418,13 @@ server_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, state->loc.parent, state->loc.name, state->loc2.parent, state->loc2.name, state->loc.inode, stbuf); - gf_stat_from_stat (&rsp->stat, stbuf); + gf_stat_from_iatt (&rsp->stat, stbuf); - gf_stat_from_stat (&rsp->preoldparent, preoldparent); - gf_stat_from_stat (&rsp->postoldparent, postoldparent); + gf_stat_from_iatt (&rsp->preoldparent, preoldparent); + gf_stat_from_iatt (&rsp->postoldparent, postoldparent); - gf_stat_from_stat (&rsp->prenewparent, prenewparent); - gf_stat_from_stat (&rsp->postnewparent, postnewparent); + gf_stat_from_iatt (&rsp->prenewparent, prenewparent); + gf_stat_from_iatt (&rsp->postnewparent, postnewparent); } protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_RENAME, @@ -1446,8 +1446,8 @@ server_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int server_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *preparent, - struct stat *postparent) + int32_t op_ret, int32_t op_errno, struct iatt *preparent, + struct iatt *postparent) { gf_hdr_common_t *hdr = NULL; gf_fop_unlink_rsp_t *rsp = NULL; @@ -1489,8 +1489,8 @@ server_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); if (op_ret == 0) { - gf_stat_from_stat (&rsp->preparent, preparent); - gf_stat_from_stat (&rsp->postparent, postparent); + gf_stat_from_iatt (&rsp->preparent, preparent); + gf_stat_from_iatt (&rsp->postparent, postparent); } protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_UNLINK, @@ -1512,8 +1512,8 @@ server_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int server_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, - struct stat *stbuf, struct stat *preparent, - struct stat *postparent) + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent) { gf_hdr_common_t *hdr = NULL; gf_fop_symlink_rsp_t *rsp = NULL; @@ -1533,9 +1533,9 @@ server_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno_to_error (op_errno)); if (op_ret >= 0) { - gf_stat_from_stat (&rsp->stat, stbuf); - gf_stat_from_stat (&rsp->preparent, preparent); - gf_stat_from_stat (&rsp->postparent, postparent); + gf_stat_from_iatt (&rsp->stat, stbuf); + gf_stat_from_iatt (&rsp->preparent, preparent); + gf_stat_from_iatt (&rsp->postparent, postparent); link_inode = inode_link (inode, state->loc.parent, state->loc.name, stbuf); @@ -1569,8 +1569,8 @@ server_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int server_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, - struct stat *stbuf, struct stat *preparent, - struct stat *postparent) + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent) { gf_hdr_common_t *hdr = NULL; gf_fop_link_rsp_t *rsp = NULL; @@ -1590,11 +1590,11 @@ server_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); if (op_ret == 0) { - stbuf->st_ino = state->loc.inode->ino; + stbuf->ia_ino = state->loc.inode->ino; - gf_stat_from_stat (&rsp->stat, stbuf); - gf_stat_from_stat (&rsp->preparent, preparent); - gf_stat_from_stat (&rsp->postparent, postparent); + gf_stat_from_iatt (&rsp->stat, stbuf); + gf_stat_from_iatt (&rsp->preparent, preparent); + gf_stat_from_iatt (&rsp->postparent, postparent); gf_log (state->bound_xl->name, GF_LOG_TRACE, "%"PRId64": LINK (%"PRId64") %"PRId64"/%s ==> %"PRId64"/%s", @@ -1637,8 +1637,8 @@ server_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int server_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *prebuf, - struct stat *postbuf) + int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf) { gf_hdr_common_t *hdr = NULL; gf_fop_truncate_rsp_t *rsp = NULL; @@ -1657,8 +1657,8 @@ server_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); if (op_ret == 0) { - gf_stat_from_stat (&rsp->prestat, prebuf); - gf_stat_from_stat (&rsp->poststat, postbuf); + gf_stat_from_iatt (&rsp->prestat, prebuf); + gf_stat_from_iatt (&rsp->poststat, postbuf); } else { gf_log (this->name, GF_LOG_DEBUG, "%"PRId64": TRUNCATE %s (%"PRId64") ==> %"PRId32" (%s)", @@ -1686,7 +1686,7 @@ server_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int server_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *stbuf) + int32_t op_ret, int32_t op_errno, struct iatt *stbuf) { gf_hdr_common_t *hdr = NULL; gf_fop_fstat_rsp_t *rsp = NULL; @@ -1703,7 +1703,7 @@ server_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); if (op_ret == 0) { - gf_stat_from_stat (&rsp->stat, stbuf); + gf_stat_from_iatt (&rsp->stat, stbuf); } else { state = CALL_STATE(frame); @@ -1733,8 +1733,8 @@ server_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int server_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *prebuf, - struct stat *postbuf) + int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf) { gf_hdr_common_t *hdr = NULL; gf_fop_ftruncate_rsp_t *rsp = NULL; @@ -1751,8 +1751,8 @@ server_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); if (op_ret == 0) { - gf_stat_from_stat (&rsp->prestat, prebuf); - gf_stat_from_stat (&rsp->poststat, postbuf); + gf_stat_from_iatt (&rsp->prestat, prebuf); + gf_stat_from_iatt (&rsp->poststat, postbuf); } else { state = CALL_STATE (frame); @@ -1825,8 +1825,8 @@ server_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int server_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *prebuf, - struct stat *postbuf) + int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf) { gf_hdr_common_t *hdr = NULL; gf_fop_fsync_rsp_t *rsp = NULL; @@ -1853,8 +1853,8 @@ server_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); if (op_ret >= 0) { - gf_stat_from_stat (&(rsp->prestat), prebuf); - gf_stat_from_stat (&(rsp->poststat), postbuf); + gf_stat_from_iatt (&(rsp->prestat), prebuf); + gf_stat_from_iatt (&(rsp->poststat), postbuf); } protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_FSYNC, @@ -1909,8 +1909,8 @@ server_release_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int server_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *prebuf, - struct stat *postbuf) + int32_t op_ret, int32_t op_errno, struct iatt *prebuf, + struct iatt *postbuf) { gf_hdr_common_t *hdr = NULL; gf_fop_write_rsp_t *rsp = NULL; @@ -1927,8 +1927,8 @@ server_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno_to_error (op_errno)); if (op_ret >= 0) { - gf_stat_from_stat (&rsp->prestat, prebuf); - gf_stat_from_stat (&rsp->poststat, postbuf); + gf_stat_from_iatt (&rsp->prestat, prebuf); + gf_stat_from_iatt (&rsp->poststat, postbuf); } else { state = CALL_STATE(frame); @@ -1962,7 +1962,7 @@ int server_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, - struct stat *stbuf, struct iobref *iobref) + struct iatt *stbuf, struct iobref *iobref) { gf_hdr_common_t *hdr = NULL; gf_fop_read_rsp_t *rsp = NULL; @@ -1979,7 +1979,7 @@ server_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); if (op_ret >= 0) { - gf_stat_from_stat (&rsp->stat, stbuf); + gf_stat_from_iatt (&rsp->stat, stbuf); } else { state = CALL_STATE(frame); @@ -2062,15 +2062,15 @@ server_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, * @op_errno: * @fd: file descriptor * @inode: inode structure - * @stbuf: struct stat of created file + * @stbuf: struct iatt of created file * * not for external reference */ int server_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, - fd_t *fd, inode_t *inode, struct stat *stbuf, - struct stat *preparent, struct stat *postparent) + fd_t *fd, inode_t *inode, struct iatt *stbuf, + struct iatt *preparent, struct iatt *postparent) { server_connection_t *conn = NULL; gf_hdr_common_t *hdr = NULL; @@ -2089,7 +2089,7 @@ server_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_log (state->bound_xl->name, GF_LOG_TRACE, "%"PRId64": CREATE %"PRId64"/%s (%"PRId64")", frame->root->unique, state->loc.parent->ino, - state->loc.name, stbuf->st_ino); + state->loc.name, stbuf->ia_ino); link_inode = inode_link (inode, state->loc.parent, state->loc.name, stbuf); @@ -2142,9 +2142,9 @@ server_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, rsp->fd = hton64 (fd_no); if (op_ret >= 0) { - gf_stat_from_stat (&rsp->stat, stbuf); - gf_stat_from_stat (&rsp->preparent, preparent); - gf_stat_from_stat (&rsp->postparent, postparent); + gf_stat_from_iatt (&rsp->stat, stbuf); + gf_stat_from_iatt (&rsp->preparent, preparent); + gf_stat_from_iatt (&rsp->postparent, postparent); } protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_CREATE, @@ -2167,7 +2167,7 @@ server_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int server_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, const char *buf, - struct stat *sbuf) + struct iatt *sbuf) { gf_hdr_common_t *hdr = NULL; gf_fop_readlink_rsp_t *rsp = NULL; @@ -2197,7 +2197,7 @@ server_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno_to_error (op_errno)); if (op_ret >= 0) { - gf_stat_from_stat (&(rsp->buf), sbuf); + gf_stat_from_iatt (&(rsp->buf), sbuf); strcpy (rsp->path, buf); } @@ -2220,7 +2220,7 @@ server_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int server_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *stbuf) + int32_t op_ret, int32_t op_errno, struct iatt *stbuf) { gf_hdr_common_t *hdr = NULL; gf_fop_stat_rsp_t *rsp = NULL; @@ -2239,7 +2239,7 @@ server_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno_to_error (op_errno)); if (op_ret == 0) { - gf_stat_from_stat (&rsp->stat, stbuf); + gf_stat_from_iatt (&rsp->stat, stbuf); } else { gf_log (this->name, GF_LOG_DEBUG, "%"PRId64": STAT %s (%"PRId64") ==> %"PRId32" (%s)", @@ -2269,7 +2269,7 @@ server_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int server_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct stat *statpre, struct stat *statpost) + struct iatt *statpre, struct iatt *statpost) { gf_hdr_common_t *hdr = NULL; gf_fop_setattr_rsp_t *rsp = NULL; @@ -2288,8 +2288,8 @@ server_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno_to_error (op_errno)); if (op_ret == 0) { - gf_stat_from_stat (&rsp->statpre, statpre); - gf_stat_from_stat (&rsp->statpost, statpost); + gf_stat_from_iatt (&rsp->statpre, statpre); + gf_stat_from_iatt (&rsp->statpost, statpost); } else { gf_log (this->name, GF_LOG_DEBUG, "%"PRId64": SETATTR %s (%"PRId64") ==> %"PRId32" (%s)", @@ -2318,7 +2318,7 @@ server_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int server_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct stat *statpre, struct stat *statpost) + struct iatt *statpre, struct iatt *statpost) { gf_hdr_common_t *hdr = NULL; gf_fop_fsetattr_rsp_t *rsp = NULL; @@ -2337,8 +2337,8 @@ server_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno_to_error (op_errno)); if (op_ret == 0) { - gf_stat_from_stat (&rsp->statpre, statpre); - gf_stat_from_stat (&rsp->statpost, statpost); + gf_stat_from_iatt (&rsp->statpre, statpre); + gf_stat_from_iatt (&rsp->statpost, statpost); } else { gf_log (this->name, GF_LOG_DEBUG, "%"PRId64": FSETATTR %"PRId64" (%"PRId64") ==> " @@ -2370,8 +2370,8 @@ server_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int server_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, - inode_t *inode, struct stat *stbuf, dict_t *dict, - struct stat *postparent) + inode_t *inode, struct iatt *stbuf, dict_t *dict, + struct iatt *postparent) { gf_hdr_common_t *hdr = NULL; gf_fop_lookup_rsp_t *rsp = NULL; @@ -2435,18 +2435,18 @@ server_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); if (postparent) - gf_stat_from_stat (&rsp->postparent, postparent); + gf_stat_from_iatt (&rsp->postparent, postparent); if (op_ret == 0) { root_inode = BOUND_XL(frame)->itable->root; if (inode == root_inode) { /* we just looked up root ("/") */ - stbuf->st_ino = 1; - if (inode->st_mode == 0) - inode->st_mode = stbuf->st_mode; + stbuf->ia_ino = 1; + if (inode->ia_type == 0) + inode->ia_type = stbuf->ia_type; } - gf_stat_from_stat (&rsp->stat, stbuf); + gf_stat_from_iatt (&rsp->stat, stbuf); if (inode->ino != 1) { link_inode = inode_link (inode, state->loc.parent, @@ -2802,7 +2802,7 @@ server_setattr (call_frame_t *frame, xlator_t *bound_xl, state->resolve.gen = ntoh64 (req->gen); state->resolve.path = strdup (req->path); - gf_stat_to_stat (&req->stbuf, &state->stbuf); + gf_stat_to_iatt (&req->stbuf, &state->stbuf); state->valid = ntoh32 (req->valid); resolve_and_resume (frame, server_setattr_resume); @@ -2848,7 +2848,7 @@ server_fsetattr (call_frame_t *frame, xlator_t *bound_xl, state->resolve.type = RESOLVE_MUST; state->resolve.fd_no = ntoh64 (req->fd); - gf_stat_to_stat (&req->stbuf, &state->stbuf); + gf_stat_to_iatt (&req->stbuf, &state->stbuf); state->valid = ntoh32 (req->valid); resolve_and_resume (frame, server_fsetattr_resume); @@ -5084,25 +5084,25 @@ server_setdents (call_frame_t *frame, xlator_t *bound_xl, &size, &blksize, &blocks, &atime, &atime_nsec, &mtime, &mtime_nsec, &ctime, &ctime_nsec); - trav->buf.st_dev = dev; - trav->buf.st_ino = ino; - trav->buf.st_mode = mode; - trav->buf.st_nlink = nlink; - trav->buf.st_uid = uid; - trav->buf.st_gid = gid; - trav->buf.st_rdev = rdev; - trav->buf.st_size = size; - trav->buf.st_blksize = blksize; - trav->buf.st_blocks = blocks; - - trav->buf.st_atime = atime; - trav->buf.st_mtime = mtime; - trav->buf.st_ctime = ctime; - - ST_ATIM_NSEC_SET(&trav->buf, atime_nsec); - ST_MTIM_NSEC_SET(&trav->buf, mtime_nsec); - ST_CTIM_NSEC_SET(&trav->buf, ctime_nsec); - + trav->buf.ia_gen = dev; + trav->buf.ia_ino = ino; + trav->buf.ia_prot = ia_prot_from_st_mode (mode); + trav->buf.ia_type = ia_type_from_st_mode (mode); + trav->buf.ia_nlink = nlink; + trav->buf.ia_uid = uid; + trav->buf.ia_gid = gid; + trav->buf.ia_rdev = rdev; + trav->buf.ia_size = size; + trav->buf.ia_blksize = blksize; + trav->buf.ia_blocks = blocks; + + trav->buf.ia_atime = atime; + trav->buf.ia_mtime = mtime; + trav->buf.ia_ctime = ctime; + + trav->buf.ia_atime_nsec = atime_nsec; + trav->buf.ia_mtime_nsec = mtime_nsec; + trav->buf.ia_ctime_nsec = ctime_nsec; } ender = strchr (buffer_ptr, '\n'); @@ -5110,7 +5110,7 @@ server_setdents (call_frame_t *frame, xlator_t *bound_xl, break; count = ender - buffer_ptr; *ender = '\0'; - if (S_ISLNK (trav->buf.st_mode)) { + if (IA_ISLNK (trav->buf.ia_type)) { trav->link = strdup (buffer_ptr); } else trav->link = ""; @@ -5131,7 +5131,7 @@ server_setdents (call_frame_t *frame, xlator_t *bound_xl, while (trav) { prev->next = trav->next; FREE (trav->name); - if (S_ISLNK (trav->buf.st_mode)) + if (IA_ISLNK (trav->buf.ia_type)) FREE (trav->link); FREE (trav); trav = prev->next; diff --git a/xlators/protocol/server/src/server-protocol.h b/xlators/protocol/server/src/server-protocol.h index 78bc138279a..61fcb877e42 100644 --- a/xlators/protocol/server/src/server-protocol.h +++ b/xlators/protocol/server/src/server-protocol.h @@ -165,7 +165,7 @@ struct _server_state { loc_t *loc_now; server_resolve_t *resolve_now; - struct stat stbuf; + struct iatt stbuf; int valid; fd_t *fd; diff --git a/xlators/protocol/server/src/server-resolve.c b/xlators/protocol/server/src/server-resolve.c index 2eb95e6a491..f4c9ebad7a2 100644 --- a/xlators/protocol/server/src/server-resolve.c +++ b/xlators/protocol/server/src/server-resolve.c @@ -165,8 +165,8 @@ resolve_deep_continue (call_frame_t *frame) int resolve_deep_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, inode_t *inode, struct stat *buf, - dict_t *xattr, struct stat *postparent) + int op_ret, int op_errno, inode_t *inode, struct iatt *buf, + dict_t *xattr, struct iatt *postparent) { server_state_t *state = NULL; server_resolve_t *resolve = NULL; -- cgit