From 9fd17c1c3c44944ea280c4c15bad0d49b298b8a9 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Mon, 25 Dec 2017 19:19:53 +0530 Subject: 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 --- xlators/storage/posix/src/posix-helpers.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/storage') 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; out: return; } @@ -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); else 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); else posix_fill_gfid_path (this, path, &stbuf); + stbuf.ia_flags |= IATT_GFID; ret = sys_lstat (path, &lstatbuf); if (ret == -1) { -- cgit