diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2013-09-04 15:59:52 +0530 |
---|---|---|
committer | Krutika Dhananjay <kdhananj@redhat.com> | 2013-09-06 14:57:12 +0530 |
commit | 372bd28db095daa99503dc964d211965ce1f7b83 (patch) | |
tree | addc76b5ee58dcb4d6c4264071f8ce86a8f5c4ef | |
parent | 7cd2b660b4a83180b43122a17d7d52eaf4a474a2 (diff) |
storage/posix: fill GET_ANCESTRY_PATH in lookup xdata when asked for
Original-author: Krishnan Parthasarathi <kparthas@redhat.com>
Change-Id: I0a68cb52f6d97da91782120af04b8dacb0c9ccc5
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
-rw-r--r-- | xlators/storage/posix/src/posix-helpers.c | 7 | ||||
-rw-r--r-- | xlators/storage/posix/src/posix.c | 11 | ||||
-rw-r--r-- | xlators/storage/posix/src/posix.h | 3 |
3 files changed, 15 insertions, 6 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index efc1ef13..e8471ad5 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -314,6 +314,13 @@ _posix_xattr_get_set (dict_t *xattr_req, } } else if (fnmatch (marker_contri_key, key, 0) == 0) { ret = _posix_get_marker_quota_contributions (filler, key); + + } else if (!strcmp (key, GET_ANCESTRY_PATH_KEY)) { + ret = posix_get_ancestry (filler->this, filler->real_path, + filler->loc, filler->xattr, + POSIX_ANCESTRY_PATH, + &filler->op_errno, xattr_req); + } else { ret = _posix_xattr_get_set_from_backend (filler, key); } diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 903cae9d..e63ca8d4 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -2782,7 +2782,7 @@ posix_xattr_get_real_filename (call_frame_t *frame, xlator_t *this, loc_t *loc, } int -posix_get_ancestry_directory (xlator_t *this, char *real_path, loc_t *loc, +posix_get_ancestry_directory (xlator_t *this, const char *real_path, loc_t *loc, dict_t *dict, int type, int32_t *op_errno, dict_t *xdata) { @@ -2811,7 +2811,6 @@ posix_get_ancestry_directory (xlator_t *this, char *real_path, loc_t *loc, if (ret < 0) goto out; - GF_ASSERT (loc->inode == inode); /* there is already a reference in loc->inode */ inode_unref (inode); @@ -2843,8 +2842,8 @@ out: } int -posix_get_ancestry_non_directory (xlator_t *this, char *real_path, loc_t *loc, - dict_t *dict, int type, +posix_get_ancestry_non_directory (xlator_t *this, const char *real_path, + loc_t *loc, dict_t *dict, int type, int32_t *op_errno, dict_t *xdata) { size_t remaining_size = 0; @@ -3111,8 +3110,8 @@ out: } int -posix_get_ancestry (xlator_t *this, char *real_path, loc_t *loc, dict_t *dict, - int type, int32_t *op_errno, dict_t *xdata) +posix_get_ancestry (xlator_t *this, const char *real_path, loc_t *loc, + dict_t *dict, int type, int32_t *op_errno, dict_t *xdata) { int ret = -1; diff --git a/xlators/storage/posix/src/posix.h b/xlators/storage/posix/src/posix.h index a957e187..09e6d39c 100644 --- a/xlators/storage/posix/src/posix.h +++ b/xlators/storage/posix/src/posix.h @@ -203,4 +203,7 @@ __posix_fd_set_odirect (fd_t *fd, struct posix_fd *pfd, int opflags, void posix_spawn_health_check_thread (xlator_t *this); void *posix_fsyncer (void *); +int +posix_get_ancestry (xlator_t *this, const char *real_path, loc_t *loc, + dict_t *dict, int type, int32_t *op_errno, dict_t *xdata); #endif /* _POSIX_H */ |