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/performance/io-cache/src/io-cache.c | 62 +++++++------------ xlators/performance/io-cache/src/io-cache.h | 8 +-- xlators/performance/io-cache/src/ioc-inode.c | 2 +- xlators/performance/io-cache/src/page.c | 16 ++--- xlators/performance/io-threads/src/io-threads.c | 72 +++++++++++----------- xlators/performance/quick-read/src/quick-read.c | 36 +++++------ xlators/performance/quick-read/src/quick-read.h | 2 +- xlators/performance/read-ahead/src/page.c | 2 +- xlators/performance/read-ahead/src/read-ahead.c | 34 ++++------ xlators/performance/read-ahead/src/read-ahead.h | 2 +- .../performance/stat-prefetch/src/stat-prefetch.c | 56 ++++++++--------- .../performance/stat-prefetch/src/stat-prefetch.h | 2 +- .../performance/symlink-cache/src/symlink-cache.c | 24 ++++---- .../performance/write-behind/src/write-behind.c | 64 ++++++++----------- 14 files changed, 169 insertions(+), 213 deletions(-) (limited to 'xlators/performance') diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index beb2e0ccc..2e523b15b 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -149,7 +149,7 @@ ioc_inode_flush (ioc_inode_t *ioc_inode) int32_t ioc_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct stat *preop, struct stat *postop) + struct iatt *preop, struct iatt *postop) { STACK_UNWIND_STRICT (setattr, frame, op_ret, op_errno, preop, postop); return 0; @@ -157,7 +157,7 @@ ioc_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t ioc_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc, - struct stat *stbuf, int32_t valid) + struct iatt *stbuf, int32_t valid) { uint64_t ioc_inode = 0; @@ -177,7 +177,7 @@ ioc_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t ioc_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) + struct iatt *stbuf, dict_t *dict, struct iatt *postparent) { ioc_inode_t *ioc_inode = NULL; ioc_table_t *table = this->private; @@ -219,10 +219,10 @@ ioc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, ioc_inode_lock (ioc_inode); { if (ioc_inode->cache.mtime == 0) { - ioc_inode->cache.mtime = stbuf->st_mtime; + ioc_inode->cache.mtime = stbuf->ia_mtime; } - ioc_inode->st_size = stbuf->st_size; + ioc_inode->ia_size = stbuf->ia_size; } ioc_inode_unlock (ioc_inode); @@ -321,12 +321,12 @@ ioc_forget (xlator_t *this, inode_t *inode) */ int32_t ioc_cache_validate_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) { ioc_local_t *local = NULL; ioc_inode_t *ioc_inode = NULL; size_t destroy_size = 0; - struct stat *local_stbuf = NULL; + struct iatt *local_stbuf = NULL; local = frame->local; ioc_inode = local->inode; @@ -345,7 +345,7 @@ ioc_cache_validate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, { destroy_size = __ioc_inode_flush (ioc_inode); if (op_ret >= 0) - ioc_inode->cache.mtime = stbuf->st_mtime; + ioc_inode->cache.mtime = stbuf->ia_mtime; } ioc_inode_unlock (ioc_inode); local_stbuf = NULL; @@ -536,21 +536,14 @@ ioc_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, ioc_inode_lock (ioc_inode); { - if ((table->min_file_size > ioc_inode->st_size) + if ((table->min_file_size > ioc_inode->ia_size) || ((table->max_file_size >= 0) - && (table->max_file_size < ioc_inode->st_size))) { + && (table->max_file_size < ioc_inode->ia_size))) { fd_ctx_set (fd, this, 1); } } ioc_inode_unlock (ioc_inode); - /* If mandatory locking has been enabled on this file, - we disable caching on it */ - if (((inode->st_mode & S_ISGID) - && !(inode->st_mode & S_IXGRP))) { - fd_ctx_set (fd, this, 1); - } - /* If O_DIRECT open, we disable caching on it */ if ((local->flags & O_DIRECT)){ /* O_DIRECT is only for one fd, not the inode @@ -591,8 +584,8 @@ ioc_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t ioc_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 *buf, struct stat *preparent, - struct stat *postparent) + inode_t *inode, struct iatt *buf, struct iatt *preparent, + struct iatt *postparent) { ioc_local_t *local = NULL; ioc_table_t *table = NULL; @@ -612,12 +605,12 @@ ioc_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, ioc_inode_lock (ioc_inode); { - ioc_inode->cache.mtime = buf->st_mtime; - ioc_inode->st_size = buf->st_size; + ioc_inode->cache.mtime = buf->ia_mtime; + ioc_inode->ia_size = buf->ia_size; - if ((table->min_file_size > ioc_inode->st_size) + if ((table->min_file_size > ioc_inode->ia_size) || ((table->max_file_size >= 0) - && (table->max_file_size < ioc_inode->st_size))) { + && (table->max_file_size < ioc_inode->ia_size))) { fd_ctx_set (fd, this, 1); } } @@ -626,15 +619,6 @@ ioc_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, inode_ctx_put (fd->inode, this, (uint64_t)(long)ioc_inode); - /* - * If mandatory locking has been enabled on this file, - * we disable caching on it - */ - if ((inode->st_mode & S_ISGID) && - !(inode->st_mode & S_IXGRP)) { - fd_ctx_set (fd, this, 1); - } - /* If O_DIRECT open, we disable caching on it */ if (local->flags & O_DIRECT){ /* @@ -760,7 +744,7 @@ ioc_release (xlator_t *this, fd_t *fd) int32_t ioc_readv_disabled_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, + int32_t count, struct iatt *stbuf, struct iobref *iobref) { STACK_UNWIND_STRICT (readv, frame, op_ret, op_errno, vector, count, @@ -1082,8 +1066,8 @@ out: */ int32_t ioc_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) { ioc_local_t *local = NULL; uint64_t ioc_inode = 0; @@ -1153,8 +1137,8 @@ ioc_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, */ int32_t ioc_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) { STACK_UNWIND_STRICT (truncate, frame, op_ret, op_errno, prebuf, @@ -1176,8 +1160,8 @@ ioc_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int32_t ioc_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) { STACK_UNWIND_STRICT (ftruncate, frame, op_ret, op_errno, prebuf, diff --git a/xlators/performance/io-cache/src/io-cache.h b/xlators/performance/io-cache/src/io-cache.h index b1e061eee..15a2828bb 100644 --- a/xlators/performance/io-cache/src/io-cache.h +++ b/xlators/performance/io-cache/src/io-cache.h @@ -141,7 +141,7 @@ struct ioc_cache { struct ioc_inode { struct ioc_table *table; - off_t st_size; + off_t ia_size; struct ioc_cache cache; struct list_head inode_list; /* * list of inodes, maintained by @@ -191,7 +191,7 @@ ptr_to_str (void *ptr); int32_t ioc_readv_disabled_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, + int32_t count, struct iatt *stbuf, struct iobref *iobref); ioc_page_t * @@ -325,10 +325,10 @@ ioc_inode_flush (ioc_inode_t *ioc_inode); void ioc_inode_wakeup (call_frame_t *frame, ioc_inode_t *ioc_inode, - struct stat *stbuf); + struct iatt *stbuf); int8_t -ioc_cache_still_valid (ioc_inode_t *ioc_inode, struct stat *stbuf); +ioc_cache_still_valid (ioc_inode_t *ioc_inode, struct iatt *stbuf); int32_t ioc_prune (ioc_table_t *table); diff --git a/xlators/performance/io-cache/src/ioc-inode.c b/xlators/performance/io-cache/src/ioc-inode.c index 74c657fe7..763f329db 100644 --- a/xlators/performance/io-cache/src/ioc-inode.c +++ b/xlators/performance/io-cache/src/ioc-inode.c @@ -62,7 +62,7 @@ ptr_to_str (void *ptr) void ioc_inode_wakeup (call_frame_t *frame, ioc_inode_t *ioc_inode, - struct stat *stbuf) + struct iatt *stbuf) { ioc_waitq_t *waiter = NULL, *waited = NULL; ioc_waitq_t *page_waitq = NULL; diff --git a/xlators/performance/io-cache/src/page.c b/xlators/performance/io-cache/src/page.c index fc0eba101..c4cc8f060 100644 --- a/xlators/performance/io-cache/src/page.c +++ b/xlators/performance/io-cache/src/page.c @@ -282,17 +282,17 @@ out: * assumes ioc_inode is locked */ int8_t -ioc_cache_still_valid (ioc_inode_t *ioc_inode, struct stat *stbuf) +ioc_cache_still_valid (ioc_inode_t *ioc_inode, struct iatt *stbuf) { int8_t cache_still_valid = 1; #if 0 - if (!stbuf || (stbuf->st_mtime != ioc_inode->cache.mtime) || + if (!stbuf || (stbuf->ia_mtime != ioc_inode->cache.mtime) || (stbuf->st_mtim.tv_nsec != ioc_inode->stbuf.st_mtim.tv_nsec)) cache_still_valid = 0; #else - if (!stbuf || (stbuf->st_mtime != ioc_inode->cache.mtime)) + if (!stbuf || (stbuf->ia_mtime != ioc_inode->cache.mtime)) cache_still_valid = 0; #endif @@ -301,7 +301,7 @@ ioc_cache_still_valid (ioc_inode_t *ioc_inode, struct stat *stbuf) /* talk with avati@gluster.com to enable this section */ if (!ioc_inode->mtime && stbuf) { cache_still_valid = 1; - ioc_inode->mtime = stbuf->st_mtime; + ioc_inode->mtime = stbuf->ia_mtime; } #endif @@ -329,7 +329,7 @@ ioc_waitq_return (ioc_waitq_t *waitq) int ioc_fault_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) + int32_t count, struct iatt *stbuf, struct iobref *iobref) { ioc_local_t *local = NULL; off_t offset = 0; @@ -353,7 +353,7 @@ ioc_fault_cbk (call_frame_t *frame, void *cookie, xlator_t *this, payload_size = op_ret; zero_filled = ((op_ret >=0) - && (stbuf->st_mtime == 0)); + && (stbuf->ia_mtime == 0)); ioc_inode_lock (ioc_inode); { @@ -367,7 +367,7 @@ ioc_fault_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } if ((op_ret >= 0) && !zero_filled) - ioc_inode->cache.mtime = stbuf->st_mtime; + ioc_inode->cache.mtime = stbuf->ia_mtime; gettimeofday (&ioc_inode->cache.tv, NULL); @@ -695,7 +695,7 @@ ioc_frame_unwind (call_frame_t *frame) struct iovec *vector = NULL; int32_t copied = 0; struct iobref *iobref = NULL; - struct stat stbuf = {0,}; + struct iatt stbuf = {0,}; int32_t op_ret = 0, op_errno = 0; local = frame->local; diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index feae1439e..5ef716733 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -162,8 +162,8 @@ iot_schedule_ordered (iot_conf_t *conf, inode_t *inode, call_stub_t *stub) int iot_lookup_cbk (call_frame_t *frame, void * cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, - inode_t *inode, struct stat *buf, dict_t *xattr, - struct stat *postparent) + inode_t *inode, struct iatt *buf, dict_t *xattr, + struct iatt *postparent) { STACK_UNWIND_STRICT (lookup, frame, op_ret, op_errno, inode, buf, xattr, postparent); @@ -216,7 +216,7 @@ out: int iot_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct stat *preop, struct stat *postop) + struct iatt *preop, struct iatt *postop) { STACK_UNWIND_STRICT (setattr, frame, op_ret, op_errno, preop, postop); return 0; @@ -225,7 +225,7 @@ iot_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int iot_setattr_wrapper (call_frame_t *frame, xlator_t *this, loc_t *loc, - struct stat *stbuf, int32_t valid) + struct iatt *stbuf, int32_t valid) { STACK_WIND (frame, iot_setattr_cbk, FIRST_CHILD (this), @@ -237,7 +237,7 @@ iot_setattr_wrapper (call_frame_t *frame, xlator_t *this, loc_t *loc, int iot_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc, - struct stat *stbuf, int32_t valid) + struct iatt *stbuf, int32_t valid) { call_stub_t *stub = NULL; int ret = -1; @@ -269,7 +269,7 @@ out: int iot_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct stat *preop, struct stat *postop) + struct iatt *preop, struct iatt *postop) { STACK_UNWIND_STRICT (fsetattr, frame, op_ret, op_errno, preop, postop); return 0; @@ -278,7 +278,7 @@ iot_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int iot_fsetattr_wrapper (call_frame_t *frame, xlator_t *this, - fd_t *fd, struct stat *stbuf, int32_t valid) + fd_t *fd, struct iatt *stbuf, int32_t valid) { STACK_WIND (frame, iot_fsetattr_cbk, FIRST_CHILD (this), FIRST_CHILD (this)->fops->fsetattr, fd, stbuf, valid); @@ -288,7 +288,7 @@ iot_fsetattr_wrapper (call_frame_t *frame, xlator_t *this, int iot_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, - struct stat *stbuf, int32_t valid) + struct iatt *stbuf, int32_t valid) { call_stub_t *stub = NULL; int ret = -1; @@ -366,7 +366,7 @@ out: int iot_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, const char *path, - struct stat *stbuf) + struct iatt *stbuf) { STACK_UNWIND_STRICT (readlink, frame, op_ret, op_errno, path, stbuf); return 0; @@ -418,8 +418,8 @@ out: int iot_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, - struct stat *buf, struct stat *preparent, - struct stat *postparent) + struct iatt *buf, struct iatt *preparent, + struct iatt *postparent) { STACK_UNWIND_STRICT (mknod, frame, op_ret, op_errno, inode, buf, preparent, postparent); @@ -471,8 +471,8 @@ out: int iot_mkdir_cbk (call_frame_t *frame, void * cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, - struct stat *buf, struct stat *preparent, - struct stat *postparent) + struct iatt *buf, struct iatt *preparent, + struct iatt *postparent) { STACK_UNWIND_STRICT (mkdir, frame, op_ret, op_errno, inode, buf, preparent, postparent); @@ -521,8 +521,8 @@ out: int iot_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) { STACK_UNWIND_STRICT (rmdir, frame, op_ret, op_errno, preparent, postparent); @@ -570,8 +570,8 @@ out: int iot_symlink_cbk (call_frame_t *frame, void * cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, - struct stat *buf, struct stat *preparent, - struct stat *postparent) + struct iatt *buf, struct iatt *preparent, + struct iatt *postparent) { STACK_UNWIND_STRICT (symlink, frame, op_ret, op_errno, inode, buf, preparent, postparent); @@ -622,9 +622,9 @@ out: int iot_rename_cbk (call_frame_t *frame, void * cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *buf, - struct stat *preoldparent, struct stat *postoldparent, - struct stat *prenewparent, struct stat *postnewparent) + int32_t op_ret, int32_t op_errno, struct iatt *buf, + struct iatt *preoldparent, struct iatt *postoldparent, + struct iatt *prenewparent, struct iatt *postnewparent) { STACK_UNWIND_STRICT (rename, frame, op_ret, op_errno, buf, preoldparent, postoldparent, prenewparent, postnewparent); @@ -726,8 +726,8 @@ out: int iot_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) + struct iatt *stbuf, struct iatt *preparent, + struct iatt *postparent) { STACK_UNWIND_STRICT (create, frame, op_ret, op_errno, fd, inode, stbuf, preparent, postparent); @@ -784,7 +784,7 @@ out: int iot_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) + int32_t count, struct iatt *stbuf, struct iobref *iobref) { STACK_UNWIND_STRICT (readv, frame, op_ret, op_errno, vector, count, stbuf, iobref); @@ -887,8 +887,8 @@ out: int iot_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) { STACK_UNWIND_STRICT (fsync, frame, op_ret, op_errno, prebuf, postbuf); return 0; @@ -939,8 +939,8 @@ out: int iot_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) { STACK_UNWIND_STRICT (writev, frame, op_ret, op_errno, prebuf, postbuf); return 0; @@ -1048,7 +1048,7 @@ out: int iot_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *buf) + int32_t op_ret, int32_t op_errno, struct iatt *buf) { STACK_UNWIND_STRICT (stat, frame, op_ret, op_errno, buf); return 0; @@ -1108,7 +1108,7 @@ out: int iot_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *buf) + int32_t op_ret, int32_t op_errno, struct iatt *buf) { STACK_UNWIND_STRICT (fstat, frame, op_ret, op_errno, buf); return 0; @@ -1157,8 +1157,8 @@ out: int iot_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) { STACK_UNWIND_STRICT (truncate, frame, op_ret, op_errno, prebuf, postbuf); @@ -1220,8 +1220,8 @@ out: int iot_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) { STACK_UNWIND_STRICT (ftruncate, frame, op_ret, op_errno, prebuf, postbuf); @@ -1324,8 +1324,8 @@ out: int iot_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) { STACK_UNWIND_STRICT (unlink, frame, op_ret, op_errno, preparent, postparent); @@ -1378,7 +1378,7 @@ out: int iot_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, - struct stat *buf, struct stat *preparent, struct stat *postparent) + struct iatt *buf, struct iatt *preparent, struct iatt *postparent) { STACK_UNWIND_STRICT (link, frame, op_ret, op_errno, inode, buf, preparent, postparent); diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 5dd33486c..36cfc42b4 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -150,7 +150,7 @@ out: int32_t qr_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, - struct stat *buf, dict_t *dict, struct stat *postparent) + struct iatt *buf, dict_t *dict, struct iatt *postparent) { data_t *content = NULL; qr_file_t *qr_file = NULL; @@ -164,11 +164,11 @@ qr_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, conf = this->private; - if (buf->st_size > conf->max_file_size) { + if (buf->ia_size > conf->max_file_size) { goto out; } - if (S_ISDIR (buf->st_mode)) { + if (IA_ISDIR (buf->ia_type)) { goto out; } @@ -215,7 +215,7 @@ unlock: LOCK (&qr_file->lock); { if (qr_file->xattr - && (qr_file->stbuf.st_mtime != buf->st_mtime)) { + && (qr_file->stbuf.ia_mtime != buf->ia_mtime)) { dict_unref (qr_file->xattr); qr_file->xattr = NULL; } @@ -546,7 +546,7 @@ qr_need_validation (qr_conf_t *conf, qr_file_t *file) static int32_t qr_validate_cache_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *buf) + int32_t op_ret, int32_t op_errno, struct iatt *buf) { qr_file_t *qr_file = NULL; qr_local_t *local = NULL; @@ -580,7 +580,7 @@ qr_validate_cache_cbk (call_frame_t *frame, void *cookie, xlator_t *this, LOCK (&qr_file->lock); { - if (qr_file->stbuf.st_mtime != buf->st_mtime) { + if (qr_file->stbuf.ia_mtime != buf->ia_mtime) { dict_unref (qr_file->xattr); qr_file->xattr = NULL; } @@ -729,7 +729,7 @@ out: int32_t qr_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) { STACK_UNWIND_STRICT (readv, frame, op_ret, op_errno, vector, count, stbuf, iobref); @@ -759,7 +759,7 @@ qr_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, char need_open = 0, can_wind = 0, need_unwind = 0; struct iobuf *iobuf = NULL; struct iobref *iobref = NULL; - struct stat stbuf = {0, }; + struct iatt stbuf = {0, }; data_t *content = NULL; qr_fd_ctx_t *qr_fd_ctx = NULL; call_stub_t *stub = NULL; @@ -978,8 +978,8 @@ out: int32_t qr_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) { STACK_UNWIND_STRICT (writev, frame, op_ret, op_errno, prebuf, postbuf); return 0; @@ -1098,7 +1098,7 @@ out: int32_t qr_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct stat *buf) + int32_t op_errno, struct iatt *buf) { STACK_UNWIND_STRICT (fstat, frame, op_ret, op_errno, buf); return 0; @@ -1195,7 +1195,7 @@ out: int32_t qr_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct stat *preop, struct stat *postop) + struct iatt *preop, struct iatt *postop) { STACK_UNWIND_STRICT (fsetattr, frame, op_ret, op_errno, preop, postop); return 0; @@ -1204,7 +1204,7 @@ qr_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t qr_fsetattr_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, - struct stat *stbuf, int32_t valid) + struct iatt *stbuf, int32_t valid) { STACK_WIND(frame, qr_fsetattr_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->fsetattr, fd, stbuf, @@ -1215,7 +1215,7 @@ qr_fsetattr_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t qr_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, - struct stat *stbuf, int32_t valid) + struct iatt *stbuf, int32_t valid) { uint64_t value = 0; int flags = 0; @@ -1765,7 +1765,7 @@ out: int32_t qr_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_errno, struct iatt *prebuf, struct iatt *postbuf) { STACK_UNWIND_STRICT (fsync, frame, op_ret, op_errno, prebuf, postbuf); return 0; @@ -1859,8 +1859,8 @@ out: int32_t qr_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) { int32_t ret = 0; uint64_t value = 0; @@ -1886,7 +1886,7 @@ qr_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (qr_file) { LOCK (&qr_file->lock); { - if (qr_file->stbuf.st_size != postbuf->st_size) + if (qr_file->stbuf.ia_size != postbuf->ia_size) { dict_unref (qr_file->xattr); qr_file->xattr = NULL; diff --git a/xlators/performance/quick-read/src/quick-read.h b/xlators/performance/quick-read/src/quick-read.h index 5ced44e1d..e5bca6376 100644 --- a/xlators/performance/quick-read/src/quick-read.h +++ b/xlators/performance/quick-read/src/quick-read.h @@ -66,7 +66,7 @@ typedef struct qr_local qr_local_t; struct qr_file { dict_t *xattr; - struct stat stbuf; + struct iatt stbuf; struct timeval tv; gf_lock_t lock; }; diff --git a/xlators/performance/read-ahead/src/page.c b/xlators/performance/read-ahead/src/page.c index 07ab84ed8..063258c8f 100644 --- a/xlators/performance/read-ahead/src/page.c +++ b/xlators/performance/read-ahead/src/page.c @@ -131,7 +131,7 @@ ra_waitq_return (ra_waitq_t *waitq) int ra_fault_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) + int32_t count, struct iatt *stbuf, struct iobref *iobref) { ra_local_t *local = NULL; off_t pending_offset = 0; diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c index 8e140d821..c0a432582 100644 --- a/xlators/performance/read-ahead/src/read-ahead.c +++ b/xlators/performance/read-ahead/src/read-ahead.c @@ -70,12 +70,6 @@ ra_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, ret = fd_ctx_set (fd, this, (uint64_t)(long)file); - /* If mandatory locking has been enabled on this file, - we disable caching on it */ - - if ((fd->inode->st_mode & S_ISGID) && !(fd->inode->st_mode & S_IXGRP)) - file->disabled = 1; - /* If O_DIRECT open, we disable caching on it */ if ((fd->flags & O_DIRECT) || ((fd->flags & O_ACCMODE) == O_WRONLY)) @@ -122,8 +116,8 @@ unwind: int ra_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 *buf, struct stat *preparent, - struct stat *postparent) + struct iatt *buf, struct iatt *preparent, + struct iatt *postparent) { ra_conf_t *conf = NULL; ra_file_t *file = NULL; @@ -146,19 +140,13 @@ ra_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, ret = fd_ctx_set (fd, this, (uint64_t)(long)file); - /* If mandatory locking has been enabled on this file, - we disable caching on it */ - - if ((fd->inode->st_mode & S_ISGID) && !(fd->inode->st_mode & S_IXGRP)) - file->disabled = 1; - /* If O_DIRECT open, we disable caching on it */ if ((fd->flags & O_DIRECT) || ((fd->flags & O_ACCMODE) == O_WRONLY)) file->disabled = 1; file->offset = (unsigned long long) 0; - //file->size = fd->inode->buf.st_size; + //file->size = fd->inode->buf.ia_size; file->conf = conf; file->pages.next = &file->pages; file->pages.prev = &file->pages; @@ -330,7 +318,7 @@ read_ahead (call_frame_t *frame, ra_file_t *file) int ra_need_atime_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) + int32_t count, struct iatt *stbuf, struct iobref *iobref) { STACK_DESTROY (frame->root); return 0; @@ -425,7 +413,7 @@ out: int ra_readv_disabled_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) + int32_t count, struct iatt *stbuf, struct iobref *iobref) { STACK_UNWIND_STRICT (readv, frame, op_ret, op_errno, vector, count, stbuf, iobref); @@ -543,7 +531,7 @@ ra_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int ra_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_errno, struct iatt *prebuf, struct iatt *postbuf) { STACK_UNWIND_STRICT (fsync, frame, op_ret, op_errno, prebuf, postbuf); return 0; @@ -616,8 +604,8 @@ unwind: int ra_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) { fd_t *fd = NULL; ra_file_t *file = NULL; @@ -677,8 +665,8 @@ unwind: int ra_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) { STACK_UNWIND_STRICT (truncate, frame, op_ret, op_errno, prebuf, postbuf); @@ -688,7 +676,7 @@ ra_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int ra_attr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *buf) + int32_t op_ret, int32_t op_errno, struct iatt *buf) { STACK_UNWIND_STRICT (stat, frame, op_ret, op_errno, buf); return 0; diff --git a/xlators/performance/read-ahead/src/read-ahead.h b/xlators/performance/read-ahead/src/read-ahead.h index d11143551..0ad47fc75 100644 --- a/xlators/performance/read-ahead/src/read-ahead.h +++ b/xlators/performance/read-ahead/src/read-ahead.h @@ -98,7 +98,7 @@ struct ra_file { size_t size; int32_t refcount; pthread_mutex_t file_lock; - struct stat stbuf; + struct iatt stbuf; uint64_t page_size; uint32_t page_count; }; diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index ef2fc43b2..b3777cb76 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -87,7 +87,7 @@ out: int sp_update_inode_ctx (xlator_t *this, inode_t *inode, int32_t *op_ret, int32_t *op_errno, char *lookup_in_progress, - char *looked_up, struct stat *stbuf, + char *looked_up, struct iatt *stbuf, struct list_head *waiting_ops, int32_t *error) { int32_t ret = 0; @@ -127,7 +127,7 @@ sp_update_inode_ctx (xlator_t *this, inode_t *inode, int32_t *op_ret, } if ((op_ret == 0) && (stbuf != NULL) - && S_ISDIR (stbuf->st_mode)) { + && IA_ISDIR (stbuf->ia_type)) { memcpy (&inode_ctx->stbuf, stbuf, sizeof (*stbuf)); } @@ -695,7 +695,7 @@ sp_cache_add_entries (sp_cache_t *cache, gf_dirent_t *entries) LOCK (&cache->lock); { list_for_each_entry (entry, &entries->list, list) { - if (S_ISDIR (entry->d_stat.st_mode)) { + if (IA_ISDIR (entry->d_stat.ia_type)) { continue; } @@ -734,7 +734,7 @@ unlock: int32_t sp_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, - struct stat *buf, dict_t *dict, struct stat *postparent) + struct iatt *buf, dict_t *dict, struct iatt *postparent) { int ret = 0; struct list_head waiting_ops = {0, }; @@ -972,7 +972,7 @@ sp_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) uint64_t value = 0; char xattr_req_empty = 1, can_wind = 0; sp_cache_t *cache = NULL; - struct stat postparent = {0, }, buf = {0, }; + struct iatt postparent = {0, }, buf = {0, }; int32_t ret = -1, op_ret = -1, op_errno = EINVAL; sp_inode_ctx_t *inode_ctx = NULL, *parent_inode_ctx = NULL; sp_local_t *local = NULL; @@ -1017,7 +1017,7 @@ sp_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) FREE (dirent); } - } else if (S_ISDIR (loc->inode->st_mode)) { + } else if (IA_ISDIR (loc->inode->ia_type)) { cache = sp_get_cache_inode (this, loc->inode, frame->root->pid); if (cache) { ret = sp_cache_get_entry (cache, ".", &dirent); @@ -1230,8 +1230,8 @@ unwind: int32_t sp_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) { SP_STACK_UNWIND (truncate, frame, op_ret, op_errno, prebuf, postbuf); return 0; @@ -1241,9 +1241,9 @@ sp_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t sp_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct stat *buf, - struct stat *preoldparent, struct stat *postoldparent, - struct stat *prenewparent, struct stat *postnewparent) + int32_t op_ret, int32_t op_errno, struct iatt *buf, + struct iatt *preoldparent, struct iatt *postoldparent, + struct iatt *prenewparent, struct iatt *postnewparent) { SP_STACK_UNWIND (rename, frame, op_ret, op_errno, buf, preoldparent, postoldparent, prenewparent, postnewparent); @@ -1381,8 +1381,8 @@ out: static int32_t sp_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 *buf, struct stat *preparent, - struct stat *postparent) + struct iatt *buf, struct iatt *preparent, + struct iatt *postparent) { sp_local_t *local = NULL; sp_fd_ctx_t *fd_ctx = NULL; @@ -1582,8 +1582,8 @@ out: int32_t sp_new_entry_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, - struct stat *buf, struct stat *preparent, - struct stat *postparent) + struct iatt *buf, struct iatt *preparent, + struct iatt *postparent) { sp_local_t *local = NULL; char lookup_in_progress = 0, looked_up = 0; @@ -1807,8 +1807,8 @@ out: int32_t sp_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, - struct stat *buf, struct stat *preparent, - struct stat *postparent) + struct iatt *buf, struct iatt *preparent, + struct iatt *postparent) { SP_STACK_UNWIND (link, frame, op_ret, op_errno, inode, buf, preparent, postparent); @@ -2049,7 +2049,7 @@ unwind: int32_t sp_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct stat *prestat, struct stat *poststat) + struct iatt *prestat, struct iatt *poststat) { SP_STACK_UNWIND (setattr, frame, op_ret, op_errno, prestat, poststat); return 0; @@ -2058,7 +2058,7 @@ sp_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int sp_setattr_helper (call_frame_t *frame, xlator_t *this, - loc_t *loc, struct stat *buf, int32_t valid) + loc_t *loc, struct iatt *buf, int32_t valid) { uint64_t value = 0; sp_inode_ctx_t *inode_ctx = NULL; @@ -2100,7 +2100,7 @@ unwind: int sp_setattr (call_frame_t *frame, xlator_t *this, - loc_t *loc, struct stat *buf, int32_t valid) + loc_t *loc, struct iatt *buf, int32_t valid) { sp_cache_t *cache = NULL; int32_t op_errno = -1; @@ -2149,7 +2149,7 @@ out: int32_t sp_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, const char *path, - struct stat *buf) + struct iatt *buf) { SP_STACK_UNWIND (readlink, frame, op_ret, op_errno, path, buf); return 0; @@ -2247,8 +2247,8 @@ out: int32_t sp_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) { SP_STACK_UNWIND (unlink, frame, op_ret, op_errno, preparent, postparent); @@ -2487,7 +2487,7 @@ out: int32_t sp_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) { SP_STACK_UNWIND (readv, frame, op_ret, op_errno, vector, count, stbuf, iobref); @@ -2754,7 +2754,7 @@ sp_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc,loc_t *newloc) goto out; } - if (S_ISDIR (oldloc->inode->st_mode)) { + if (IA_ISDIR (oldloc->inode->ia_type)) { sp_remove_caches_from_all_fds_opened (this, oldloc->inode); } @@ -3178,7 +3178,7 @@ sp_getdents_cbk (call_frame_t *frame, void *cookie, xlator_t *this, cache = sp_get_cache_fd (this, local->fd); if (cache) { for (trav = entries->next; trav; trav = trav->next) { - if (S_ISLNK (trav->buf.st_mode)) { + if (IA_ISLNK (trav->buf.ia_type)) { sp_cache_remove_entry (cache, trav->name, 0); } } @@ -3476,7 +3476,7 @@ unwind: int32_t sp_stbuf_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct stat *buf) + int32_t op_errno, struct iatt *buf) { STACK_UNWIND (frame, op_ret, op_errno, buf); return 0; @@ -3812,7 +3812,7 @@ out: int32_t sp_forget (xlator_t *this, inode_t *inode) { - struct stat *buf = NULL; + struct iatt *buf = NULL; uint64_t value = 0; inode_ctx_del (inode, this, &value); diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.h b/xlators/performance/stat-prefetch/src/stat-prefetch.h index 3fcf4a0a6..9ff2899a9 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.h +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.h @@ -73,7 +73,7 @@ struct sp_inode_ctx { char need_unwind; int32_t op_ret; int32_t op_errno; - struct stat stbuf; + struct iatt stbuf; gf_lock_t lock; struct list_head waiting_ops; }; diff --git a/xlators/performance/symlink-cache/src/symlink-cache.c b/xlators/performance/symlink-cache/src/symlink-cache.c index 22b1c5482..a8c89b864 100644 --- a/xlators/performance/symlink-cache/src/symlink-cache.c +++ b/xlators/performance/symlink-cache/src/symlink-cache.c @@ -90,7 +90,7 @@ sc_cache_update (xlator_t *this, inode_t *inode, const char *link) int -sc_cache_set (xlator_t *this, inode_t *inode, struct stat *buf, +sc_cache_set (xlator_t *this, inode_t *inode, struct iatt *buf, const char *link) { struct symlink_cache *sc = NULL; @@ -126,7 +126,7 @@ sc_cache_set (xlator_t *this, inode_t *inode, struct stat *buf, } } - sc->ctime = buf->st_ctime; + sc->ctime = buf->ia_ctime; gf_log (this->name, GF_LOG_DEBUG, "setting symlink cache: %s", link); @@ -180,12 +180,12 @@ sc_cache_flush (xlator_t *this, inode_t *inode) int -sc_cache_validate (xlator_t *this, inode_t *inode, struct stat *buf) +sc_cache_validate (xlator_t *this, inode_t *inode, struct iatt *buf) { struct symlink_cache *sc = NULL; uint64_t tmp_sc = 0; - if (!S_ISLNK (buf->st_mode)) { + if (!IA_ISLNK (buf->ia_type)) { sc_cache_flush (this, inode); return 0; } @@ -204,7 +204,7 @@ sc_cache_validate (xlator_t *this, inode_t *inode, struct stat *buf) sc = (struct symlink_cache *)(long)tmp_sc; } - if (sc->ctime == buf->st_ctime) + if (sc->ctime == buf->ia_ctime) return 0; /* STALE */ @@ -216,7 +216,7 @@ sc_cache_validate (xlator_t *this, inode_t *inode, struct stat *buf) sc->readlink = NULL; } - sc->ctime = buf->st_ctime; + sc->ctime = buf->ia_ctime; return 0; } @@ -242,7 +242,7 @@ sc_cache_get (xlator_t *this, inode_t *inode, char **link) int sc_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, int op_errno, - const char *link, struct stat *sbuf) + const char *link, struct iatt *sbuf) { if (op_ret > 0) sc_cache_update (this, frame->local, link); @@ -260,7 +260,7 @@ sc_readlink (call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size) { char *link = NULL; - struct stat buf = {0, }; + struct iatt buf = {0, }; sc_cache_get (this, loc->inode, &link); @@ -294,8 +294,8 @@ sc_readlink (call_frame_t *frame, xlator_t *this, int sc_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, int op_errno, - inode_t *inode, struct stat *buf, struct stat *preparent, - struct stat *postparent) + inode_t *inode, struct iatt *buf, struct iatt *preparent, + struct iatt *postparent) { if (op_ret == 0) { if (frame->local) { @@ -327,8 +327,8 @@ sc_symlink (call_frame_t *frame, xlator_t *this, int sc_lookup_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) + inode_t *inode, struct iatt *buf, dict_t *xattr, + struct iatt *postparent) { if (op_ret == 0) sc_cache_validate (this, inode, buf); diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index 91651b805..8b627a548 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -316,7 +316,7 @@ wb_file_destroy (wb_file_t *file) int32_t wb_sync_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_errno, struct iatt *prebuf, struct iatt *postbuf) { wb_local_t *local = NULL; list_head_t *winds = NULL; @@ -522,7 +522,7 @@ out: int32_t wb_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct stat *buf) + int32_t op_errno, struct iatt *buf) { wb_local_t *local = NULL; wb_request_t *request = NULL; @@ -666,7 +666,7 @@ unwind: int32_t wb_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct stat *buf) + int32_t op_errno, struct iatt *buf) { wb_local_t *local = NULL; wb_request_t *request = NULL; @@ -715,7 +715,7 @@ wb_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd) int32_t ret = -1; int op_errno = EINVAL; - if ((!S_ISDIR (fd->inode->st_mode)) + if ((!IA_ISDIR (fd->inode->ia_type)) && fd_ctx_get (fd, this, &tmp_file)) { gf_log (this->name, GF_LOG_DEBUG, "write behind file pointer is" " not stored in context of fd(%p), returning EBADFD", @@ -779,8 +779,8 @@ unwind: int32_t wb_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) { wb_local_t *local = NULL; wb_request_t *request = NULL; @@ -929,8 +929,8 @@ unwind: int32_t wb_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) { wb_local_t *local = NULL; wb_request_t *request = NULL; @@ -981,7 +981,7 @@ wb_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset) int32_t ret = -1; int op_errno = EINVAL; - if ((!S_ISDIR (fd->inode->st_mode)) + if ((!IA_ISDIR (fd->inode->ia_type)) && fd_ctx_get (fd, this, &tmp_file)) { gf_log (this->name, GF_LOG_DEBUG, "write behind file pointer is" " not stored in context of fd(%p), returning EBADFD", @@ -1048,7 +1048,7 @@ unwind: int32_t wb_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) + int32_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost) { wb_local_t *local = NULL; wb_request_t *request = NULL; @@ -1105,7 +1105,7 @@ wb_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, static int32_t wb_setattr_helper (call_frame_t *frame, xlator_t *this, loc_t *loc, - struct stat *stbuf, int32_t valid) + struct iatt *stbuf, int32_t valid) { STACK_WIND (frame, wb_setattr_cbk, @@ -1121,7 +1121,7 @@ wb_setattr_helper (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t wb_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc, - struct stat *stbuf, int32_t valid) + struct iatt *stbuf, int32_t valid) { wb_file_t *file = NULL; fd_t *iter_fd = NULL; @@ -1235,15 +1235,6 @@ wb_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, goto out; } - /* - If mandatory locking has been enabled on this file, - we disable caching on it - */ - - if ((fd->inode->st_mode & S_ISGID) - && !(fd->inode->st_mode & S_IXGRP)) - file->disabled = 1; - /* If O_DIRECT then, we disable chaching */ if (((flags & O_DIRECT) == O_DIRECT) || ((flags & O_ACCMODE) == O_RDONLY) @@ -1299,8 +1290,8 @@ unwind: int32_t wb_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 *buf, struct stat *preparent, - struct stat *postparent) + struct iatt *buf, struct iatt *preparent, + struct iatt *postparent) { long flags = 0; wb_file_t *file = NULL; @@ -1313,13 +1304,6 @@ wb_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_errno = ENOMEM; goto out; } - /* - * If mandatory locking has been enabled on this file, - * we disable caching on it - */ - if ((fd->inode->st_mode & S_ISGID) - && !(fd->inode->st_mode & S_IXGRP)) - file->disabled = 1; /* If O_DIRECT then, we disable chaching */ if (frame->local) { @@ -1571,7 +1555,7 @@ __wb_get_other_requests (list_head_t *list, list_head_t *other_requests) int32_t wb_stack_unwind (list_head_t *unwinds) { - struct stat buf = {0,}; + struct iatt buf = {0,}; wb_request_t *request = NULL, *dummy = NULL; call_frame_t *frame = NULL; wb_local_t *local = NULL; @@ -1826,8 +1810,8 @@ out: int32_t wb_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) { STACK_UNWIND_STRICT (writev, frame, op_ret, op_errno, prebuf, postbuf); return 0; @@ -1852,7 +1836,7 @@ wb_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, if (vector != NULL) size = iov_length (vector, count); - if ((!S_ISDIR (fd->inode->st_mode)) + if ((!IA_ISDIR (fd->inode->ia_type)) && fd_ctx_get (fd, this, &tmp_file)) { gf_log (this->name, GF_LOG_DEBUG, "write behind file pointer is" " not stored in context of fd(%p), returning EBADFD", @@ -1863,7 +1847,7 @@ wb_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, } file = (wb_file_t *)(long)tmp_file; - if ((!S_ISDIR (fd->inode->st_mode)) && (file == NULL)) { + if ((!IA_ISDIR (fd->inode->ia_type)) && (file == NULL)) { gf_log (this->name, GF_LOG_DEBUG, "wb_file not found for fd %p", fd); op_errno = EBADFD; @@ -1964,7 +1948,7 @@ unwind: int32_t wb_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) { wb_local_t *local = NULL; wb_file_t *file = NULL; @@ -2016,7 +2000,7 @@ wb_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, int32_t ret = -1; wb_request_t *request = NULL; - if ((!S_ISDIR (fd->inode->st_mode)) + if ((!IA_ISDIR (fd->inode->ia_type)) && fd_ctx_get (fd, this, &tmp_file)) { gf_log (this->name, GF_LOG_DEBUG, "write behind file pointer is" " not stored in context of fd(%p), returning EBADFD", @@ -2171,7 +2155,7 @@ wb_flush (call_frame_t *frame, xlator_t *this, fd_t *fd) conf = this->private; - if ((!S_ISDIR (fd->inode->st_mode)) + if ((!IA_ISDIR (fd->inode->ia_type)) && fd_ctx_get (fd, this, &tmp_file)) { gf_log (this->name, GF_LOG_DEBUG, "write behind file pointer is" " not stored in context of fd(%p), returning EBADFD", @@ -2281,7 +2265,7 @@ wb_flush (call_frame_t *frame, xlator_t *this, fd_t *fd) static int32_t wb_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_errno, struct iatt *prebuf, struct iatt *postbuf) { wb_local_t *local = NULL; wb_file_t *file = NULL; @@ -2344,7 +2328,7 @@ wb_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync) wb_request_t *request = NULL; int32_t ret = -1; - if ((!S_ISDIR (fd->inode->st_mode)) + if ((!IA_ISDIR (fd->inode->ia_type)) && fd_ctx_get (fd, this, &tmp_file)) { gf_log (this->name, GF_LOG_DEBUG, "write behind file pointer is" " not stored in context of fd(%p), returning EBADFD", -- cgit