summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-cache/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/performance/io-cache/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/performance/io-cache/src')
-rw-r--r--xlators/performance/io-cache/src/io-cache.c62
-rw-r--r--xlators/performance/io-cache/src/io-cache.h8
-rw-r--r--xlators/performance/io-cache/src/ioc-inode.c2
-rw-r--r--xlators/performance/io-cache/src/page.c16
4 files changed, 36 insertions, 52 deletions
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;