summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src
diff options
context:
space:
mode:
authorAnand V. Avati <avati@blackhole.gluster.com>2010-03-16 09:46:33 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-03-16 08:31:32 -0700
commit283ec9608e6cbc9393941d5fae901e558360d2bd (patch)
tree5d90ea94d5df8fd542b30d6e88f44b940133d9b2 /xlators/protocol/client/src
parentcc7515fc3db005383ffa575236ec29c212ed1e48 (diff)
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 <avati@blackhole.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 361 (GlusterFS 3.0 should work on Mac OS/X) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=361
Diffstat (limited to 'xlators/protocol/client/src')
-rw-r--r--xlators/protocol/client/src/client-protocol.c236
-rw-r--r--xlators/protocol/client/src/client-protocol.h40
2 files changed, 138 insertions, 138 deletions
diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c
index 3adfbd79b74..f50182a6bd1 100644
--- a/xlators/protocol/client/src/client-protocol.c
+++ b/xlators/protocol/client/src/client-protocol.c
@@ -3437,27 +3437,27 @@ client_setdents (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags,
while (trav) {
int32_t this_len = 0;
char *tmp_buf = NULL;
- struct stat *stbuf = &trav->buf;
+ struct iatt *stbuf = &trav->buf;
{
/* Convert the stat buf to string */
- 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, GF_STAT_PRINT_FMT_STR,
dev, ino, mode, nlink, uid, gid,
@@ -3520,7 +3520,7 @@ unwind:
int
client_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
- struct stat *stbuf, int32_t valid)
+ struct iatt *stbuf, int32_t valid)
{
gf_hdr_common_t *hdr = NULL;
gf_fop_setattr_req_t *req = NULL;
@@ -3553,7 +3553,7 @@ client_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
req->gen = hton64 (gen);
strcpy (req->path, loc->path);
- gf_stat_from_stat (&req->stbuf, stbuf);
+ gf_stat_from_iatt (&req->stbuf, stbuf);
req->valid = hton32 (valid);
ret = protocol_client_xfer (frame, this,
@@ -3570,7 +3570,7 @@ unwind:
int
client_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
- struct stat *stbuf, int32_t valid)
+ struct iatt *stbuf, int32_t valid)
{
gf_hdr_common_t *hdr = NULL;
gf_fop_fsetattr_req_t *req = NULL;
@@ -3616,7 +3616,7 @@ client_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
req->fd = hton64 (remote_fd);
- gf_stat_from_stat (&req->stbuf, stbuf);
+ gf_stat_from_iatt (&req->stbuf, stbuf);
req->valid = hton32 (valid);
ret = protocol_client_xfer (frame, this,
@@ -3940,9 +3940,9 @@ client_create_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
int32_t op_errno = 0;
fd_t *fd = NULL;
inode_t *inode = NULL;
- struct stat stbuf = {0, };
- struct stat preparent = {0, };
- struct stat postparent = {0, };
+ struct iatt stbuf = {0, };
+ struct iatt preparent = {0, };
+ struct iatt postparent = {0, };
int64_t remote_fd = 0;
int32_t ret = -1;
client_local_t *local = NULL;
@@ -3963,13 +3963,13 @@ client_create_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
if (op_ret >= 0) {
remote_fd = ntoh64 (rsp->fd);
- gf_stat_to_stat (&rsp->stat, &stbuf);
+ gf_stat_to_iatt (&rsp->stat, &stbuf);
- gf_stat_to_stat (&rsp->preparent, &preparent);
- gf_stat_to_stat (&rsp->postparent, &postparent);
+ gf_stat_to_iatt (&rsp->preparent, &preparent);
+ gf_stat_to_iatt (&rsp->postparent, &postparent);
- ino = stbuf.st_ino;
- gen = stbuf.st_dev;
+ ino = stbuf.ia_ino;
+ gen = stbuf.ia_gen;
}
if (op_ret >= 0) {
@@ -4106,7 +4106,7 @@ int
client_stat_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
struct iobuf *iobuf)
{
- struct stat stbuf = {0, };
+ struct iatt stbuf = {0, };
gf_fop_stat_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
@@ -4117,7 +4117,7 @@ client_stat_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret == 0) {
- gf_stat_to_stat (&rsp->stat, &stbuf);
+ gf_stat_to_iatt (&rsp->stat, &stbuf);
}
STACK_UNWIND (frame, op_ret, op_errno, &stbuf);
@@ -4141,12 +4141,12 @@ client_mknod_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
gf_fop_mknod_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
- struct stat stbuf = {0, };
+ struct iatt stbuf = {0, };
inode_t *inode = NULL;
client_local_t *local = NULL;
int ret = 0;
- struct stat preparent = {0,};
- struct stat postparent = {0,};
+ struct iatt preparent = {0,};
+ struct iatt postparent = {0,};
local = frame->local;
frame->local = NULL;
@@ -4158,10 +4158,10 @@ client_mknod_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret >= 0) {
- gf_stat_to_stat (&rsp->stat, &stbuf);
+ gf_stat_to_iatt (&rsp->stat, &stbuf);
ret = inode_ctx_put2 (local->loc.inode, frame->this,
- stbuf.st_ino, stbuf.st_dev);
+ stbuf.ia_ino, stbuf.ia_gen);
if (ret < 0) {
gf_log (frame->this->name, GF_LOG_DEBUG,
"MKNOD %"PRId64"/%s (%s): failed to set remote"
@@ -4170,8 +4170,8 @@ client_mknod_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
local->loc.path);
}
- gf_stat_to_stat (&rsp->preparent, &preparent);
- gf_stat_to_stat (&rsp->postparent, &postparent);
+ gf_stat_to_iatt (&rsp->preparent, &preparent);
+ gf_stat_to_iatt (&rsp->postparent, &postparent);
}
STACK_UNWIND (frame, op_ret, op_errno, inode, &stbuf,
@@ -4197,9 +4197,9 @@ client_symlink_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
gf_fop_symlink_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
- struct stat stbuf = {0, };
- struct stat preparent = {0,};
- struct stat postparent = {0,};
+ struct iatt stbuf = {0, };
+ struct iatt preparent = {0,};
+ struct iatt postparent = {0,};
inode_t *inode = NULL;
client_local_t *local = NULL;
int ret = 0;
@@ -4214,10 +4214,10 @@ client_symlink_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret >= 0) {
- gf_stat_to_stat (&rsp->stat, &stbuf);
+ gf_stat_to_iatt (&rsp->stat, &stbuf);
ret = inode_ctx_put2 (inode, frame->this,
- stbuf.st_ino, stbuf.st_dev);
+ stbuf.ia_ino, stbuf.ia_gen);
if (ret < 0) {
gf_log (frame->this->name, GF_LOG_DEBUG,
"SYMLINK %"PRId64"/%s (%s): failed to set "
@@ -4225,8 +4225,8 @@ client_symlink_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
local->loc.parent->ino, local->loc.name,
local->loc.path);
}
- gf_stat_to_stat (&rsp->preparent, &preparent);
- gf_stat_to_stat (&rsp->postparent, &postparent);
+ gf_stat_to_iatt (&rsp->preparent, &preparent);
+ gf_stat_to_iatt (&rsp->postparent, &postparent);
}
STACK_UNWIND (frame, op_ret, op_errno, inode, &stbuf,
@@ -4252,11 +4252,11 @@ client_link_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
gf_fop_link_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
- struct stat stbuf = {0, };
+ struct iatt stbuf = {0, };
inode_t *inode = NULL;
client_local_t *local = NULL;
- struct stat preparent = {0,};
- struct stat postparent = {0,};
+ struct iatt preparent = {0,};
+ struct iatt postparent = {0,};
local = frame->local;
frame->local = NULL;
@@ -4268,10 +4268,10 @@ client_link_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret >= 0) {
- gf_stat_to_stat (&rsp->stat, &stbuf);
+ gf_stat_to_iatt (&rsp->stat, &stbuf);
- gf_stat_to_stat (&rsp->preparent, &preparent);
- gf_stat_to_stat (&rsp->postparent, &postparent);
+ gf_stat_to_iatt (&rsp->preparent, &preparent);
+ gf_stat_to_iatt (&rsp->postparent, &postparent);
}
STACK_UNWIND (frame, op_ret, op_errno, inode, &stbuf,
@@ -4297,8 +4297,8 @@ client_truncate_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
gf_fop_truncate_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
- struct stat prestat = {0, };
- struct stat poststat = {0, };
+ struct iatt prestat = {0, };
+ struct iatt poststat = {0, };
rsp = gf_param (hdr);
@@ -4306,8 +4306,8 @@ client_truncate_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret == 0) {
- gf_stat_to_stat (&rsp->prestat, &prestat);
- gf_stat_to_stat (&rsp->poststat, &poststat);
+ gf_stat_to_iatt (&rsp->prestat, &prestat);
+ gf_stat_to_iatt (&rsp->poststat, &poststat);
}
STACK_UNWIND (frame, op_ret, op_errno, &prestat, &poststat);
@@ -4326,7 +4326,7 @@ int
client_fstat_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
struct iobuf *iobuf)
{
- struct stat stbuf = {0, };
+ struct iatt stbuf = {0, };
gf_fop_fstat_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
@@ -4337,7 +4337,7 @@ client_fstat_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret == 0) {
- gf_stat_to_stat (&rsp->stat, &stbuf);
+ gf_stat_to_iatt (&rsp->stat, &stbuf);
}
@@ -4360,8 +4360,8 @@ client_ftruncate_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
gf_fop_ftruncate_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
- struct stat prestat = {0, };
- struct stat poststat = {0, };
+ struct iatt prestat = {0, };
+ struct iatt poststat = {0, };
rsp = gf_param (hdr);
@@ -4369,8 +4369,8 @@ client_ftruncate_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret == 0) {
- gf_stat_to_stat (&rsp->prestat, &prestat);
- gf_stat_to_stat (&rsp->poststat, &poststat);
+ gf_stat_to_iatt (&rsp->prestat, &prestat);
+ gf_stat_to_iatt (&rsp->poststat, &poststat);
}
STACK_UNWIND (frame, op_ret, op_errno, &prestat, &poststat);
@@ -4394,7 +4394,7 @@ client_readv_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
int32_t op_ret = 0;
int32_t op_errno = 0;
struct iovec vector = {0, };
- struct stat stbuf = {0, };
+ struct iatt stbuf = {0, };
struct iobref *iobref = NULL;
rsp = gf_param (hdr);
@@ -4404,7 +4404,7 @@ client_readv_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
if (op_ret != -1) {
iobref = iobref_new ();
- gf_stat_to_stat (&rsp->stat, &stbuf);
+ gf_stat_to_iatt (&rsp->stat, &stbuf);
vector.iov_len = op_ret;
if (op_ret > 0) {
@@ -4439,8 +4439,8 @@ client_write_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
gf_fop_write_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
- struct stat prestat = {0, };
- struct stat poststat = {0, };
+ struct iatt prestat = {0, };
+ struct iatt poststat = {0, };
rsp = gf_param (hdr);
@@ -4448,8 +4448,8 @@ client_write_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret >= 0) {
- gf_stat_to_stat (&rsp->prestat, &prestat);
- gf_stat_to_stat (&rsp->poststat, &poststat);
+ gf_stat_to_iatt (&rsp->prestat, &prestat);
+ gf_stat_to_iatt (&rsp->poststat, &poststat);
}
STACK_UNWIND (frame, op_ret, op_errno, &prestat, &poststat);
@@ -4528,8 +4528,8 @@ int
client_fsync_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
struct iobuf *iobuf)
{
- struct stat prestat = {0, };
- struct stat poststat = {0,};
+ struct iatt prestat = {0, };
+ struct iatt poststat = {0,};
gf_fop_fsync_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
@@ -4540,8 +4540,8 @@ client_fsync_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret == 0) {
- gf_stat_to_stat (&rsp->prestat, &prestat);
- gf_stat_to_stat (&rsp->poststat, &poststat);
+ gf_stat_to_iatt (&rsp->prestat, &prestat);
+ gf_stat_to_iatt (&rsp->poststat, &poststat);
}
STACK_UNWIND (frame, op_ret, op_errno, &prestat, &poststat);
@@ -4564,8 +4564,8 @@ client_unlink_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
gf_fop_unlink_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
- struct stat preparent = {0,};
- struct stat postparent = {0,};
+ struct iatt preparent = {0,};
+ struct iatt postparent = {0,};
rsp = gf_param (hdr);
@@ -4573,8 +4573,8 @@ client_unlink_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret == 0) {
- gf_stat_to_stat (&rsp->preparent, &preparent);
- gf_stat_to_stat (&rsp->postparent, &postparent);
+ gf_stat_to_iatt (&rsp->preparent, &preparent);
+ gf_stat_to_iatt (&rsp->postparent, &postparent);
}
STACK_UNWIND (frame, op_ret, op_errno, &preparent, &postparent);
@@ -4594,14 +4594,14 @@ int
client_rename_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
struct iobuf *iobuf)
{
- struct stat stbuf = {0, };
+ struct iatt stbuf = {0, };
gf_fop_rename_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
- struct stat preoldparent = {0, };
- struct stat postoldparent = {0, };
- struct stat prenewparent = {0, };
- struct stat postnewparent = {0, };
+ struct iatt preoldparent = {0, };
+ struct iatt postoldparent = {0, };
+ struct iatt prenewparent = {0, };
+ struct iatt postnewparent = {0, };
rsp = gf_param (hdr);
@@ -4609,11 +4609,11 @@ client_rename_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret == 0) {
- gf_stat_to_stat (&rsp->stat, &stbuf);
- gf_stat_to_stat (&rsp->preoldparent, &preoldparent);
- gf_stat_to_stat (&rsp->postoldparent, &postoldparent);
- gf_stat_to_stat (&rsp->prenewparent, &prenewparent);
- gf_stat_to_stat (&rsp->postnewparent, &postnewparent);
+ gf_stat_to_iatt (&rsp->stat, &stbuf);
+ gf_stat_to_iatt (&rsp->preoldparent, &preoldparent);
+ gf_stat_to_iatt (&rsp->postoldparent, &postoldparent);
+ gf_stat_to_iatt (&rsp->prenewparent, &prenewparent);
+ gf_stat_to_iatt (&rsp->postnewparent, &postnewparent);
}
STACK_UNWIND (frame, op_ret, op_errno, &stbuf, &preoldparent,
@@ -4639,7 +4639,7 @@ client_readlink_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
int32_t op_ret = 0;
int32_t op_errno = 0;
char *link = NULL;
- struct stat stbuf = {0,};
+ struct iatt stbuf = {0,};
rsp = gf_param (hdr);
@@ -4648,7 +4648,7 @@ client_readlink_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
if (op_ret > 0) {
link = rsp->path;
- gf_stat_to_stat (&rsp->buf, &stbuf);
+ gf_stat_to_iatt (&rsp->buf, &stbuf);
}
STACK_UNWIND (frame, op_ret, op_errno, link, &stbuf);
@@ -4670,12 +4670,12 @@ client_mkdir_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
gf_fop_mkdir_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
- struct stat stbuf = {0, };
+ struct iatt stbuf = {0, };
inode_t *inode = NULL;
client_local_t *local = NULL;
int ret = 0;
- struct stat preparent = {0,};
- struct stat postparent = {0,};
+ struct iatt preparent = {0,};
+ struct iatt postparent = {0,};
local = frame->local;
inode = local->loc.inode;
@@ -4687,10 +4687,10 @@ client_mkdir_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret >= 0) {
- gf_stat_to_stat (&rsp->stat, &stbuf);
+ gf_stat_to_iatt (&rsp->stat, &stbuf);
- ret = inode_ctx_put2 (inode, frame->this, stbuf.st_ino,
- stbuf.st_dev);
+ ret = inode_ctx_put2 (inode, frame->this, stbuf.ia_ino,
+ stbuf.ia_gen);
if (ret < 0) {
gf_log (frame->this->name, GF_LOG_DEBUG,
"MKDIR %"PRId64"/%s (%s): failed to set "
@@ -4699,8 +4699,8 @@ client_mkdir_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
local->loc.path);
}
- gf_stat_to_stat (&rsp->preparent, &preparent);
- gf_stat_to_stat (&rsp->postparent, &postparent);
+ gf_stat_to_iatt (&rsp->preparent, &preparent);
+ gf_stat_to_iatt (&rsp->postparent, &postparent);
}
STACK_UNWIND (frame, op_ret, op_errno, inode, &stbuf,
@@ -4829,8 +4829,8 @@ client_rmdir_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
gf_fop_rmdir_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
- struct stat preparent = {0,};
- struct stat postparent = {0,};
+ struct iatt preparent = {0,};
+ struct iatt postparent = {0,};
rsp = gf_param (hdr);
@@ -4838,8 +4838,8 @@ client_rmdir_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret == 0) {
- gf_stat_to_stat (&rsp->preparent, &preparent);
- gf_stat_to_stat (&rsp->postparent, &postparent);
+ gf_stat_to_iatt (&rsp->preparent, &preparent);
+ gf_stat_to_iatt (&rsp->postparent, &postparent);
}
STACK_UNWIND (frame, op_ret, op_errno, &preparent, &postparent);
@@ -4886,8 +4886,8 @@ int
client_lookup_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
struct iobuf *iobuf)
{
- struct stat stbuf = {0, };
- struct stat postparent = {0, };
+ struct iatt stbuf = {0, };
+ struct iatt postparent = {0, };
inode_t *inode = NULL;
dict_t *xattr = NULL;
gf_fop_lookup_rsp_t *rsp = NULL;
@@ -4909,14 +4909,14 @@ client_lookup_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
op_ret = ntoh32 (hdr->rsp.op_ret);
- gf_stat_to_stat (&rsp->postparent, &postparent);
+ gf_stat_to_iatt (&rsp->postparent, &postparent);
if (op_ret == 0) {
op_ret = -1;
- gf_stat_to_stat (&rsp->stat, &stbuf);
+ gf_stat_to_iatt (&rsp->stat, &stbuf);
ret = inode_ctx_get2 (inode, frame->this, &oldino, &oldgen);
- if (oldino != stbuf.st_ino || oldgen != stbuf.st_dev) {
+ if (oldino != stbuf.ia_ino || oldgen != stbuf.ia_gen) {
if (oldino) {
gf_log (frame->this->name, GF_LOG_DEBUG,
"LOOKUP %"PRId64"/%s (%s): "
@@ -4926,13 +4926,13 @@ client_lookup_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
local->loc.parent->ino : (uint64_t) 0,
local->loc.name,
local->loc.path,
- oldgen, oldino, stbuf.st_dev, stbuf.st_ino);
+ oldgen, oldino, stbuf.ia_gen, stbuf.ia_ino);
op_errno = ESTALE;
goto fail;
}
ret = inode_ctx_put2 (inode, frame->this,
- stbuf.st_ino, stbuf.st_dev);
+ stbuf.ia_ino, stbuf.ia_gen);
if (ret < 0) {
gf_log (frame->this->name, GF_LOG_DEBUG,
"LOOKUP %"PRId64"/%s (%s) : "
@@ -4990,8 +4990,8 @@ static int32_t
client_setattr_cbk (call_frame_t *frame,gf_hdr_common_t *hdr, size_t hdrlen,
struct iobuf *iobuf)
{
- struct stat statpre = {0, };
- struct stat statpost = {0, };
+ struct iatt statpre = {0, };
+ struct iatt statpost = {0, };
gf_fop_setattr_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
@@ -5002,8 +5002,8 @@ client_setattr_cbk (call_frame_t *frame,gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret == 0) {
- gf_stat_to_stat (&rsp->statpre, &statpre);
- gf_stat_to_stat (&rsp->statpost, &statpost);
+ gf_stat_to_iatt (&rsp->statpre, &statpre);
+ gf_stat_to_iatt (&rsp->statpost, &statpost);
}
STACK_UNWIND (frame, op_ret, op_errno, &statpre, &statpost);
@@ -5015,8 +5015,8 @@ static int32_t
client_fsetattr_cbk (call_frame_t *frame,gf_hdr_common_t *hdr, size_t hdrlen,
struct iobuf *iobuf)
{
- struct stat statpre = {0, };
- struct stat statpost = {0, };
+ struct iatt statpre = {0, };
+ struct iatt statpost = {0, };
gf_fop_setattr_rsp_t *rsp = NULL;
int32_t op_ret = 0;
int32_t op_errno = 0;
@@ -5027,8 +5027,8 @@ client_fsetattr_cbk (call_frame_t *frame,gf_hdr_common_t *hdr, size_t hdrlen,
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
if (op_ret == 0) {
- gf_stat_to_stat (&rsp->statpre, &statpre);
- gf_stat_to_stat (&rsp->statpost, &statpost);
+ gf_stat_to_iatt (&rsp->statpre, &statpre);
+ gf_stat_to_iatt (&rsp->statpost, &statpost);
}
STACK_UNWIND (frame, op_ret, op_errno, &statpre, &statpost);
@@ -5087,7 +5087,7 @@ gf_bin_to_direntry (char *buf, size_t count)
break;
rcount = ender - buffer;
*ender = '\0';
- if (S_ISLNK (trav->buf.st_mode))
+ if (IA_ISLNK (trav->buf.ia_type))
trav->link = strdup (buffer);
else
trav->link = "";
@@ -5118,7 +5118,7 @@ gf_free_direntry (dir_entry_t *head)
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/client/src/client-protocol.h b/xlators/protocol/client/src/client-protocol.h
index 27348690296..ae65fb5fe72 100644
--- a/xlators/protocol/client/src/client-protocol.h
+++ b/xlators/protocol/client/src/client-protocol.h
@@ -117,7 +117,7 @@ typedef struct {
static inline void
-gf_string_to_stat(char *string, struct stat *stbuf)
+gf_string_to_stat(char *string, struct iatt *stbuf)
{
uint64_t dev = 0;
uint64_t ino = 0;
@@ -154,25 +154,25 @@ gf_string_to_stat(char *string, struct stat *stbuf)
&ctime,
&ctime_nsec);
- stbuf->st_dev = dev;
- stbuf->st_ino = ino;
- stbuf->st_mode = mode;
- stbuf->st_nlink = nlink;
- stbuf->st_uid = uid;
- stbuf->st_gid = gid;
- stbuf->st_rdev = rdev;
- stbuf->st_size = size;
- stbuf->st_blksize = blksize;
- stbuf->st_blocks = blocks;
-
- stbuf->st_atime = atime;
- stbuf->st_mtime = mtime;
- stbuf->st_ctime = ctime;
-
- ST_ATIM_NSEC_SET(stbuf, atime_nsec);
- ST_MTIM_NSEC_SET(stbuf, mtime_nsec);
- ST_CTIM_NSEC_SET(stbuf, ctime_nsec);
-
+ stbuf->ia_gen = dev;
+ stbuf->ia_ino = ino;
+ stbuf->ia_prot = ia_prot_from_st_mode (mode);
+ stbuf->ia_type = ia_type_from_st_mode (mode);
+ stbuf->ia_nlink = nlink;
+ stbuf->ia_uid = uid;
+ stbuf->ia_gid = gid;
+ stbuf->ia_rdev = rdev;
+ stbuf->ia_size = size;
+ stbuf->ia_blksize = blksize;
+ stbuf->ia_blocks = blocks;
+
+ stbuf->ia_atime = atime;
+ stbuf->ia_mtime = mtime;
+ stbuf->ia_ctime = ctime;
+
+ stbuf->ia_atime_nsec = atime_nsec;
+ stbuf->ia_mtime_nsec = mtime_nsec;
+ stbuf->ia_ctime_nsec = ctime_nsec;
}
#endif