Re: Get GFID for a file through libgfapi

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

 



Neils,
            Thanks for pointing to the sample code. The use case is to use  GFID as a unique key for maintaining indexing information about a file when it is being backed up from GlusterFS storage.  Extending GFAPI to extract GFID for a file would be great.
             As  per the example If I need to find GFID for a path p1/p2/p3/p4 on a glusterfs volume then should I do a look up for every level?
             LOOKUP (/)->LOOKUP(p1)-> LOOKUP(p2)-> LOOKUP(p3)-> LOOKUP(p4)

Thanks and Regards,
Ram


-----Original Message-----
From: Niels de Vos [mailto:ndevos@xxxxxxxxxx] 
Sent: Monday, January 09, 2017 3:39 PM
To: Ankireddypalle Reddy
Cc: Gluster Devel (gluster-devel@xxxxxxxxxxx); integration@xxxxxxxxxxx
Subject: Re:  Get GFID for a file through libgfapi

On Mon, Jan 09, 2017 at 05:53:03PM +0000, Ankireddypalle Reddy wrote:
> Hi,
>         I am trying to extract the GFID for a file through libgfapi interface. When I try to extract the value of extended attribute glusterfs.gfid through libgfapi I get the errorno: 95.  This works for FUSE though. Is there a way to extract the GFID for a file through libgfapi.

It seems that this is a case where FUSE handles the xatts special. The glusterfs.gfid and glusterfs.gfid.string (VIRTUAL_GFID_XATTR_KEY and
VIRTUAL_GFID_XATTR_KEY_STR) are specifically handled in xlators/mount/fuse/src/fuse-bridge.c.

There is a way to get the GFID, but it probably is rather a cumbersome workaround for you. The handle-API is used heavily by NFS-Ganesha (because NFS uses filehandles more than filenames), and extracts the GFID from the 'struct glfs_object' with glfs_h_extract_handle(). A basic example of how to obtain and extract the handle is in https://github.com/gluster/glusterfs/blob/master/tests/basic/gfapi/bug1291259.c

Could you explain the need for knowing the GFID in the application? We can extend gfapi with fetching the GFID if that would help you.

Niels


PS: we have a new integration@xxxxxxxxxxx where external projects can ask gfapi related questions. The gluster-devel list tends to be a little heavy on traffic for non-Gluster developers.
***************************Legal Disclaimer***************************
"This communication may contain confidential and privileged material for the
sole use of the intended recipient. Any unauthorized review, use or distribution
by others is strictly prohibited. If you have received the message by mistake,
please advise the sender by reply email and delete the message. Thank you."
**********************************************************************

_______________________________________________
Gluster-devel mailing list
Gluster-devel@xxxxxxxxxxx
http://www.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