summaryrefslogtreecommitdiffstats
path: root/libglusterfs
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 /libglusterfs
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 'libglusterfs')
-rw-r--r--libglusterfs/src/call-stub.c88
-rw-r--r--libglusterfs/src/call-stub.h176
-rw-r--r--libglusterfs/src/defaults.c88
-rw-r--r--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
14 files changed, 341 insertions, 317 deletions
diff --git a/libglusterfs/src/call-stub.c b/libglusterfs/src/call-stub.c
index 80b7f12ac..17d8c8106 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 189e2e1db..3160e9dd0 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 3aff664d7..ab88e024c 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 904d05dab..daab88919 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 4febb9f59..b24d0089d 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 0a3436949..4a7220d96 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 0e13c0325..433f46aaa 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 da851ff12..6e5d82fec 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 520df7dbc..ef7866b09 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 44f73c906..1f0c4ac7d 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 3b5b3087f..829d3fa83 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 5f2162302..e0d0b13fa 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 245ba8c5a..2bc29508b 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 b6e103855..4b9b3e9ce 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);