From 5522ac20241436be6a005058b6360f4339eb678c Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 10 Jun 2011 02:50:18 +0000 Subject: loc_t: add 'gfid' and 'pargfid' fields these fields are used mainly in case of selfheal path, where 'inode->gfid'||'parent->gfid' is not yet set. These fields in 'loc' will have lower precedence than 'inode->gfid' in client protocol. also contains 'Pranith 's patch to set proper loc->gfid during afr selfheal Signed-off-by: Amar Tumballi Signed-off-by: Anand Avati BUG: 2346 (Log message enhancements in GlusterFS - phase 1) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346 --- libglusterfs/src/xlator.c | 3 +++ libglusterfs/src/xlator.h | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index b8f800c7050..16020c0d277 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -1663,6 +1663,9 @@ loc_copy (loc_t *dst, loc_t *src) dst->ino = src->ino; + uuid_copy (dst->gfid, src->gfid); + uuid_copy (dst->pargfid, src->pargfid); + if (src->inode) dst->inode = inode_ref (src->inode); diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h index e587ae5784d..60fd777614a 100644 --- a/libglusterfs/src/xlator.h +++ b/libglusterfs/src/xlator.h @@ -78,9 +78,19 @@ typedef int32_t (*event_notify_fn_t) (xlator_t *this, int32_t event, void *data, struct _loc { const char *path; const char *name; - ino_t ino; inode_t *inode; inode_t *parent; + /* Currently all location based operations are through 'gfid' of inode. + * But the 'inode->gfid' only gets set in higher most layer (as in, + * 'fuse', 'protocol/server', or 'nfs/server'). So if translators want + * to send fops on a inode before the 'inode->gfid' is set, they have to + * make use of below 'gfid' fields + */ + uuid_t gfid; + uuid_t pargfid; + + /* ideally, should not be used */ + ino_t ino; }; -- cgit