Re: Inode to Gluster handle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Speaking of gluster internals, gluster relies primarily on gfid to identify file-system objects. So, if you've gfid, its easy to do operations on the fs object. In fact fuse mount even allows access to fs objects just by using gfids:

      --aux-gfid-mount       Enable access to filesystem through gfid directly

When glusterfs is mounted with the above option, one can access the file/directory using path <glusterfs-mount>/.gfid/<canonicalized-gfid>

However, with just ino from stat I think it might not be possible to access the fs object. Note the following function, which derives ino from gfid:

ino_t
gfid_to_ino (uuid_t gfid)
{
        ino_t ino = 0;
        int32_t i;

        for (i = 8; i < 16; i++) {
                ino <<= 8;
                ino += (uint8_t)gfid[i];
        }

        return ino;
}

As can be seen above first 8 bytes of gfid is *lost*. So, I don't think its possible to derive gfid from ino. Without gfid or path, access to fs object is not possible

PS: Though I've used the example of fuse, on a high level, the answer is same for gfapi.

regards,
Raghavendra

----- Original Message -----
> From: "chris holcombe" <chris.holcombe@xxxxxxxxxxxxx>
> To: gluster-devel@xxxxxxxxxxx
> Sent: Sunday, February 19, 2017 11:08:16 PM
> Subject:  Inode to Gluster handle
> 
> Anyone know how to take an inode number and get a gfapi gluster object
> from it?  Or possibly even better, convert it into a gluster path?
> 
> Thanks,
> Chris
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel@xxxxxxxxxxx
> http://lists.gluster.org/mailman/listinfo/gluster-devel
> 
_______________________________________________
Gluster-devel mailing list
Gluster-devel@xxxxxxxxxxx
http://lists.gluster.org/mailman/listinfo/gluster-devel



[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux