From 283ec9608e6cbc9393941d5fae901e558360d2bd Mon Sep 17 00:00:00 2001 From: "Anand V. Avati" Date: Tue, 16 Mar 2010 09:46:33 +0000 Subject: iatt: changes across the codebase - libglusterfs -- call-stub -- inode -- protocol - libglusterfsclient - cluster/replicate - cluster/{dht,nufa,switch} - cluster/unify - cluster/HA - cluster/map - cluster/stripe - debug/error-gen - debug/trace - debug/io-stats - encryption/rot-13 - features/filter - features/locks - features/path-converter - features/quota - features/trash - mount/fuse - performance/io-threads - performance/io-cache - performance/quick-read - performance/read-ahead - performance/stat-prefetch - performance/symlink-cache - performance/write-behind - protocol/client - protocol/server - storage-posix Signed-off-by: Anand V. Avati Signed-off-by: Anand V. Avati BUG: 361 (GlusterFS 3.0 should work on Mac OS/X) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=361 --- libglusterfs/src/protocol.h | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'libglusterfs/src/protocol.h') 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 #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; -- cgit