path: root/xlators/storage/posix
diff options
authorRavishankar N <>2017-12-25 19:19:53 +0530
committerAmar Tumballi <>2017-12-29 17:13:25 +0000
commit9fd17c1c3c44944ea280c4c15bad0d49b298b8a9 (patch)
tree26620d09b2e7fd55aff5a302d8bd15f547352e2b /xlators/storage/posix
parentcc425b0de57d574f6e68b6ef5edfdf99cd8353af (diff)
posix: Introduce flags for validity of iatt members
v1 of the patch started off as adding new fields to iatt that can be filled up using statx but the discussions were more around introducing masks to check the validity of different fields from a RIO perspective. To that extent, I have dropped the statx call in this version and introduced a 64 bit mask for existing fields. The masks I have defined are similar with the statx() flags' masks. I have *not* changed iatt_to_stat() to use the macros IATT_TYPE_VALID, IATT_GFID_VALID etc before blindly copying from struct iatt to struct. Also fixed warnings in xlators because of atime/mtime/ctime seconds field change from uint32_t to int64_t. Change-Id: I4ac614f1e8d5c8246fc99d5bc2d2a23e7941512b Signed-off-by: Ravishankar N <>
Diffstat (limited to 'xlators/storage/posix')
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index 39d29f413a8..e299dcb837c 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -597,6 +597,7 @@ posix_fill_ino_from_gfid (xlator_t *this, struct iatt *buf)
goto out;
buf->ia_ino = gfid_to_ino (buf->ia_gfid);
+ buf->ia_flags |= IATT_INO;
@@ -618,6 +619,7 @@ posix_fdstat (xlator_t *this, int fd, struct iatt *stbuf_p)
iatt_from_stat (&stbuf, &fstatbuf);
ret = posix_fill_gfid_fd (this, fd, &stbuf);
+ stbuf.ia_flags |= IATT_GFID;
posix_fill_ino_from_gfid (this, &stbuf);
@@ -688,6 +690,7 @@ posix_istat (xlator_t *this, uuid_t gfid, const char *basename,
posix_fill_gfid_path (this, real_path, &stbuf);
gf_uuid_copy (stbuf.ia_gfid, gfid);
+ stbuf.ia_flags |= IATT_GFID;
posix_fill_ino_from_gfid (this, &stbuf);
@@ -716,6 +719,7 @@ posix_pstat (xlator_t *this, uuid_t gfid, const char *path,
gf_uuid_copy (stbuf.ia_gfid, gfid);
posix_fill_gfid_path (this, path, &stbuf);
+ stbuf.ia_flags |= IATT_GFID;
ret = sys_lstat (path, &lstatbuf);
if (ret == -1) {