summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/dict.h
Commit message (Collapse)AuthorAgeFilesLines
* dict.c: Add dict_allocate_and_serializeRaghavendra G2009-05-161-0/+3
| | | | | | | | | - this procedure atomically allocates a buffer and serializes dict into it. - this procedure helps avoid memory corruptions due to race conditions where in new members are added into dict between allocating a buffer for serializing and actually serializing buffer into it. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* updated copyright header to extend copyright upto 2009Basavanagowda Kanur2009-02-261-1/+1
| | | | | | updated copyright header to include 2009. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* new functions dict_{get,set}_double for float/double valueHarshavardhana2009-02-211-0/+3
| | | | | | fixed warning Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
* Added all filesVikas Gorur2009-02-181-0/+179
-libglusterfs/src/defaults.h4
-rw-r--r--libglusterfs/src/fd.c2
-rw-r--r--libglusterfs/src/gf-dirent.c6
-rw-r--r--libglusterfs/src/gf-dirent.h6
-rw-r--r--libglusterfs/src/inode.c36
-rw-r--r--libglusterfs/src/inode.h7
-rw-r--r--libglusterfs/src/logging.h42
-rw-r--r--libglusterfs/src/protocol.h52
-rw-r--r--libglusterfs/src/syscall.c2
-rw-r--r--libglusterfs/src/syscall.h60
-rw-r--r--libglusterfs/src/xlator.h89
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient-internals.h8
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c215
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.c6
-rw-r--r--xlators/cluster/afr/src/afr-dir-write.c146
-rw-r--r--xlators/cluster/afr/src/afr-inode-read.c16
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c40
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.h4
-rw-r--r--xlators/cluster/afr/src/afr-open.c6
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-algorithm.c12
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c63
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.h2
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-data.c31
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-entry.c112
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-metadata.c36
-rw-r--r--xlators/cluster/afr/src/afr-self-heal.h10
-rw-r--r--xlators/cluster/afr/src/afr.c60
-rw-r--r--xlators/cluster/afr/src/afr.h100
-rw-r--r--xlators/cluster/dht/src/dht-common.c289
-rw-r--r--xlators/cluster/dht/src/dht-common.h31
-rw-r--r--xlators/cluster/dht/src/dht-helper.c32
-rw-r--r--xlators/cluster/dht/src/dht-linkfile.c8
-rw-r--r--xlators/cluster/dht/src/dht-rename.c62
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c16
-rw-r--r--xlators/cluster/dht/src/nufa.c20
-rw-r--r--xlators/cluster/dht/src/switch.c20
-rw-r--r--xlators/cluster/ha/src/ha.c100
-rw-r--r--xlators/cluster/ha/src/ha.h6
-rw-r--r--xlators/cluster/map/src/map.c114
-rw-r--r--xlators/cluster/map/src/map.h2
-rw-r--r--xlators/cluster/stripe/src/stripe.c348
-rw-r--r--xlators/cluster/stripe/src/stripe.h12
-rw-r--r--xlators/cluster/unify/src/unify-self-heal.c8
-rw-r--r--xlators/cluster/unify/src/unify.c311
-rw-r--r--xlators/cluster/unify/src/unify.h20
-rw-r--r--xlators/debug/error-gen/src/error-gen.c58
-rw-r--r--xlators/debug/io-stats/src/io-stats.c56
-rw-r--r--xlators/debug/trace/src/trace.c264
-rw-r--r--xlators/encryption/rot-13/src/rot-13.c6
-rw-r--r--xlators/features/filter/src/filter.c118
-rw-r--r--xlators/features/locks/src/common.c5
-rw-r--r--xlators/features/locks/src/posix.c20
-rw-r--r--xlators/features/path-convertor/src/path.c62
-rw-r--r--xlators/features/quota/src/quota.c80
-rw-r--r--xlators/features/trash/src/trash.c126
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c162
-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
-rw-r--r--xlators/performance/io-threads/src/io-threads.c72
-rw-r--r--xlators/performance/quick-read/src/quick-read.c36
-rw-r--r--xlators/performance/quick-read/src/quick-read.h2
-rw-r--r--xlators/performance/read-ahead/src/page.c2
-rw-r--r--xlators/performance/read-ahead/src/read-ahead.c34
-rw-r--r--xlators/performance/read-ahead/src/read-ahead.h2
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c56
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.h2
-rw-r--r--xlators/performance/symlink-cache/src/symlink-cache.c24
-rw-r--r--xlators/performance/write-behind/src/write-behind.c64
-rw-r--r--xlators/protocol/client/src/client-protocol.c236
-rw-r--r--xlators/protocol/client/src/client-protocol.h40
-rw-r--r--xlators/protocol/server/src/server-helpers.c48
-rw-r--r--xlators/protocol/server/src/server-helpers.h2
-rw-r--r--xlators/protocol/server/src/server-protocol.c212
-rw-r--r--xlators/protocol/server/src/server-protocol.h2
-rw-r--r--xlators/protocol/server/src/server-resolve.c4
-rw-r--r--xlators/storage/posix/src/posix.c696
81 files changed, 2527 insertions, 2976 deletions
diff --git a/libglusterfs/src/call-stub.c b/libglusterfs/src/call-stub.c
index 80b7f12ac9b..17d8c810603 100644
--- a/libglusterfs/src/call-stub.c
+++ b/libglusterfs/src/call-stub.c
@@ -81,9 +81,9 @@ fop_lookup_cbk_stub (call_frame_t *frame,
int32_t op_ret,
int32_t op_errno,
inode_t *inode,
- struct stat *buf,
+ struct iatt *buf,
dict_t *dict,
- struct stat *postparent)
+ struct iatt *postparent)
{
call_stub_t *stub = NULL;
@@ -134,7 +134,7 @@ fop_stat_cbk_stub (call_frame_t *frame,
fop_stat_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *buf)
+ struct iatt *buf)
{
call_stub_t *stub = NULL;
@@ -179,7 +179,7 @@ fop_fstat_cbk_stub (call_frame_t *frame,
fop_fstat_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *buf)
+ struct iatt *buf)
{
call_stub_t *stub = NULL;
@@ -227,8 +227,8 @@ fop_truncate_cbk_stub (call_frame_t *frame,
fop_truncate_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf)
+ struct iatt *prebuf,
+ struct iatt *postbuf)
{
call_stub_t *stub = NULL;
@@ -277,8 +277,8 @@ fop_ftruncate_cbk_stub (call_frame_t *frame,
fop_ftruncate_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf)
+ struct iatt *prebuf,
+ struct iatt *postbuf)
{
call_stub_t *stub = NULL;
@@ -370,7 +370,7 @@ fop_readlink_cbk_stub (call_frame_t *frame,
int32_t op_ret,
int32_t op_errno,
const char *path,
- struct stat *sbuf)
+ struct iatt *sbuf)
{
call_stub_t *stub = NULL;
@@ -421,9 +421,9 @@ fop_mknod_cbk_stub (call_frame_t *frame,
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)
{
call_stub_t *stub = NULL;
@@ -476,9 +476,9 @@ fop_mkdir_cbk_stub (call_frame_t *frame,
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)
{
call_stub_t *stub = NULL;
@@ -528,8 +528,8 @@ fop_unlink_cbk_stub (call_frame_t *frame,
fop_unlink_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *preparent,
- struct stat *postparent)
+ struct iatt *preparent,
+ struct iatt *postparent)
{
call_stub_t *stub = NULL;
@@ -576,8 +576,8 @@ fop_rmdir_cbk_stub (call_frame_t *frame,
fop_rmdir_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *preparent,
- struct stat *postparent)
+ struct iatt *preparent,
+ struct iatt *postparent)
{
call_stub_t *stub = NULL;
@@ -627,9 +627,9 @@ fop_symlink_cbk_stub (call_frame_t *frame,
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)
{
call_stub_t *stub = NULL;
@@ -682,11 +682,11 @@ fop_rename_cbk_stub (call_frame_t *frame,
fop_rename_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *buf,
- struct stat *preoldparent,
- struct stat *postoldparent,
- struct stat *prenewparent,
- struct stat *postnewparent)
+ struct iatt *buf,
+ struct iatt *preoldparent,
+ struct iatt *postoldparent,
+ struct iatt *prenewparent,
+ struct iatt *postnewparent)
{
call_stub_t *stub = NULL;
@@ -743,9 +743,9 @@ fop_link_cbk_stub (call_frame_t *frame,
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)
{
call_stub_t *stub = NULL;
@@ -803,9 +803,9 @@ fop_create_cbk_stub (call_frame_t *frame,
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)
{
call_stub_t *stub = NULL;
@@ -914,7 +914,7 @@ fop_readv_cbk_stub (call_frame_t *frame,
int32_t op_errno,
struct iovec *vector,
int32_t count,
- struct stat *stbuf,
+ struct iatt *stbuf,
struct iobref *iobref)
{
@@ -973,8 +973,8 @@ fop_writev_cbk_stub (call_frame_t *frame,
fop_writev_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf)
+ struct iatt *prebuf,
+ struct iatt *postbuf)
{
call_stub_t *stub = NULL;
@@ -1068,8 +1068,8 @@ fop_fsync_cbk_stub (call_frame_t *frame,
fop_fsync_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf)
+ struct iatt *prebuf,
+ struct iatt *postbuf)
{
call_stub_t *stub = NULL;
@@ -2229,8 +2229,8 @@ fop_setattr_cbk_stub (call_frame_t *frame,
fop_setattr_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *statpre,
- struct stat *statpost)
+ struct iatt *statpre,
+ struct iatt *statpost)
{
call_stub_t *stub = NULL;
@@ -2260,8 +2260,8 @@ fop_fsetattr_cbk_stub (call_frame_t *frame,
fop_setattr_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *statpre,
- struct stat *statpost)
+ struct iatt *statpre,
+ struct iatt *statpost)
{
call_stub_t *stub = NULL;
@@ -2289,7 +2289,7 @@ call_stub_t *
fop_setattr_stub (call_frame_t *frame,
fop_setattr_t fn,
loc_t *loc,
- struct stat *stbuf,
+ struct iatt *stbuf,
int32_t valid)
{
call_stub_t *stub = NULL;
@@ -2321,7 +2321,7 @@ call_stub_t *
fop_fsetattr_stub (call_frame_t *frame,
fop_fsetattr_t fn,
fd_t *fd,
- struct stat *stbuf,
+ struct iatt *stbuf,
int32_t valid)
{
call_stub_t *stub = NULL;
diff --git a/libglusterfs/src/call-stub.h b/libglusterfs/src/call-stub.h
index 189e2e1db9b..3160e9dd066 100644
--- a/libglusterfs/src/call-stub.h
+++ b/libglusterfs/src/call-stub.h
@@ -46,9 +46,9 @@ typedef struct {
fop_lookup_cbk_t fn;
int32_t op_ret, op_errno;
inode_t *inode;
- struct stat buf;
+ struct iatt buf;
dict_t *dict;
- struct stat postparent;
+ struct iatt postparent;
} lookup_cbk;
/* stat */
@@ -59,7 +59,7 @@ typedef struct {
struct {
fop_stat_cbk_t fn;
int32_t op_ret, op_errno;
- struct stat buf;
+ struct iatt buf;
} stat_cbk;
/* fstat */
@@ -70,7 +70,7 @@ typedef struct {
struct {
fop_fstat_cbk_t fn;
int32_t op_ret, op_errno;
- struct stat buf;
+ struct iatt buf;
} fstat_cbk;
/* truncate */
@@ -82,8 +82,8 @@ typedef struct {
struct {
fop_truncate_cbk_t fn;
int32_t op_ret, op_errno;
- struct stat prebuf;
- struct stat postbuf;
+ struct iatt prebuf;
+ struct iatt postbuf;
} truncate_cbk;
/* ftruncate */
@@ -95,8 +95,8 @@ typedef struct {
struct {
fop_ftruncate_cbk_t fn;
int32_t op_ret, op_errno;
- struct stat prebuf;
- struct stat postbuf;
+ struct iatt prebuf;
+ struct iatt postbuf;
} ftruncate_cbk;
/* access */
@@ -120,7 +120,7 @@ typedef struct {
fop_readlink_cbk_t fn;
int32_t op_ret, op_errno;
const char *buf;
- struct stat sbuf;
+ struct iatt sbuf;
} readlink_cbk;
/* mknod */
@@ -134,9 +134,9 @@ typedef struct {
fop_mknod_cbk_t fn;
int32_t op_ret, op_errno;
inode_t *inode;
- struct stat buf;
- struct stat preparent;
- struct stat postparent;
+ struct iatt buf;
+ struct iatt preparent;
+ struct iatt postparent;
} mknod_cbk;
/* mkdir */
@@ -149,9 +149,9 @@ typedef struct {
fop_mkdir_cbk_t fn;
int32_t op_ret, op_errno;
inode_t *inode;
- struct stat buf;
- struct stat preparent;
- struct stat postparent;
+ struct iatt buf;
+ struct iatt preparent;
+ struct iatt postparent;
} mkdir_cbk;
/* unlink */
@@ -162,8 +162,8 @@ typedef struct {
struct {
fop_unlink_cbk_t fn;
int32_t op_ret, op_errno;
- struct stat preparent;
- struct stat postparent;
+ struct iatt preparent;
+ struct iatt postparent;
} unlink_cbk;
/* rmdir */
@@ -174,8 +174,8 @@ typedef struct {
struct {
fop_rmdir_cbk_t fn;
int32_t op_ret, op_errno;
- struct stat preparent;
- struct stat postparent;
+ struct iatt preparent;
+ struct iatt postparent;
} rmdir_cbk;
/* symlink */
@@ -188,9 +188,9 @@ typedef struct {
fop_symlink_cbk_t fn;
int32_t op_ret, op_errno;
inode_t *inode;
- struct stat buf;
- struct stat preparent;
- struct stat postparent;
+ struct iatt buf;
+ struct iatt preparent;
+ struct iatt postparent;
} symlink_cbk;
/* rename */
@@ -202,11 +202,11 @@ typedef struct {
struct {
fop_rename_cbk_t fn;
int32_t op_ret, op_errno;
- struct stat buf;
- struct stat preoldparent;
- struct stat postoldparent;
- struct stat prenewparent;
- struct stat postnewparent;
+ struct iatt buf;
+ struct iatt preoldparent;
+ struct iatt postoldparent;
+ struct iatt prenewparent;
+ struct iatt postnewparent;
} rename_cbk;
/* link */
@@ -219,9 +219,9 @@ typedef struct {
fop_link_cbk_t fn;
int32_t op_ret, op_errno;
inode_t *inode;
- struct stat buf;
- struct stat preparent;
- struct stat postparent;
+ struct iatt buf;
+ struct iatt preparent;
+ struct iatt postparent;
} link_cbk;
/* create */
@@ -237,9 +237,9 @@ typedef struct {
int32_t op_ret, 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;
} create_cbk;
/* open */
@@ -269,7 +269,7 @@ typedef struct {
int32_t op_errno;
struct iovec *vector;
int32_t count;
- struct stat stbuf;
+ struct iatt stbuf;
struct iobref *iobref;
} readv_cbk;
@@ -285,8 +285,8 @@ typedef struct {
struct {
fop_writev_cbk_t fn;
int32_t op_ret, op_errno;
- struct stat prebuf;
- struct stat postbuf;
+ struct iatt prebuf;
+ struct iatt postbuf;
} writev_cbk;
/* flush */
@@ -308,8 +308,8 @@ typedef struct {
struct {
fop_fsync_cbk_t fn;
int32_t op_ret, op_errno;
- struct stat prebuf;
- struct stat postbuf;
+ struct iatt prebuf;
+ struct iatt postbuf;
} fsync_cbk;
/* opendir */
@@ -613,30 +613,30 @@ typedef struct {
struct {
fop_setattr_t fn;
loc_t loc;
- struct stat stbuf;
+ struct iatt stbuf;
int32_t valid;
} setattr;
struct {
fop_setattr_cbk_t fn;
int32_t op_ret;
int32_t op_errno;
- struct stat statpre;
- struct stat statpost;
+ struct iatt statpre;
+ struct iatt statpost;
} setattr_cbk;
/* fsetattr */
struct {
fop_fsetattr_t fn;
fd_t *fd;
- struct stat stbuf;
+ struct iatt stbuf;
int32_t valid;
} fsetattr;
struct {
fop_fsetattr_cbk_t fn;
int32_t op_ret;
int32_t op_errno;
- struct stat statpre;
- struct stat statpost;
+ struct iatt statpre;
+ struct iatt statpost;
} fsetattr_cbk;
} args;
@@ -654,9 +654,9 @@ fop_lookup_cbk_stub (call_frame_t *frame,
int32_t op_ret,
int32_t op_errno,
inode_t *inode,
- struct stat *buf,
+ struct iatt *buf,
dict_t *dict,
- struct stat *postparent);
+ struct iatt *postparent);
call_stub_t *
fop_stat_stub (call_frame_t *frame,
fop_stat_t fn,
@@ -666,7 +666,7 @@ fop_stat_cbk_stub (call_frame_t *frame,
fop_stat_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *buf);
+ struct iatt *buf);
call_stub_t *
fop_fstat_stub (call_frame_t *frame,
fop_fstat_t fn,
@@ -676,7 +676,7 @@ fop_fstat_cbk_stub (call_frame_t *frame,
fop_fstat_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *buf);
+ struct iatt *buf);
call_stub_t *
fop_truncate_stub (call_frame_t *frame,
@@ -689,8 +689,8 @@ fop_truncate_cbk_stub (call_frame_t *frame,
fop_truncate_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf);
+ struct iatt *prebuf,
+ struct iatt *postbuf);
call_stub_t *
fop_ftruncate_stub (call_frame_t *frame,
@@ -703,8 +703,8 @@ fop_ftruncate_cbk_stub (call_frame_t *frame,
fop_ftruncate_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf);
+ struct iatt *prebuf,
+ struct iatt *postbuf);
call_stub_t *
fop_access_stub (call_frame_t *frame,
@@ -730,7 +730,7 @@ fop_readlink_cbk_stub (call_frame_t *frame,
int32_t op_ret,
int32_t op_errno,
const char *path,
- struct stat *buf);
+ struct iatt *buf);
call_stub_t *
fop_mknod_stub (call_frame_t *frame,
@@ -745,9 +745,9 @@ fop_mknod_cbk_stub (call_frame_t *frame,
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);
call_stub_t *
fop_mkdir_stub (call_frame_t *frame,
@@ -761,9 +761,9 @@ fop_mkdir_cbk_stub (call_frame_t *frame,
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);
call_stub_t *
fop_unlink_stub (call_frame_t *frame,
@@ -775,8 +775,8 @@ fop_unlink_cbk_stub (call_frame_t *frame,
fop_unlink_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *preparent,
- struct stat *postparent);
+ struct iatt *preparent,
+ struct iatt *postparent);
call_stub_t *
fop_rmdir_stub (call_frame_t *frame,
@@ -788,8 +788,8 @@ fop_rmdir_cbk_stub (call_frame_t *frame,
fop_rmdir_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *preparent,
- struct stat *postparent);
+ struct iatt *preparent,
+ struct iatt *postparent);
call_stub_t *
fop_symlink_stub (call_frame_t *frame,
@@ -803,9 +803,9 @@ fop_symlink_cbk_stub (call_frame_t *frame,
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);
call_stub_t *
fop_rename_stub (call_frame_t *frame,
@@ -818,11 +818,11 @@ fop_rename_cbk_stub (call_frame_t *frame,
fop_rename_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *buf,
- struct stat *preoldparent,
- struct stat *postoldparent,
- struct stat *prenewparent,
- struct stat *postnewparent);
+ struct iatt *buf,
+ struct iatt *preoldparent,
+ struct iatt *postoldparent,
+ struct iatt *prenewparent,
+ struct iatt *postnewparent);
call_stub_t *
fop_link_stub (call_frame_t *frame,
@@ -836,9 +836,9 @@ fop_link_cbk_stub (call_frame_t *frame,
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);
call_stub_t *
fop_create_stub (call_frame_t *frame,
@@ -854,9 +854,9 @@ fop_create_cbk_stub (call_frame_t *frame,
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);
call_stub_t *
fop_open_stub (call_frame_t *frame,
@@ -887,7 +887,7 @@ fop_readv_cbk_stub (call_frame_t *frame,
int32_t op_errno,
struct iovec *vector,
int32_t count,
- struct stat *stbuf,
+ struct iatt *stbuf,
struct iobref *iobref);
call_stub_t *
@@ -904,8 +904,8 @@ fop_writev_cbk_stub (call_frame_t *frame,
fop_writev_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf);
+ struct iatt *prebuf,
+ struct iatt *postbuf);
call_stub_t *
fop_flush_stub (call_frame_t *frame,
@@ -929,8 +929,8 @@ fop_fsync_cbk_stub (call_frame_t *frame,
fop_fsync_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf);
+ struct iatt *prebuf,
+ struct iatt *postbuf);
call_stub_t *
fop_opendir_stub (call_frame_t *frame,
@@ -1221,7 +1221,7 @@ call_stub_t *
fop_setattr_stub (call_frame_t *frame,
fop_setattr_t fn,
loc_t *loc,
- struct stat *stbuf,
+ struct iatt *stbuf,
int32_t valid);
call_stub_t *
@@ -1229,14 +1229,14 @@ fop_setattr_cbk_stub (call_frame_t *frame,
fop_setattr_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *statpre,
- struct stat *statpost);
+ struct iatt *statpre,
+ struct iatt *statpost);
call_stub_t *
fop_fsetattr_stub (call_frame_t *frame,
fop_fsetattr_t fn,
fd_t *fd,
- struct stat *stbuf,
+ struct iatt *stbuf,
int32_t valid);
call_stub_t *
@@ -1244,8 +1244,8 @@ fop_fsetattr_cbk_stub (call_frame_t *frame,
fop_setattr_cbk_t fn,
int32_t op_ret,
int32_t op_errno,
- struct stat *statpre,
- struct stat *statpost);
+ struct iatt *statpre,
+ struct iatt *statpost);
void call_resume (call_stub_t *stub);
void call_stub_destroy (call_stub_t *stub);
diff --git a/libglusterfs/src/defaults.c b/libglusterfs/src/defaults.c
index 3aff664d7ea..ab88e024c3a 100644
--- a/libglusterfs/src/defaults.c
+++ b/libglusterfs/src/defaults.c
@@ -40,9 +40,9 @@ default_lookup_cbk (call_frame_t *frame,
int32_t op_ret,
int32_t op_errno,
inode_t *inode,
- struct stat *buf,
+ struct iatt *buf,
dict_t *dict,
- struct stat *postparent)
+ struct iatt *postparent)
{
STACK_UNWIND (frame,
op_ret,
@@ -83,7 +83,7 @@ default_stat_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *buf)
+ struct iatt *buf)
{
STACK_UNWIND (frame,
op_ret,
@@ -111,8 +111,8 @@ default_truncate_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf)
+ struct iatt *prebuf,
+ struct iatt *postbuf)
{
STACK_UNWIND (frame,
op_ret,
@@ -143,8 +143,8 @@ default_ftruncate_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf)
+ struct iatt *prebuf,
+ struct iatt *postbuf)
{
STACK_UNWIND (frame,
op_ret,
@@ -205,7 +205,7 @@ default_readlink_cbk (call_frame_t *frame,
int32_t op_ret,
int32_t op_errno,
const char *path,
- struct stat *buf)
+ struct iatt *buf)
{
STACK_UNWIND (frame,
op_ret,
@@ -238,9 +238,9 @@ default_mknod_cbk (call_frame_t *frame,
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 (frame,
op_ret,
@@ -274,9 +274,9 @@ default_mkdir_cbk (call_frame_t *frame,
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 (frame,
op_ret,
@@ -308,8 +308,8 @@ default_unlink_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *preparent,
- struct stat *postparent)
+ struct iatt *preparent,
+ struct iatt *postparent)
{
STACK_UNWIND (frame, op_ret, op_errno, preparent, postparent);
return 0;
@@ -334,8 +334,8 @@ default_rmdir_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *preparent,
- struct stat *postparent)
+ struct iatt *preparent,
+ struct iatt *postparent)
{
STACK_UNWIND (frame,
op_ret,
@@ -366,9 +366,9 @@ default_symlink_cbk (call_frame_t *frame,
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 (frame, op_ret, op_errno, inode, buf, preparent,
postparent);
@@ -396,11 +396,11 @@ default_rename_cbk (call_frame_t *frame,
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)
+ struct iatt *buf,
+ struct iatt *preoldparent,
+ struct iatt *postoldparent,
+ struct iatt *prenewparent,
+ struct iatt *postnewparent)
{
STACK_UNWIND (frame, op_ret, op_errno, buf, preoldparent, postoldparent,
prenewparent, postnewparent);
@@ -429,9 +429,9 @@ default_link_cbk (call_frame_t *frame,
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 (frame, op_ret, op_errno, inode, buf, preparent,
postparent);
@@ -461,9 +461,9 @@ default_create_cbk (call_frame_t *frame,
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)
{
STACK_UNWIND (frame, op_ret, op_errno, fd, inode, buf, preparent,
postparent);
@@ -522,7 +522,7 @@ default_readv_cbk (call_frame_t *frame,
int32_t op_errno,
struct iovec *vector,
int32_t count,
- struct stat *stbuf,
+ struct iatt *stbuf,
struct iobref *iobref)
{
STACK_UNWIND (frame,
@@ -559,8 +559,8 @@ default_writev_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf)
+ struct iatt *prebuf,
+ struct iatt *postbuf)
{
STACK_UNWIND (frame,
op_ret,
@@ -624,8 +624,8 @@ default_fsync_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf)
+ struct iatt *prebuf,
+ struct iatt *postbuf)
{
STACK_UNWIND (frame,
op_ret,
@@ -656,7 +656,7 @@ default_fstat_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *buf)
+ struct iatt *buf)
{
STACK_UNWIND (frame,
op_ret,
@@ -1477,8 +1477,8 @@ default_setattr_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *statpre,
- struct stat *statpost)
+ struct iatt *statpre,
+ struct iatt *statpost)
{
STACK_UNWIND (frame, op_ret, op_errno, statpre, statpost);
return 0;
@@ -1488,7 +1488,7 @@ int32_t
default_setattr (call_frame_t *frame,
xlator_t *this,
loc_t *loc,
- struct stat *stbuf,
+ struct iatt *stbuf,
int32_t valid)
{
STACK_WIND (frame,
@@ -1505,8 +1505,8 @@ default_fsetattr_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *statpre,
- struct stat *statpost)
+ struct iatt *statpre,
+ struct iatt *statpost)
{
STACK_UNWIND (frame, op_ret, op_errno, statpre, statpost);
return 0;
@@ -1516,7 +1516,7 @@ int32_t
default_fsetattr (call_frame_t *frame,
xlator_t *this,
fd_t *fd,
- struct stat *stbuf,
+ struct iatt *stbuf,
int32_t valid)
{
STACK_WIND (frame,
diff --git a/libglusterfs/src/defaults.h b/libglusterfs/src/defaults.h
index 904d05dab6c..daab88919a1 100644
--- a/libglusterfs/src/defaults.h
+++ b/libglusterfs/src/defaults.h
@@ -284,13 +284,13 @@ int32_t default_releasedir (xlator_t *this,
int32_t default_setattr (call_frame_t *frame,
xlator_t *this,
loc_t *loc,
- struct stat *stbuf,
+ struct iatt *stbuf,
int32_t valid);
int32_t default_fsetattr (call_frame_t *frame,
xlator_t *this,
fd_t *fd,
- struct stat *stbuf,
+ struct iatt *stbuf,
int32_t valid);
#endif /* _DEFAULTS_H */
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c
index 4febb9f59e4..b24d0089d21 100644
--- a/libglusterfs/src/fd.c
+++ b/libglusterfs/src/fd.c
@@ -399,7 +399,7 @@ fd_destroy (fd_t *fd)
if (!fd->_ctx)
goto out;
- if (S_ISDIR (fd->inode->st_mode)) {
+ if (IA_ISDIR (fd->inode->ia_type)) {
for (i = 0; i < fd->inode->table->xl->ctx->xl_count; i++) {
if (fd->_ctx[i].key) {
xl = (xlator_t *)(long)fd->_ctx[i].key;
diff --git a/libglusterfs/src/gf-dirent.c b/libglusterfs/src/gf-dirent.c
index 0a343694944..4a7220d9693 100644
--- a/libglusterfs/src/gf-dirent.c
+++ b/libglusterfs/src/gf-dirent.c
@@ -126,11 +126,11 @@ gf_dirent_serialize (gf_dirent_t *entries, char *buf, size_t buf_size)
entry_nb = (void *) (buf + size);
entry_nb->d_ino = hton64 (entry->d_ino);
- entry_nb->d_off = hton64 (entry->d_off);
+ entry_nb->d_off = hton64 (entry->d_off);
entry_nb->d_len = hton32 (entry->d_len);
entry_nb->d_type = hton32 (entry->d_type);
- gf_stat_from_stat (&entry_nb->d_stat, &entry->d_stat);
+ gf_stat_from_iatt (&entry_nb->d_stat, &entry->d_stat);
strcpy (entry_nb->d_name, entry->d_name);
}
@@ -175,7 +175,7 @@ gf_dirent_unserialize (gf_dirent_t *entries, const char *buf, size_t buf_size)
entry->d_len = ntoh32 (entry_nb->d_len);
entry->d_type = ntoh32 (entry_nb->d_type);
- gf_stat_to_stat (&entry_nb->d_stat, &entry->d_stat);
+ gf_stat_to_iatt (&entry_nb->d_stat, &entry->d_stat);
strcpy (entry->d_name, entry_nb->d_name);
diff --git a/libglusterfs/src/gf-dirent.h b/libglusterfs/src/gf-dirent.h
index 0e13c0325f0..433f46aaa21 100644
--- a/libglusterfs/src/gf-dirent.h
+++ b/libglusterfs/src/gf-dirent.h
@@ -26,13 +26,15 @@
#include "config.h"
#endif
+#include "iatt.h"
+
#define gf_dirent_size(name) (sizeof (gf_dirent_t) + strlen (name) + 1)
struct _dir_entry_t {
struct _dir_entry_t *next;
char *name;
char *link;
- struct stat buf;
+ struct iatt buf;
};
@@ -48,7 +50,7 @@ struct _gf_dirent_t {
uint64_t d_off;
uint32_t d_len;
uint32_t d_type;
- struct stat d_stat;
+ struct iatt d_stat;
char d_name[0];
};
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c
index da851ff1208..6e5d82fec7d 100644
--- a/libglusterfs/src/inode.c
+++ b/libglusterfs/src/inode.c
@@ -657,15 +657,15 @@ __inode_atticize (inode_t *inode)
uint64_t
-inode_gen_from_stat (struct stat *stbuf)
+inode_gen_from_stat (struct iatt *iatt)
{
- return (uint64_t) stbuf->st_dev;
+ return (uint64_t) iatt->ia_gen;
}
static inode_t *
__inode_link (inode_t *inode, inode_t *parent, const char *name,
- struct stat *stbuf)
+ struct iatt *iatt)
{
dentry_t *dentry = NULL;
dentry_t *old_dentry = NULL;
@@ -677,9 +677,9 @@ __inode_link (inode_t *inode, inode_t *parent, const char *name,
link_inode = inode;
- if (stbuf->st_ino == 1 && inode != table->root) {
+ if (iatt->ia_ino == 1 && inode != table->root) {
gf_log (table->name, GF_LOG_ERROR,
- "inode_link called with stbuf->st_ino = 1. "
+ "inode_link called with iatt->ia_ino = 1. "
"inode=%"PRId64"/%"PRId64 "parent=%"PRId64"/%"PRId64
" name=%s",
inode ? inode->generation:0 , inode ? inode->ino:0,
@@ -689,9 +689,9 @@ __inode_link (inode_t *inode, inode_t *parent, const char *name,
}
if (!__is_inode_hashed (inode)) {
- inode->ino = stbuf->st_ino;
- inode->st_mode = stbuf->st_mode;
- inode->generation = inode_gen_from_stat (stbuf);
+ inode->ino = iatt->ia_ino;
+ inode->ia_type = iatt->ia_type;
+ inode->generation = inode_gen_from_stat (iatt);
old_inode = __inode_search (table, inode->ino);
@@ -726,7 +726,7 @@ __inode_link (inode_t *inode, inode_t *parent, const char *name,
inode_t *
inode_link (inode_t *inode, inode_t *parent, const char *name,
- struct stat *stbuf)
+ struct iatt *iatt)
{
inode_table_t *table = NULL;
inode_t *linked_inode = NULL;
@@ -735,7 +735,7 @@ inode_link (inode_t *inode, inode_t *parent, const char *name,
pthread_mutex_lock (&table->lock);
{
- linked_inode = __inode_link (inode, parent, name, stbuf);
+ linked_inode = __inode_link (inode, parent, name, iatt);
if (linked_inode)
__inode_ref (linked_inode);
@@ -820,13 +820,13 @@ inode_unlink (inode_t *inode, inode_t *parent, const char *name)
int
inode_rename (inode_table_t *table, inode_t *srcdir, const char *srcname,
inode_t *dstdir, const char *dstname, inode_t *inode,
- struct stat *stbuf)
+ struct iatt *iatt)
{
table = inode->table;
pthread_mutex_lock (&table->lock);
{
- __inode_link (inode, dstdir, dstname, stbuf);
+ __inode_link (inode, dstdir, dstname, iatt);
__inode_unlink (inode, srcdir, srcname);
}
pthread_mutex_unlock (&table->lock);
@@ -1030,15 +1030,15 @@ static void
__inode_table_init_root (inode_table_t *table)
{
inode_t *root = NULL;
- struct stat stbuf = {0, };
+ struct iatt iatt = {0, };
root = __inode_create (table);
- stbuf.st_ino = 1;
- stbuf.st_mode = S_IFDIR|0755;
+ iatt.ia_ino = 1;
+ iatt.ia_type = IA_IFDIR;
table->root = root;
- __inode_link (root, NULL, NULL, &stbuf);
+ __inode_link (root, NULL, NULL, &iatt);
}
@@ -1360,8 +1360,8 @@ inode_dump (inode_t *inode, char *prefix)
gf_proc_dump_write(key, "%u", inode->ref);
gf_proc_dump_build_key(key, prefix, "ino");
gf_proc_dump_write(key, "%ld", inode->ino);
- gf_proc_dump_build_key(key, prefix, "st_mode");
- gf_proc_dump_write(key, "%d", inode->st_mode);
+ gf_proc_dump_build_key(key, prefix, "ia_type");
+ gf_proc_dump_write(key, "%d", inode->ia_type);
UNLOCK(&inode->lock);
if (!inode->_ctx)
goto out;
diff --git a/libglusterfs/src/inode.h b/libglusterfs/src/inode.h
index 520df7dbcbe..ef7866b0986 100644
--- a/libglusterfs/src/inode.h
+++ b/libglusterfs/src/inode.h
@@ -39,6 +39,7 @@ typedef struct _dentry dentry_t;
#include "list.h"
#include "xlator.h"
+#include "iatt.h"
struct _inode_table {
@@ -96,7 +97,7 @@ struct _inode {
uint32_t in_attic; /* whether @hash is linked with @inode_hash or @attic */
uint32_t ref; /* reference count on this inode */
ino_t ino; /* inode number in the storage (persistent) */
- mode_t st_mode; /* what kind of file */
+ ia_type_t ia_type; /* what kind of file */
struct list_head fd_list; /* list of open files on this inode */
struct list_head dentry_list; /* list of directory entries for this inode */
struct list_head hash; /* hash table pointers */
@@ -117,7 +118,7 @@ inode_search (inode_table_t *table, ino_t ino, const char *name);
inode_t *
inode_link (inode_t *inode, inode_t *parent,
- const char *name, struct stat *stbuf);
+ const char *name, struct iatt *stbuf);
void
inode_unlink (inode_t *inode, inode_t *parent, const char *name);
@@ -140,7 +141,7 @@ inode_forget (inode_t *inode, uint64_t nlookup);
int
inode_rename (inode_table_t *table, inode_t *olddir, const char *oldname,
inode_t *newdir, const char *newname,
- inode_t *inode, struct stat *stbuf);
+ inode_t *inode, struct iatt *stbuf);
inode_t *
inode_grep (inode_table_t *table, inode_t *parent, const char *name);
diff --git a/libglusterfs/src/logging.h b/libglusterfs/src/logging.h
index 44f73c9062f..1f0c4ac7dcd 100644
--- a/libglusterfs/src/logging.h
+++ b/libglusterfs/src/logging.h
@@ -27,46 +27,14 @@
#endif
#include <stdint.h>
-#include <stdio.h>
+#include <stdio.h>
#include <stdarg.h>
#define GF_PRI_FSBLK PRId64
-#define GF_PRI_BLKSIZE "ld"
-#if GF_LINUX_HOST_OS
-
-# if __WORDSIZE == 64
-# define GF_PRI_SIZET "lu"
-# define GF_PRI_NLINK "lu"
-# else
-# define GF_PRI_SIZET "u"
-# define GF_PRI_NLINK "u"
-# endif /* __WORDSIZE */
-
-#elif GF_DARWIN_HOST_OS
-
-/* Noticed that size_t and ino_t are different on OSX, need to fix the warnings */
-# define GF_PRI_SIZET "lu"
-# define GF_PRI_NLINK "u"
-
-# undef GF_PRI_FSBLK
-# define GF_PRI_FSBLK "u"
-
-# undef GF_PRI_BLKSIZE
-# define GF_PRI_BLKSIZE "u"
-
-# if __DARWIN_64_BIT_INO_T == 0
-# error '64 bit ino_t is must for GlusterFS to work, Compile with "CFLAGS=-D__DARWIN_64_BIT_INO_T"'
-# endif /* __DARWIN_64_BIT_INO_T */
-
-#else /* !LINUX && !DARWIN */
-
-/* BSD and Solaris : Change as per testing there.. */
-# define GF_PRI_SIZET "lu"
-# define GF_PRI_NLINK "u"
-
-#endif /* LINUX_OS */
-
-#define GF_PRI_DEV GF_PRI_FSBLK
+#define GF_PRI_BLKSIZE PRId32
+#define GF_PRI_SIZET PRId64
+#define GF_PRI_NLINK PRId32
+#define GF_PRI_DEV PRId64
typedef enum {
GF_LOG_NONE,
diff --git a/libglusterfs/src/protocol.h b/libglusterfs/src/protocol.h
index 3b5b3087f9f..829d3fa83db 100644
--- a/libglusterfs/src/protocol.h
+++ b/libglusterfs/src/protocol.h
@@ -34,6 +34,7 @@
#include <fcntl.h>
#include "byte-order.h"
+#include "iatt.h"
/* Any changes in the protocol structure or adding new '[f,m]ops' needs to
* bump the protocol version by "0.1"
@@ -101,6 +102,57 @@ gf_stat_from_stat (struct gf_stat *gf_stat, struct stat *stat)
}
+static inline void
+gf_stat_to_iatt (struct gf_stat *gf_stat, struct iatt *iatt)
+{
+ iatt->ia_ino = ntoh64 (gf_stat->ino);
+ iatt->ia_dev = ntoh64 (gf_stat->dev);
+ iatt->ia_type = ia_type_from_st_mode (ntoh32 (gf_stat->mode));
+ iatt->ia_prot = ia_prot_from_st_mode (ntoh32 (gf_stat->mode));
+ iatt->ia_nlink = ntoh32 (gf_stat->nlink);
+ iatt->ia_uid = ntoh32 (gf_stat->uid);
+ iatt->ia_gid = ntoh32 (gf_stat->gid);
+ iatt->ia_rdev = ntoh64 (gf_stat->rdev);
+ iatt->ia_size = ntoh64 (gf_stat->size);
+ iatt->ia_blksize = ntoh32 (gf_stat->blksize);
+ iatt->ia_blocks = ntoh64 (gf_stat->blocks);
+ iatt->ia_atime = ntoh32 (gf_stat->atime);
+ iatt->ia_atime_nsec = ntoh32 (gf_stat->atime_nsec);
+ iatt->ia_mtime = ntoh32 (gf_stat->mtime);
+ iatt->ia_mtime_nsec = ntoh32 (gf_stat->mtime_nsec);
+ iatt->ia_ctime = ntoh32 (gf_stat->ctime);
+ iatt->ia_ctime_nsec = ntoh32 (gf_stat->ctime_nsec);
+
+ iatt->ia_gen = ntoh64 (gf_stat->dev);
+}
+
+
+static inline void
+gf_stat_from_iatt (struct gf_stat *gf_stat, struct iatt *iatt)
+{
+ gf_stat->ino = hton64 (iatt->ia_ino);
+ gf_stat->dev = hton64 (iatt->ia_dev);
+ gf_stat->mode = hton32 (st_mode_from_ia (iatt->ia_prot,
+ iatt->ia_type));
+ gf_stat->nlink = hton32 (iatt->ia_nlink);
+ gf_stat->uid = hton32 (iatt->ia_uid);
+ gf_stat->gid = hton32 (iatt->ia_gid);
+ gf_stat->rdev = hton32 (iatt->ia_rdev);
+ gf_stat->size = hton64 (iatt->ia_size);
+ gf_stat->blksize = hton32 (iatt->ia_blksize);
+ gf_stat->blocks = hton64 (iatt->ia_blocks);
+ gf_stat->atime = hton32 (iatt->ia_atime);
+ gf_stat->atime_nsec = hton32 (iatt->ia_atime_nsec);
+ gf_stat->mtime = hton32 (iatt->ia_mtime);
+ gf_stat->mtime_nsec = hton32 (iatt->ia_mtime_nsec);
+ gf_stat->ctime = hton32 (iatt->ia_ctime);
+ gf_stat->ctime_nsec = hton32 (iatt->ia_ctime_nsec);
+
+ gf_stat->dev = hton64 (iatt->ia_gen);
+
+}
+
+
struct gf_statfs {
uint64_t bsize;
uint64_t frsize;
diff --git a/libglusterfs/src/syscall.c b/libglusterfs/src/syscall.c
index 5f2162302c0..e0d0b13fa3a 100644
--- a/libglusterfs/src/syscall.c
+++ b/libglusterfs/src/syscall.c
@@ -43,7 +43,7 @@ sys_stat (const char *path, struct stat *buf)
}
-int
+int
sys_fstat (int fd, struct stat *buf)
{
return fstat (fd, buf);
diff --git a/libglusterfs/src/syscall.h b/libglusterfs/src/syscall.h
index 245ba8c5a77..2bc29508b37 100644
--- a/libglusterfs/src/syscall.h
+++ b/libglusterfs/src/syscall.h
@@ -26,7 +26,7 @@ sys_lstat (const char *path, struct stat *buf);
int
sys_stat (const char *path, struct stat *buf);
-int
+int
sys_fstat (int fd, struct stat *buf);
DIR *
@@ -35,31 +35,31 @@ sys_opendir (const char *name);
struct dirent *
sys_readdir (DIR *dir);
-ssize_t
+ssize_t
sys_readlink (const char *path, char *buf, size_t bufsiz);
-int
+int
sys_closedir (DIR *dir);
int
sys_mknod (const char *pathname, mode_t mode, dev_t dev);
-int
+int
sys_mkdir (const char *pathname, mode_t mode);
-int
+int
sys_unlink (const char *pathname);
-int
+int
sys_rmdir (const char *pathname);
-int
+int
sys_symlink (const char *oldpath, const char *newpath);
int
sys_rename (const char *oldpath, const char *newpath);
-int
+int
sys_link (const char *oldpath, const char *newpath);
int
@@ -68,7 +68,7 @@ sys_chmod (const char *path, mode_t mode);
int
sys_fchmod (int fd, mode_t mode);
-int
+int
sys_chown (const char *path, uid_t owner, gid_t group);
int
@@ -77,13 +77,13 @@ sys_fchown (int fd, uid_t owner, gid_t group);
int
sys_lchown (const char *path, uid_t owner, gid_t group);
-int
+int
sys_truncate (const char *path, off_t length);
-int
+int
sys_ftruncate (int fd, off_t length);
-int
+int
sys_utimes (const char *filename, const struct timeval times[2]);
int
@@ -98,7 +98,7 @@ sys_writev (int fd, const struct iovec *iov, int iovcnt);
ssize_t
sys_read (int fd, void *buf, size_t count);
-ssize_t
+ssize_t
sys_write (int fd, const void *buf, size_t count);
off_t
@@ -107,42 +107,42 @@ sys_lseek (int fd, off_t offset, int whence);
int
sys_statvfs (const char *path, struct statvfs *buf);
-int
+int
sys_close (int fd);
-int
+int
sys_fsync (int fd);
-int
+int
sys_fdatasync (int fd);
-int
-sys_lsetxattr (const char *path, const char *name, const void *value,
- size_t size, int flags);
+int
+sys_lsetxattr (const char *path, const char *name, const void *value,
+ size_t size, int flags);
ssize_t
-sys_llistxattr (const char *path, char *list, size_t size);
+sys_llistxattr (const char *path, char *list, size_t size);
ssize_t
-sys_lgetxattr (const char *path, const char *name, void *value, size_t size);
+sys_lgetxattr (const char *path, const char *name, void *value, size_t size);
-ssize_t
-sys_fgetxattr (int filedes, const char *name, void *value, size_t size);
+ssize_t
+sys_fgetxattr (int filedes, const char *name, void *value, size_t size);
-int
-sys_fsetxattr (int filedes, const char *name, const void *value,
+int
+sys_fsetxattr (int filedes, const char *name, const void *value,
size_t size, int flags);
-ssize_t
-sys_flistxattr (int filedes, char *list, size_t size);
+ssize_t
+sys_flistxattr (int filedes, char *list, size_t size);
-int
+int
sys_lremovexattr (const char *path, const char *name);
-int
+int
sys_access (const char *pathname, int mode);
-int
+int
sys_ftruncate (int fd, off_t length);
#endif /* __SYSCALL_H__ */
diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h
index b6e10385512..4b9b3e9cebd 100644
--- a/libglusterfs/src/xlator.h
+++ b/libglusterfs/src/xlator.h
@@ -73,6 +73,7 @@ typedef int32_t (*event_notify_fn_t) (xlator_t *this, int32_t event, void *data,
#include "inode.h"
#include "fd.h"
#include "globals.h"
+#include "iatt.h"
struct _loc {
@@ -175,39 +176,39 @@ typedef int32_t (*fop_lookup_cbk_t) (call_frame_t *frame,
int32_t op_ret,
int32_t op_errno,
inode_t *inode,
- struct stat *buf,
+ struct iatt *buf,
dict_t *xattr,
- struct stat *postparent);
+ struct iatt *postparent);
typedef int32_t (*fop_stat_cbk_t) (call_frame_t *frame,
void *cookie,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *buf);
+ struct iatt *buf);
typedef int32_t (*fop_fstat_cbk_t) (call_frame_t *frame,
void *cookie,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *buf);
+ struct iatt *buf);
typedef int32_t (*fop_truncate_cbk_t) (call_frame_t *frame,
void *cookie,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf);
+ struct iatt *prebuf,
+ struct iatt *postbuf);
typedef int32_t (*fop_ftruncate_cbk_t) (call_frame_t *frame,
void *cookie,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf);
+ struct iatt *prebuf,
+ struct iatt *postbuf);
typedef int32_t (*fop_access_cbk_t) (call_frame_t *frame,
void *cookie,
@@ -221,7 +222,7 @@ typedef int32_t (*fop_readlink_cbk_t) (call_frame_t *frame,
int32_t op_ret,
int32_t op_errno,
const char *path,
- struct stat *buf);
+ struct iatt *buf);
typedef int32_t (*fop_mknod_cbk_t) (call_frame_t *frame,
void *cookie,
@@ -229,9 +230,9 @@ typedef int32_t (*fop_mknod_cbk_t) (call_frame_t *frame,
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);
typedef int32_t (*fop_mkdir_cbk_t) (call_frame_t *frame,
void *cookie,
@@ -239,25 +240,25 @@ typedef int32_t (*fop_mkdir_cbk_t) (call_frame_t *frame,
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);
typedef int32_t (*fop_unlink_cbk_t) (call_frame_t *frame,
void *cookie,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *preparent,
- struct stat *postparent);
+ struct iatt *preparent,
+ struct iatt *postparent);
typedef int32_t (*fop_rmdir_cbk_t) (call_frame_t *frame,
void *cookie,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *preparent,
- struct stat *postparent);
+ struct iatt *preparent,
+ struct iatt *postparent);
typedef int32_t (*fop_symlink_cbk_t) (call_frame_t *frame,
void *cookie,
@@ -265,20 +266,20 @@ typedef int32_t (*fop_symlink_cbk_t) (call_frame_t *frame,
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);
typedef int32_t (*fop_rename_cbk_t) (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);
+ struct iatt *buf,
+ struct iatt *preoldparent,
+ struct iatt *postoldparent,
+ struct iatt *prenewparent,
+ struct iatt *postnewparent);
typedef int32_t (*fop_link_cbk_t) (call_frame_t *frame,
void *cookie,
@@ -286,9 +287,9 @@ typedef int32_t (*fop_link_cbk_t) (call_frame_t *frame,
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);
typedef int32_t (*fop_create_cbk_t) (call_frame_t *frame,
void *cookie,
@@ -297,9 +298,9 @@ typedef int32_t (*fop_create_cbk_t) (call_frame_t *frame,
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);
typedef int32_t (*fop_open_cbk_t) (call_frame_t *frame,
void *cookie,
@@ -315,7 +316,7 @@ typedef int32_t (*fop_readv_cbk_t) (call_frame_t *frame,
int32_t op_errno,
struct iovec *vector,
int32_t count,
- struct stat *stbuf,
+ struct iatt *stbuf,
struct iobref *iobref);
typedef int32_t (*fop_writev_cbk_t) (call_frame_t *frame,
@@ -323,8 +324,8 @@ typedef int32_t (*fop_writev_cbk_t) (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf);
+ struct iatt *prebuf,
+ struct iatt *postbuf);
typedef int32_t (*fop_flush_cbk_t) (call_frame_t *frame,
void *cookie,
@@ -337,8 +338,8 @@ typedef int32_t (*fop_fsync_cbk_t) (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf);
+ struct iatt *prebuf,
+ struct iatt *postbuf);
typedef int32_t (*fop_opendir_cbk_t) (call_frame_t *frame,
void *cookie,
@@ -482,16 +483,16 @@ typedef int32_t (*fop_setattr_cbk_t) (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *preop_stbuf,
- struct stat *postop_stbuf);
+ struct iatt *preop_stbuf,
+ struct iatt *postop_stbuf);
typedef int32_t (*fop_fsetattr_cbk_t) (call_frame_t *frame,
void *cookie,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *preop_stbuf,
- struct stat *postop_stbuf);
+ struct iatt *preop_stbuf,
+ struct iatt *postop_stbuf);
typedef int32_t (*fop_lookup_t) (call_frame_t *frame,
xlator_t *this,
@@ -728,13 +729,13 @@ typedef int32_t (*fop_lock_fnotify_t) (call_frame_t *frame,
typedef int32_t (*fop_setattr_t) (call_frame_t *frame,
xlator_t *this,
loc_t *loc,
- struct stat *stbuf,
+ struct iatt *stbuf,
int32_t valid);
typedef int32_t (*fop_fsetattr_t) (call_frame_t *frame,
xlator_t *this,
fd_t *fd,
- struct stat *stbuf,
+ struct iatt *stbuf,
int32_t valid);
diff --git a/libglusterfsclient/src/libglusterfsclient-internals.h b/libglusterfsclient/src/libglusterfsclient-internals.h
index 200c25c2c13..ed62f397f60 100755
--- a/libglusterfsclient/src/libglusterfsclient-internals.h
+++ b/libglusterfsclient/src/libglusterfsclient-internals.h
@@ -89,7 +89,7 @@ typedef struct {
pthread_mutex_t lock;
uint32_t previous_lookup_time;
uint32_t previous_stat_time;
- struct stat stbuf;
+ struct iatt stbuf;
} libglusterfs_client_inode_ctx_t;
/* Our dirent cache is very simplistic when it comes to directory
@@ -265,7 +265,7 @@ libgf_client_path_lookup (loc_t *loc,
int32_t
libgf_client_lookup (libglusterfs_client_ctx_t *ctx,
loc_t *loc,
- struct stat *stbuf,
+ struct iatt *stbuf,
dict_t **dict,
dict_t *xattr_req);
@@ -290,9 +290,9 @@ struct vmp_entry {
#define LIBGF_INVALIDATE_STAT 0x2
int
libgf_is_iattr_cache_valid (libglusterfs_client_ctx_t *ctx, inode_t *inode,
- struct stat *sbuf, int flags);
+ struct iatt *sbuf, int flags);
int
-libgf_update_iattr_cache (inode_t *inode, int flags, struct stat *buf);
+libgf_update_iattr_cache (inode_t *inode, int flags, struct iatt *buf);
#endif
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index fc7dfe55451..bb587bee36c 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -212,7 +212,7 @@ libgf_alloc_fd_ctx (libglusterfs_client_ctx_t *ctx, fd_t *fd, char *vpath)
ctxaddr = (uint64_t) (long)fdctx;
if (fd->inode) {
- if (S_ISDIR (fd->inode->st_mode)) {
+ if (IA_ISDIR (fd->inode->ia_type)) {
fdctx->dcache = CALLOC (1, sizeof (struct direntcache));
if (fdctx->dcache)
INIT_LIST_HEAD (&fdctx->dcache->entries.list);
@@ -423,7 +423,7 @@ libgf_client_release (xlator_t *this,
{
libglusterfs_client_fd_ctx_t *fd_ctx = NULL;
fd_ctx = libgf_get_fd_ctx (fd);
- if (S_ISDIR (fd->inode->st_mode)) {
+ if (IA_ISDIR (fd->inode->ia_type)) {
libgf_dcache_invalidate (fd);
FREE (fd_ctx->dcache);
}
@@ -497,24 +497,24 @@ out:
int
libgf_transform_iattr (libglusterfs_client_ctx_t *libctx, inode_t *inode,
- struct stat *buf)
+ struct iatt *buf)
{
if ((!libctx) || (!buf) || (!inode))
return -1;
- buf->st_dev = libctx->fake_fsid;
+ buf->ia_dev = libctx->fake_fsid;
/* If the inode is root, the inode number must be 1 not the
* ino received from the file system.
*/
if ((inode->ino == 1) && (buf))
- buf->st_ino = 1;
+ buf->ia_ino = 1;
return 0;
}
int
-libgf_update_iattr_cache (inode_t *inode, int flags, struct stat *buf)
+libgf_update_iattr_cache (inode_t *inode, int flags, struct iatt *buf)
{
libglusterfs_client_inode_ctx_t *inode_ctx = NULL;
time_t current = 0;
@@ -601,7 +601,7 @@ libgf_invalidate_iattr_cache (inode_t *inode, int flags)
int
libgf_is_iattr_cache_valid (libglusterfs_client_ctx_t *ctx, inode_t *inode,
- struct stat *sbuf, int flags)
+ struct iatt *sbuf, int flags)
{
time_t current = 0;
time_t prev = 0;
@@ -683,7 +683,7 @@ libgf_client_releasedir (xlator_t *this,
{
libglusterfs_client_fd_ctx_t *fd_ctx = NULL;
fd_ctx = libgf_get_fd_ctx (fd);
- if (S_ISDIR (fd->inode->st_mode)) {
+ if (IA_ISDIR (fd->inode->ia_type)) {
libgf_dcache_invalidate (fd);
FREE (fd_ctx->dcache);
}
@@ -2079,9 +2079,9 @@ libgf_client_lookup_cbk (call_frame_t *frame,
int32_t op_ret,
int32_t op_errno,
inode_t *inode,
- struct stat *buf,
+ struct iatt *buf,
dict_t *dict,
- struct stat *postparent)
+ struct iatt *postparent)
{
libgf_client_local_t *local = frame->local;
libglusterfs_client_ctx_t *ctx = frame->root->state;
@@ -2091,7 +2091,7 @@ libgf_client_lookup_cbk (call_frame_t *frame,
inode_t *parent = NULL;
if (local->fop.lookup.loc->ino == 1) {
- buf->st_ino = 1;
+ buf->ia_ino = 1;
}
parent = local->fop.lookup.loc->parent;
@@ -2165,7 +2165,7 @@ out:
int32_t
libgf_client_lookup (libglusterfs_client_ctx_t *ctx,
loc_t *loc,
- struct stat *stbuf,
+ struct iatt *stbuf,
dict_t **dict,
dict_t *xattr_req)
{
@@ -2223,7 +2223,7 @@ out:
int
glusterfs_glh_get (glusterfs_handle_t handle, const char *path, void *buf,
- size_t size, struct stat *stbuf)
+ size_t size, struct stat *stbuf)
{
int32_t op_ret = -1;
loc_t loc = {0, };
@@ -2231,6 +2231,7 @@ glusterfs_glh_get (glusterfs_handle_t handle, const char *path, void *buf,
dict_t *dict = NULL;
dict_t *xattr_req = NULL;
char *name = NULL, *pathname = NULL;
+ struct iatt iatt = {0,};
GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, ctx, out);
GF_VALIDATE_ABSOLUTE_PATH_OR_GOTO (LIBGF_XL_NAME, path, out);
@@ -2285,8 +2286,9 @@ glusterfs_glh_get (glusterfs_handle_t handle, const char *path, void *buf,
}
}
- op_ret = libgf_client_lookup (ctx, &loc, stbuf, &dict, xattr_req);
- if (!op_ret && stbuf && (stbuf->st_size <= size) && dict && buf) {
+ op_ret = libgf_client_lookup (ctx, &loc, &iatt, &dict, xattr_req);
+ iatt_to_stat (&iatt, stbuf);
+ if (!op_ret && stbuf && (iatt.ia_size <= size) && dict && buf) {
data_t *mem_data = NULL;
void *mem = NULL;
@@ -2296,7 +2298,7 @@ glusterfs_glh_get (glusterfs_handle_t handle, const char *path, void *buf,
}
if (mem != NULL) {
- memcpy (buf, mem, stbuf->st_size);
+ memcpy (buf, mem, iatt.ia_size);
}
}
@@ -2350,9 +2352,9 @@ libgf_client_lookup_async_cbk (call_frame_t *frame,
int32_t op_ret,
int32_t op_errno,
inode_t *inode,
- struct stat *stbuf,
+ struct iatt *stbuf,
dict_t *dict,
- struct stat *postparent)
+ struct iatt *postparent)
{
libglusterfs_client_async_local_t *local = frame->local;
glusterfs_get_cbk_t lookup_cbk = local->fop.lookup_cbk.cbk;
@@ -2360,6 +2362,7 @@ libgf_client_lookup_async_cbk (call_frame_t *frame,
glusterfs_iobuf_t *iobuf = NULL;
dict_t *xattr_req = NULL;
inode_t *parent = NULL;
+ struct stat stat = {0,};
if (op_ret == 0) {
parent = local->fop.lookup_cbk.loc->parent;
@@ -2434,22 +2437,23 @@ out:
mem = data_to_ptr (mem_data);
}
- if (mem && stbuf->st_size <= local->fop.lookup_cbk.size) {
+ if (mem && stbuf->ia_size <= local->fop.lookup_cbk.size) {
iobuf = CALLOC (1, sizeof (*iobuf));
ERR_ABORT (iobuf);
vector = CALLOC (1, sizeof (*vector));
ERR_ABORT (vector);
vector->iov_base = mem;
- vector->iov_len = stbuf->st_size;
+ vector->iov_len = stbuf->ia_size;
iobuf->vector = vector;
iobuf->count = 1;
iobuf->dictref = dict_ref (dict);
}
}
-
- lookup_cbk (op_ret, op_errno, iobuf, stbuf, local->cbk_data);
+
+ iatt_to_stat (stbuf, &stat);
+ lookup_cbk (op_ret, op_errno, iobuf, &stat, local->cbk_data);
libgf_client_loc_wipe (local->fop.lookup_cbk.loc);
free (local->fop.lookup_cbk.loc);
@@ -2685,7 +2689,7 @@ __glusterfs_glh_getxattr (glusterfs_handle_t handle, const char *path,
if (whichop == LIBGF_DO_LGETXATTR)
goto do_getx;
- if (!S_ISLNK (loc.inode->st_mode))
+ if (!IA_ISLNK (loc.inode->ia_type))
goto do_getx;
libgf_client_loc_wipe (&loc);
@@ -2842,9 +2846,9 @@ libgf_client_create_cbk (call_frame_t *frame,
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)
{
libgf_client_local_t *local = frame->local;
@@ -3018,7 +3022,7 @@ glusterfs_glh_open (glusterfs_handle_t handle, const char *path, int flags,...)
* a network message through libgf_client_creat, and
* then receiving a EISDIR.
*/
- if (S_ISDIR (loc.inode->st_mode)) {
+ if (IA_ISDIR (loc.inode->ia_type)) {
errno = EISDIR;
op_ret = -1;
goto op_over;
@@ -3028,7 +3032,7 @@ glusterfs_glh_open (glusterfs_handle_t handle, const char *path, int flags,...)
va_end (ap);
op_ret = libgf_client_creat (ctx, &loc, fd, flags, mode);
} else {
- if (S_ISDIR (loc.inode->st_mode))
+ if (IA_ISDIR (loc.inode->ia_type))
op_ret = libgf_client_opendir (ctx, &loc, fd);
else
op_ret = libgf_client_open (ctx, &loc, fd, flags);
@@ -3042,7 +3046,7 @@ op_over:
}
vpath = NULL;
- if (S_ISDIR (loc.inode->st_mode)) {
+ if (IA_ISDIR (loc.inode->ia_type)) {
vpath = (char *)path;
}
@@ -3059,9 +3063,9 @@ op_over:
if ((flags & O_TRUNC) && (((flags & O_ACCMODE) == O_RDWR)
|| ((flags & O_ACCMODE) == O_WRONLY))) {
inode_ctx = libgf_get_inode_ctx (fd->inode);
- if (S_ISREG (inode_ctx->stbuf.st_mode)) {
- inode_ctx->stbuf.st_size = 0;
- inode_ctx->stbuf.st_blocks = 0;
+ if (IA_ISREG (inode_ctx->stbuf.ia_type)) {
+ inode_ctx->stbuf.ia_size = 0;
+ inode_ctx->stbuf.ia_blocks = 0;
}
}
@@ -3306,7 +3310,7 @@ __glusterfs_glh_setxattr (glusterfs_handle_t handle, const char *path,
if (whichop == LIBGF_DO_LSETXATTR)
goto do_setx;
- if (!S_ISLNK (loc.inode->st_mode))
+ if (!IA_ISLNK (loc.inode->ia_type))
goto do_setx;
libgf_client_loc_wipe (&loc);
@@ -3647,7 +3651,7 @@ libgf_client_readv_cbk (call_frame_t *frame,
int32_t op_errno,
struct iovec *vector,
int32_t count,
- struct stat *stbuf,
+ struct iatt *stbuf,
struct iobref *iobref)
{
libgf_client_local_t *local = frame->local;
@@ -3667,7 +3671,7 @@ libgf_client_iobuf_read (libglusterfs_client_ctx_t *ctx, fd_t *fd, void *buf,
int32_t op_ret = -1;
int count = 0;
libgf_client_local_t *local = NULL;
- struct stat *stbuf = NULL;
+ struct iatt *stbuf = NULL;
local = CALLOC (1, sizeof (*local));
ERR_ABORT (local);
@@ -3797,7 +3801,7 @@ libgf_client_iobuf_readv (libglusterfs_client_ctx_t *ctx, fd_t *fd,
int src_count = 0, dst_count = 0;
int len = 0, src_len = 0, dst_len = 0;
off_t src_offset = 0, dst_offset = 0;
- struct stat *stbuf = NULL;
+ struct iatt *stbuf = NULL;
dst = *idx;
dst_offset = *vec_offset;
@@ -3983,8 +3987,8 @@ libgf_client_writev_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf)
+ struct iatt *prebuf,
+ struct iatt *postbuf)
{
libgf_client_local_t *local = frame->local;
@@ -4460,7 +4464,7 @@ libglusterfs_readv_async_cbk (call_frame_t *frame,
int32_t op_errno,
struct iovec *vector,
int32_t count,
- struct stat *stbuf,
+ struct iatt *stbuf,
struct iobref *iobref)
{
glusterfs_iobuf_t *buf;
@@ -4582,8 +4586,8 @@ libglusterfs_writev_async_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *prebuf,
- struct stat *postbuf)
+ struct iatt *prebuf,
+ struct iatt *postbuf)
{
libglusterfs_client_async_local_t *local = frame->local;
fd_t *fd = NULL;
@@ -4717,13 +4721,13 @@ glusterfs_lseek (glusterfs_file_t fd, off_t offset, int whence)
char cache_valid = 0;
off_t end = 0;
loc_t loc = {0, };
- struct stat stbuf = {0, };
+ struct iatt stbuf = {0, };
cache_valid = libgf_is_iattr_cache_valid (ctx, __fd->inode,
&stbuf,
LIBGF_VALIDATE_STAT);
if (cache_valid) {
- end = stbuf.st_size;
+ end = stbuf.ia_size;
} else {
op_ret = libgf_client_loc_fill (&loc, ctx,
__fd->inode->ino, 0,
@@ -4746,7 +4750,7 @@ glusterfs_lseek (glusterfs_file_t fd, off_t offset, int whence)
goto out;
}
- end = stbuf.st_size;
+ end = stbuf.ia_size;
}
__offset = end + offset;
@@ -4780,7 +4784,7 @@ libgf_client_stat_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *buf)
+ struct iatt *buf)
{
libgf_client_local_t *local = frame->local;
@@ -4797,12 +4801,12 @@ libgf_client_stat_cbk (call_frame_t *frame,
int32_t
libgf_client_stat (libglusterfs_client_ctx_t *ctx,
loc_t *loc,
- struct stat *stbuf)
+ struct iatt *stbuf)
{
call_stub_t *stub = NULL;
int32_t op_ret = 0;
libgf_client_local_t *local = NULL;
- struct stat cachedbuf = {0, };
+ struct iatt cachedbuf = {0, };
if (libgf_is_iattr_cache_valid (ctx, loc->inode, &cachedbuf,
LIBGF_VALIDATE_STAT)) {
@@ -4876,7 +4880,7 @@ out:
int
__glusterfs_stat (glusterfs_handle_t handle, const char *path,
- struct stat *buf, int whichstat)
+ struct stat *buf, int whichstat)
{
int32_t op_ret = -1;
loc_t loc = {0, };
@@ -4926,7 +4930,7 @@ __glusterfs_stat (glusterfs_handle_t handle, const char *path,
if (whichstat & LIBGF_DO_LSTAT)
goto lstat_fop;
- if (!S_ISLNK (loc.inode->st_mode))
+ if (!IA_ISLNK (loc.inode->ia_type))
goto lstat_fop;
op_ret = libgf_realpath_loc_fill (ctx, (char *)loc.path, &targetloc);
@@ -4937,7 +4941,9 @@ __glusterfs_stat (glusterfs_handle_t handle, const char *path,
lstat_fop:
if (!op_ret) {
- op_ret = libgf_client_stat (ctx, real_loc, buf);
+ struct iatt iatt;
+ op_ret = libgf_client_stat (ctx, real_loc, &iatt);
+ iatt_to_stat (&iatt, buf);
}
out:
@@ -4953,7 +4959,7 @@ out:
int
glusterfs_glh_stat (glusterfs_handle_t handle, const char *path,
- struct stat *buf)
+ struct stat *buf)
{
return __glusterfs_stat (handle, path, buf, LIBGF_DO_STAT);
}
@@ -5017,7 +5023,7 @@ libgf_client_fstat_cbk (call_frame_t *frame,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
- struct stat *buf)
+ struct iatt *buf)
{
libgf_client_local_t *local = frame->local;
@@ -5040,7 +5046,7 @@ libgf_client_fstat (libglusterfs_client_ctx_t *ctx,
call_stub_t *stub = NULL;
int32_t op_ret = 0;
libgf_client_local_t *local = NULL;
- struct stat cachedbuf = {0, };
+ struct iatt cachedbuf = {0, };
if (libgf_is_iattr_cache_valid (ctx, fd->inode, &cachedbuf,
LIBGF_VALIDATE_STAT)) {
@@ -5061,7 +5067,7 @@ libgf_client_fstat (libglusterfs_client_ctx_t *ctx,
libgf_transform_iattr (ctx, fd->inode,
&stub->args.fstat_cbk.buf);
if (buf)
- *buf = stub->args.fstat_cbk.buf;
+ iatt_to_stat (&stub->args.fstat_cbk.buf, buf);
libgf_update_iattr_cache (fd->inode, LIBGF_UPDATE_STAT,
&stub->args.fstat_cbk.buf);
}
@@ -5103,9 +5109,9 @@ libgf_client_mkdir_cbk (call_frame_t *frame,
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)
{
libgf_client_local_t *local = frame->local;
@@ -5237,8 +5243,8 @@ out:
static int32_t
libgf_client_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)
{
libgf_client_local_t *local = frame->local;
@@ -5351,7 +5357,7 @@ out:
int
libgf_client_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)
{
libgf_client_local_t *local = frame->local;
@@ -5365,7 +5371,7 @@ libgf_client_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
libgf_client_setattr (libglusterfs_client_ctx_t *ctx, loc_t * loc,
- struct stat *stbuf, int32_t valid)
+ struct iatt *stbuf, int32_t valid)
{
int op_ret = -1;
libgf_client_local_t *local = NULL;
@@ -5397,13 +5403,13 @@ glusterfs_glh_chmod (glusterfs_handle_t handle, const char *path, mode_t mode)
libglusterfs_client_ctx_t *ctx = handle;
loc_t loc = {0, };
char *name = NULL;
- struct stat stbuf = {0,};
+ struct iatt stbuf = {0,};
int32_t valid = 0;
GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, ctx, out);
GF_VALIDATE_ABSOLUTE_PATH_OR_GOTO (LIBGF_XL_NAME, path, out);
- stbuf.st_mode = mode;
+ stbuf.ia_prot = ia_prot_from_st_mode (mode);
valid |= GF_SET_ATTR_MODE;
loc.path = strdup (path);
@@ -5470,15 +5476,15 @@ __glusterfs_chown (glusterfs_handle_t handle, const char *path, uid_t owner,
char *name = NULL;
loc_t *oploc = NULL;
loc_t targetloc = {0, };
- struct stat stbuf = {0,};
+ struct iatt stbuf = {0,};
int32_t valid = 0;
GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, ctx, out);
GF_VALIDATE_ABSOLUTE_PATH_OR_GOTO (LIBGF_XL_NAME, path, out);
gf_log (LIBGF_XL_NAME, GF_LOG_DEBUG, "path %s, op %d", path, whichop);
- stbuf.st_uid = owner;
- stbuf.st_gid = group;
+ stbuf.ia_uid = owner;
+ stbuf.ia_gid = group;
valid |= (GF_SET_ATTR_UID | GF_SET_ATTR_GID);
loc.path = strdup (path);
@@ -5503,7 +5509,7 @@ __glusterfs_chown (glusterfs_handle_t handle, const char *path, uid_t owner,
if (whichop == LIBGF_DO_LCHOWN)
goto do_lchown;
- if (!S_ISLNK (loc.inode->st_mode))
+ if (!IA_ISLNK (loc.inode->ia_type))
goto do_lchown;
op_ret = libgf_realpath_loc_fill (ctx, (char *)loc.path, &targetloc);
@@ -5612,7 +5618,7 @@ glusterfs_glh_opendir (glusterfs_handle_t handle, const char *path)
goto out;
}
- if (!S_ISDIR (loc.inode->st_mode) && !S_ISLNK (loc.inode->st_mode)) {
+ if (!IA_ISDIR (loc.inode->ia_type) && !IA_ISLNK (loc.inode->ia_type)) {
errno = ENOTDIR;
op_ret = -1;
goto out;
@@ -5697,7 +5703,7 @@ out:
int
libgf_client_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)
{
libgf_client_local_t *local = frame->local;
@@ -5711,7 +5717,7 @@ libgf_client_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
libgf_client_fsetattr (libglusterfs_client_ctx_t *ctx, fd_t *fd,
- struct stat *stbuf, int32_t valid)
+ struct iatt *stbuf, int32_t valid)
{
int op_ret = -1;
libgf_client_local_t *local = NULL;
@@ -5740,7 +5746,7 @@ glusterfs_fchmod (glusterfs_file_t fd, mode_t mode)
{
libglusterfs_client_fd_ctx_t *fdctx = NULL;
int op_ret = -1;
- struct stat stbuf = {0,};
+ struct iatt stbuf = {0,};
int32_t valid = 0;
GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, fd, out);
@@ -5752,7 +5758,7 @@ glusterfs_fchmod (glusterfs_file_t fd, mode_t mode)
goto out;
}
- stbuf.st_mode = mode;
+ stbuf.ia_prot = ia_prot_from_st_mode (mode);
valid |= GF_SET_ATTR_MODE;
op_ret = libgf_client_fsetattr (fdctx->ctx, fd, &stbuf, valid);
@@ -5766,7 +5772,7 @@ glusterfs_fchown (glusterfs_file_t fd, uid_t uid, gid_t gid)
{
int op_ret = -1;
libglusterfs_client_fd_ctx_t *fdctx = NULL;
- struct stat stbuf = {0,};
+ struct iatt stbuf = {0,};
int32_t valid = 0;
GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, fd, out);
@@ -5777,8 +5783,8 @@ glusterfs_fchown (glusterfs_file_t fd, uid_t uid, gid_t gid)
errno = EBADF;
goto out;
}
- stbuf.st_uid = uid;
- stbuf.st_gid = gid;
+ stbuf.ia_uid = uid;
+ stbuf.ia_gid = gid;
valid |= (GF_SET_ATTR_UID | GF_SET_ATTR_GID);
@@ -5790,8 +5796,8 @@ out:
int
libgf_client_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *xlator,
- 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)
{
libgf_client_local_t *local = frame->local;
@@ -5846,7 +5852,7 @@ out:
int
libgf_client_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *xlator
,int32_t op_ret, int32_t op_errno,
- struct stat *prebuf, struct stat *postbuf)
+ struct iatt *prebuf, struct iatt *postbuf)
{
libgf_client_local_t *local = frame->local;
@@ -5895,7 +5901,7 @@ libgf_client_ftruncate (libglusterfs_client_ctx_t *ctx, fd_t *fd,
pthread_mutex_lock (&fdctx->lock);
{
- fdctx->offset = stub->args.ftruncate_cbk.postbuf.st_size;
+ fdctx->offset = stub->args.ftruncate_cbk.postbuf.ia_size;
}
pthread_mutex_unlock (&fdctx->lock);
@@ -5928,8 +5934,8 @@ out:
int
libgf_client_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)
+ inode_t *inode, struct iatt *buf,
+ struct iatt *preparent, struct iatt *postparent)
{
libgf_client_local_t *local = frame->local;
@@ -5949,7 +5955,7 @@ libgf_client_link (libglusterfs_client_ctx_t *ctx, loc_t *old, loc_t *new)
libgf_client_local_t *local = NULL;
int op_ret = -1;
inode_t *inode = NULL;
- struct stat *sbuf = NULL;
+ struct iatt *sbuf = NULL;
LIBGF_CLIENT_FOP (ctx, stub, link, local, old, new);
@@ -6011,7 +6017,7 @@ glusterfs_glh_link (glusterfs_handle_t handle, const char *oldpath,
goto out;
}
- if (S_ISDIR (old.inode->st_mode)) {
+ if (IA_ISDIR (old.inode->ia_type)) {
errno = EPERM;
op_ret = -1;
goto out;
@@ -6301,9 +6307,9 @@ out:
int32_t
libgf_client_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)
{
libgf_client_local_t *local = frame->local;
@@ -6466,17 +6472,18 @@ glusterfs_glh_utimes (glusterfs_handle_t handle, const char *path,
loc_t loc = {0, };
libglusterfs_client_ctx_t *ctx = handle;
char *name = NULL;
- struct stat stbuf = {0,};
+ struct iatt stbuf = {0,};
int32_t valid = 0;
GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, ctx, out);
GF_VALIDATE_ABSOLUTE_PATH_OR_GOTO (LIBGF_XL_NAME, path, out);
gf_log (LIBGF_XL_NAME, GF_LOG_DEBUG, "path %s", path);
- stbuf.st_atime = times[0].tv_sec;
- ST_ATIM_NSEC_SET (&stbuf, (times[0].tv_usec * 1000));
- stbuf.st_mtime = times[1].tv_sec;
- ST_MTIM_NSEC_SET (&stbuf, (times[1].tv_usec * 1000));
+ stbuf.ia_atime = times[0].tv_sec;
+ stbuf.ia_atime_nsec = times[0].tv_usec * 1000;
+ stbuf.ia_mtime = times[1].tv_sec;
+ stbuf.ia_mtime_nsec = times[1].tv_usec * 1000;
+
valid |= (GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME);
loc.path = strdup (path);
@@ -6541,7 +6548,7 @@ glusterfs_glh_utime (glusterfs_handle_t handle, const char *path,
loc_t loc = {0, };
libglusterfs_client_ctx_t *ctx = handle;
char *name = NULL;
- struct stat stbuf = {0,};
+ struct iatt stbuf = {0,};
int32_t valid = 0;
GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, ctx, out);
@@ -6549,11 +6556,11 @@ glusterfs_glh_utime (glusterfs_handle_t handle, const char *path,
gf_log (LIBGF_XL_NAME, GF_LOG_DEBUG, "path %s", path);
if (buf) {
- stbuf.st_atime = buf->actime;
- ST_ATIM_NSEC_SET (&stbuf, 0);
+ stbuf.ia_atime = buf->actime;
+ stbuf.ia_atime_nsec = 0;
- stbuf.st_mtime = buf->modtime;
- ST_MTIM_NSEC_SET (&stbuf, 0);
+ stbuf.ia_mtime = buf->modtime;
+ stbuf.ia_mtime_nsec = 0;
}
valid |= (GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME);
@@ -6616,8 +6623,8 @@ out:
static int32_t
libgf_client_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)
+ inode_t *inode, struct iatt *buf,
+ struct iatt *preparent, struct iatt *postparent)
{
libgf_client_local_t *local = frame->local;
@@ -6819,7 +6826,7 @@ out:
int32_t
libgf_client_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)
+ struct iatt *preparent, struct iatt *postparent)
{
libgf_client_local_t *local = frame->local;
@@ -6925,8 +6932,8 @@ out:
static int32_t
libgf_client_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)
+ inode_t *inode, struct iatt *buf,
+ struct iatt *preparent, struct iatt *postparent)
{
libgf_client_local_t *local = frame->local;
@@ -7066,7 +7073,7 @@ out:
int32_t
libgf_client_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
- const char *path, struct stat *sbuf)
+ const char *path, struct iatt *sbuf)
{
libgf_client_local_t *local = frame->local;
@@ -7454,7 +7461,7 @@ glusterfs_glh_remove (glusterfs_handle_t handle, const char *path)
if (op_ret == -1)
goto out;
- if (S_ISDIR (loc.inode->st_mode))
+ if (IA_ISDIR (loc.inode->ia_type))
op_ret = libgf_client_rmdir (ctx, &loc);
else
op_ret = libgf_client_unlink (ctx, &loc);
@@ -8003,7 +8010,7 @@ unlock:
int32_t
libgf_client_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)
+ struct iatt *prebuf, struct iatt *postbuf)
{
libgf_client_local_t *local = frame->local;
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c
index 98cda1e809f..065221e1d74 100644
--- a/xlators/cluster/afr/src/afr-dir-read.c
+++ b/xlators/cluster/afr/src/afr-dir-read.c
@@ -153,7 +153,7 @@ out:
sh->need_entry_self_heal = _gf_true;
sh->forced_merge = _gf_true;
- sh->mode = local->fd->inode->st_mode;
+ sh->type = local->fd->inode->ia_type;
sh->background = _gf_false;
sh->unwind = afr_examine_dir_sh_unwind;
@@ -560,9 +560,9 @@ afr_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
inum = afr_itransform (entry->d_ino, priv->child_count,
child_index);
entry->d_ino = inum;
- inum = afr_itransform (entry->d_stat.st_ino,
+ inum = afr_itransform (entry->d_stat.ia_ino,
priv->child_count, child_index);
- entry->d_stat.st_ino = inum;
+ entry->d_stat.ia_ino = inum;
if ((local->fd->inode == local->fd->inode->table->root)
&& !strcmp (entry->d_name, GF_REPLICATE_TRASH_DIR)) {
diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c
index 8a6529bfb97..14d3e28c451 100644
--- a/xlators/cluster/afr/src/afr-dir-write.c
+++ b/xlators/cluster/afr/src/afr-dir-write.c
@@ -79,7 +79,7 @@ afr_create_unwind (call_frame_t *frame, xlator_t *this)
call_frame_t *main_frame = NULL;
afr_private_t * priv = NULL;
afr_local_t *local = NULL;
- struct stat *unwind_buf = NULL;
+ struct iatt *unwind_buf = NULL;
priv = this->private;
local = frame->local;
@@ -94,17 +94,17 @@ afr_create_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- if (local->cont.create.read_child_buf.st_ino) {
+ if (local->cont.create.read_child_buf.ia_ino) {
unwind_buf = &local->cont.create.read_child_buf;
} else {
unwind_buf = &local->cont.create.buf;
}
- unwind_buf->st_ino = local->cont.create.ino;
- unwind_buf->st_dev = local->cont.create.gen;
+ unwind_buf->ia_ino = local->cont.create.ino;
+ unwind_buf->ia_gen = local->cont.create.gen;
- local->cont.create.preparent.st_ino = local->cont.create.parent_ino;
- local->cont.create.postparent.st_ino = local->cont.create.parent_ino;
+ local->cont.create.preparent.ia_ino = local->cont.create.parent_ino;
+ local->cont.create.postparent.ia_ino = local->cont.create.parent_ino;
AFR_STACK_UNWIND (create, main_frame,
local->op_ret, local->op_errno,
@@ -121,8 +121,8 @@ afr_create_unwind (call_frame_t *frame, xlator_t *this)
int
afr_create_wind_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)
+ fd_t *fd, inode_t *inode, struct iatt *buf,
+ struct iatt *preparent, struct iatt *postparent)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -176,10 +176,10 @@ afr_create_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->cont.create.buf = *buf;
local->cont.create.ino =
- afr_itransform (buf->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
child_index);
- local->cont.create.gen = buf->st_dev;
+ local->cont.create.gen = buf->ia_gen;
if (priv->read_child >= 0) {
afr_set_read_child (this, inode,
@@ -192,10 +192,10 @@ afr_create_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (child_index == local->first_up_child) {
local->cont.create.ino =
- afr_itransform (buf->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
local->first_up_child);
- local->cont.create.gen = buf->st_dev;
+ local->cont.create.gen = buf->ia_gen;
}
if (child_index == local->read_child_index) {
@@ -365,7 +365,7 @@ afr_mknod_unwind (call_frame_t *frame, xlator_t *this)
call_frame_t *main_frame = NULL;
afr_local_t *local = NULL;
- struct stat *unwind_buf = NULL;
+ struct iatt *unwind_buf = NULL;
local = frame->local;
@@ -379,17 +379,17 @@ afr_mknod_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- if (local->cont.mknod.read_child_buf.st_ino) {
+ if (local->cont.mknod.read_child_buf.ia_ino) {
unwind_buf = &local->cont.mknod.read_child_buf;
} else {
unwind_buf = &local->cont.mknod.buf;
}
- unwind_buf->st_ino = local->cont.mknod.ino;
- unwind_buf->st_dev = local->cont.mknod.gen;
+ unwind_buf->ia_ino = local->cont.mknod.ino;
+ unwind_buf->ia_gen = local->cont.mknod.gen;
- local->cont.mknod.preparent.st_ino = local->cont.mknod.parent_ino;
- local->cont.mknod.postparent.st_ino = local->cont.mknod.parent_ino;
+ local->cont.mknod.preparent.ia_ino = local->cont.mknod.parent_ino;
+ local->cont.mknod.postparent.ia_ino = local->cont.mknod.parent_ino;
AFR_STACK_UNWIND (mknod, main_frame,
local->op_ret, local->op_errno,
@@ -405,8 +405,8 @@ afr_mknod_unwind (call_frame_t *frame, xlator_t *this)
int
afr_mknod_wind_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)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -430,10 +430,10 @@ afr_mknod_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (local->success_count == 0){
local->cont.mknod.buf = *buf;
local->cont.mknod.ino =
- afr_itransform (buf->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
child_index);
- local->cont.mknod.gen = buf->st_dev;
+ local->cont.mknod.gen = buf->ia_gen;
if (priv->read_child >= 0) {
afr_set_read_child (this, inode,
@@ -446,10 +446,10 @@ afr_mknod_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (child_index == local->first_up_child) {
local->cont.mknod.ino =
- afr_itransform (buf->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
local->first_up_child);
- local->cont.mknod.gen = buf->st_dev;
+ local->cont.mknod.gen = buf->ia_gen;
}
if (child_index == local->read_child_index) {
@@ -615,7 +615,7 @@ afr_mkdir_unwind (call_frame_t *frame, xlator_t *this)
call_frame_t *main_frame = NULL;
afr_local_t *local = NULL;
- struct stat *unwind_buf = NULL;
+ struct iatt *unwind_buf = NULL;
local = frame->local;
@@ -629,17 +629,17 @@ afr_mkdir_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- if (local->cont.mkdir.read_child_buf.st_ino) {
+ if (local->cont.mkdir.read_child_buf.ia_ino) {
unwind_buf = &local->cont.mkdir.read_child_buf;
} else {
unwind_buf = &local->cont.mkdir.buf;
}
- unwind_buf->st_ino = local->cont.mkdir.ino;
- unwind_buf->st_dev = local->cont.mkdir.gen;
+ unwind_buf->ia_ino = local->cont.mkdir.ino;
+ unwind_buf->ia_gen = local->cont.mkdir.gen;
- local->cont.mkdir.preparent.st_ino = local->cont.mkdir.parent_ino;
- local->cont.mkdir.postparent.st_ino = local->cont.mkdir.parent_ino;
+ local->cont.mkdir.preparent.ia_ino = local->cont.mkdir.parent_ino;
+ local->cont.mkdir.postparent.ia_ino = local->cont.mkdir.parent_ino;
AFR_STACK_UNWIND (mkdir, main_frame,
local->op_ret, local->op_errno,
@@ -655,8 +655,8 @@ afr_mkdir_unwind (call_frame_t *frame, xlator_t *this)
int
afr_mkdir_wind_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)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -681,10 +681,10 @@ afr_mkdir_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->cont.mkdir.buf = *buf;
local->cont.mkdir.ino =
- afr_itransform (buf->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
child_index);
- local->cont.mkdir.gen = buf->st_dev;
+ local->cont.mkdir.gen = buf->ia_gen;
if (priv->read_child >= 0) {
afr_set_read_child (this, inode,
@@ -697,10 +697,10 @@ afr_mkdir_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (child_index == local->first_up_child) {
local->cont.mkdir.ino =
- afr_itransform (buf->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
local->first_up_child);
- local->cont.mkdir.gen = buf->st_dev;
+ local->cont.mkdir.gen = buf->ia_gen;
}
if (child_index == local->read_child_index) {
@@ -867,7 +867,7 @@ afr_link_unwind (call_frame_t *frame, xlator_t *this)
call_frame_t *main_frame = NULL;
afr_local_t *local = NULL;
- struct stat *unwind_buf = NULL;
+ struct iatt *unwind_buf = NULL;
local = frame->local;
@@ -881,16 +881,16 @@ afr_link_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- if (local->cont.link.read_child_buf.st_ino) {
+ if (local->cont.link.read_child_buf.ia_ino) {
unwind_buf = &local->cont.link.read_child_buf;
} else {
unwind_buf = &local->cont.link.buf;
}
- unwind_buf->st_ino = local->cont.link.ino;
+ unwind_buf->ia_ino = local->cont.link.ino;
- local->cont.link.preparent.st_ino = local->cont.link.parent_ino;
- local->cont.link.postparent.st_ino = local->cont.link.parent_ino;
+ local->cont.link.preparent.ia_ino = local->cont.link.parent_ino;
+ local->cont.link.postparent.ia_ino = local->cont.link.parent_ino;
AFR_STACK_UNWIND (link, main_frame,
local->op_ret, local->op_errno,
@@ -906,8 +906,8 @@ afr_link_unwind (call_frame_t *frame, xlator_t *this)
int
afr_link_wind_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)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -1104,7 +1104,7 @@ afr_symlink_unwind (call_frame_t *frame, xlator_t *this)
call_frame_t *main_frame = NULL;
afr_local_t *local = NULL;
- struct stat *unwind_buf = NULL;
+ struct iatt *unwind_buf = NULL;
local = frame->local;
@@ -1118,17 +1118,17 @@ afr_symlink_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- if (local->cont.symlink.read_child_buf.st_ino) {
+ if (local->cont.symlink.read_child_buf.ia_ino) {
unwind_buf = &local->cont.symlink.read_child_buf;
} else {
unwind_buf = &local->cont.symlink.buf;
}
- unwind_buf->st_ino = local->cont.symlink.ino;
- unwind_buf->st_dev = local->cont.symlink.gen;
+ unwind_buf->ia_ino = local->cont.symlink.ino;
+ unwind_buf->ia_gen = local->cont.symlink.gen;
- local->cont.symlink.preparent.st_ino = local->cont.symlink.parent_ino;
- local->cont.symlink.postparent.st_ino = local->cont.symlink.parent_ino;
+ local->cont.symlink.preparent.ia_ino = local->cont.symlink.parent_ino;
+ local->cont.symlink.postparent.ia_ino = local->cont.symlink.parent_ino;
AFR_STACK_UNWIND (symlink, main_frame,
local->op_ret, local->op_errno,
@@ -1144,8 +1144,8 @@ afr_symlink_unwind (call_frame_t *frame, xlator_t *this)
int
afr_symlink_wind_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)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -1169,9 +1169,9 @@ afr_symlink_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (local->success_count == 0) {
local->cont.symlink.buf = *buf;
local->cont.symlink.ino =
- afr_itransform (buf->st_ino, priv->child_count,
+ afr_itransform (buf->ia_ino, priv->child_count,
child_index);
- local->cont.symlink.gen = buf->st_dev;
+ local->cont.symlink.gen = buf->ia_gen;
if (priv->read_child >= 0) {
afr_set_read_child (this, inode,
@@ -1184,10 +1184,10 @@ afr_symlink_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (child_index == local->first_up_child) {
local->cont.symlink.ino =
- afr_itransform (buf->st_ino,
+ afr_itransform (buf->ia_ino,
priv->child_count,
local->first_up_child);
- local->cont.symlink.gen = buf->st_dev;
+ local->cont.symlink.gen = buf->ia_gen;
}
if (child_index == local->read_child_index) {
@@ -1353,7 +1353,7 @@ afr_rename_unwind (call_frame_t *frame, xlator_t *this)
call_frame_t *main_frame = NULL;
afr_local_t *local = NULL;
- struct stat *unwind_buf = NULL;
+ struct iatt *unwind_buf = NULL;
local = frame->local;
@@ -1367,18 +1367,18 @@ afr_rename_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- if (local->cont.rename.read_child_buf.st_ino) {
+ if (local->cont.rename.read_child_buf.ia_ino) {
unwind_buf = &local->cont.rename.read_child_buf;
} else {
unwind_buf = &local->cont.rename.buf;
}
- unwind_buf->st_ino = local->cont.rename.ino;
+ unwind_buf->ia_ino = local->cont.rename.ino;
- local->cont.rename.preoldparent.st_ino = local->cont.rename.oldparent_ino;
- local->cont.rename.postoldparent.st_ino = local->cont.rename.oldparent_ino;
- local->cont.rename.prenewparent.st_ino = local->cont.rename.newparent_ino;
- local->cont.rename.postnewparent.st_ino = local->cont.rename.newparent_ino;
+ local->cont.rename.preoldparent.ia_ino = local->cont.rename.oldparent_ino;
+ local->cont.rename.postoldparent.ia_ino = local->cont.rename.oldparent_ino;
+ local->cont.rename.prenewparent.ia_ino = local->cont.rename.newparent_ino;
+ local->cont.rename.postnewparent.ia_ino = local->cont.rename.newparent_ino;
AFR_STACK_UNWIND (rename, main_frame,
local->op_ret, local->op_errno,
@@ -1395,9 +1395,9 @@ afr_rename_unwind (call_frame_t *frame, xlator_t *this)
int
afr_rename_wind_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)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -1599,8 +1599,8 @@ afr_unlink_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- local->cont.unlink.preparent.st_ino = local->cont.unlink.parent_ino;
- local->cont.unlink.postparent.st_ino = local->cont.unlink.parent_ino;
+ local->cont.unlink.preparent.ia_ino = local->cont.unlink.parent_ino;
+ local->cont.unlink.postparent.ia_ino = local->cont.unlink.parent_ino;
AFR_STACK_UNWIND (unlink, main_frame,
local->op_ret, local->op_errno,
@@ -1614,8 +1614,8 @@ afr_unlink_unwind (call_frame_t *frame, xlator_t *this)
int
afr_unlink_wind_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)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
@@ -1814,8 +1814,8 @@ afr_rmdir_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- local->cont.rmdir.preparent.st_ino = local->cont.rmdir.parent_ino;
- local->cont.rmdir.postparent.st_ino = local->cont.rmdir.parent_ino;
+ local->cont.rmdir.preparent.ia_ino = local->cont.rmdir.parent_ino;
+ local->cont.rmdir.postparent.ia_ino = local->cont.rmdir.parent_ino;
AFR_STACK_UNWIND (rmdir, main_frame,
local->op_ret, local->op_errno,
@@ -1829,8 +1829,8 @@ afr_rmdir_unwind (call_frame_t *frame, xlator_t *this)
int
afr_rmdir_wind_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)
{
afr_local_t * local = NULL;
afr_private_t * priv = NULL;
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c
index 3b89da9abdb..9ce1036755d 100644
--- a/xlators/cluster/afr/src/afr-inode-read.c
+++ b/xlators/cluster/afr/src/afr-inode-read.c
@@ -179,7 +179,7 @@ out:
int32_t
afr_stat_cbk (call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
- struct stat *buf)
+ struct iatt *buf)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -222,7 +222,7 @@ afr_stat_cbk (call_frame_t *frame, void *cookie,
out:
if (unwind) {
if (buf)
- buf->st_ino = local->cont.stat.ino;
+ buf->ia_ino = local->cont.stat.ino;
AFR_STACK_UNWIND (stat, frame, op_ret, op_errno, buf);
}
@@ -303,7 +303,7 @@ out:
int32_t
afr_fstat_cbk (call_frame_t *frame, void *cookie,
xlator_t *this, int32_t op_ret, int32_t op_errno,
- struct stat *buf)
+ struct iatt *buf)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -346,7 +346,7 @@ afr_fstat_cbk (call_frame_t *frame, void *cookie,
out:
if (unwind) {
if (buf)
- buf->st_ino = local->cont.fstat.ino;
+ buf->ia_ino = local->cont.fstat.ino;
AFR_STACK_UNWIND (fstat, frame, op_ret, op_errno, buf);
}
@@ -428,7 +428,7 @@ out:
int32_t
afr_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)
+ const char *buf, struct iatt *sbuf)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -471,7 +471,7 @@ afr_readlink_cbk (call_frame_t *frame, void *cookie,
out:
if (unwind) {
if (sbuf)
- sbuf->st_ino = local->cont.readlink.ino;
+ sbuf->ia_ino = local->cont.readlink.ino;
AFR_STACK_UNWIND (readlink, frame, op_ret, op_errno, buf, sbuf);
}
@@ -748,7 +748,7 @@ out:
int32_t
afr_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 *buf,
+ struct iovec *vector, int32_t count, struct iatt *buf,
struct iobref *iobref)
{
afr_private_t * priv = NULL;
@@ -803,7 +803,7 @@ afr_readv_cbk (call_frame_t *frame, void *cookie,
out:
if (unwind) {
if (buf)
- buf->st_ino = local->cont.readv.ino;
+ buf->ia_ino = local->cont.readv.ino;
AFR_STACK_UNWIND (readv, frame, op_ret, op_errno,
vector, count, buf, iobref);
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 32e93e6e2fe..7b7408bbc51 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -69,8 +69,8 @@ afr_writev_unwind (call_frame_t *frame, xlator_t *this)
UNLOCK (&frame->lock);
if (main_frame) {
- local->cont.writev.prebuf.st_ino = local->cont.writev.ino;
- local->cont.writev.postbuf.st_ino = local->cont.writev.ino;
+ local->cont.writev.prebuf.ia_ino = local->cont.writev.ino;
+ local->cont.writev.postbuf.ia_ino = local->cont.writev.ino;
AFR_STACK_UNWIND (writev, main_frame,
local->op_ret, local->op_errno,
@@ -83,8 +83,8 @@ afr_writev_unwind (call_frame_t *frame, xlator_t *this)
int
afr_writev_wind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,