diff options
author | Amar Tumballi <amar@gluster.com> | 2011-10-02 08:46:46 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-10-02 22:08:02 -0700 |
commit | b6eee04da4a699c7cd850bf2121825cc67f14707 (patch) | |
tree | 58ec2747855ba5c37330414b4423fd33e206b80c /libglusterfs/src/inode.c | |
parent | 0db88567b916dc0dbfb0dfe2ed8a47f8d50fb317 (diff) |
core: made changes to return value of __is_root_gfid()
now returns 'true(1)' is gfid is root, 'false(0)' if not.
earlier it was the inverse, which was bit confusing
Change-Id: Id103f444ace048cbb0fccdc72c6646da06631584
BUG: 3518
Reviewed-on: http://review.gluster.com/549
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'libglusterfs/src/inode.c')
-rw-r--r-- | libglusterfs/src/inode.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c index 117b977b924..3239878b35d 100644 --- a/libglusterfs/src/inode.c +++ b/libglusterfs/src/inode.c @@ -653,18 +653,19 @@ inode_grep (inode_table_t *table, inode_t *parent, const char *name) return inode; } -int +/* return 1 if gfid is of root, 0 if not */ +gf_boolean_t __is_root_gfid (uuid_t gfid) { uuid_t root; - int ret; memset (root, 0, 16); root[15] = 1; - ret = uuid_compare (gfid, root); + if (uuid_compare (gfid, root) == 0) + return _gf_true; - return ret; + return _gf_false; } @@ -680,7 +681,7 @@ __inode_find (inode_table_t *table, uuid_t gfid) goto out; } - if (__is_root_gfid (gfid) == 0) + if (__is_root_gfid (gfid)) return table->root; hash = hash_gfid (gfid, 65536); |