xfs
[Top] [All Lists]

xfsprogs/libhandle : How to get the handle for a symbolic link ?

To: xfs@xxxxxxxxxxx
Subject: xfsprogs/libhandle : How to get the handle for a symbolic link ?
From: DENIEL Philippe <philippe.deniel@xxxxxx>
Date: Tue, 01 Jun 2010 13:48:22 +0200
Organization: CEA-DAM
User-agent: Thunderbird 2.0.0.6 (X11/20070728)
Hi,

I am currently developing a user space nfs server with various backends. One of this backend module use xfsprogss's libhandle to implement XFS support. I could do almost everything with open_by_handle and fd_to_handle, used jointly with ATFILE_SOURCE functions, but I do have a problem with symbolic links. To build an xfs object's handle, I get its parent handle (now problem to this) then I call "openat" to get the fd to the object before calling fd_to_handle. This works ok, but not for symbolic link : the openat with follow the link. I added the O_NOFOLLOW flag to openat, but now openat return ELOOP instead. I know there is a readlink_by_handle function in libhandle. How could I build the related handle to be used as argument to it (I mean, how to build a handle that refers to the symlink itself, not the object it points to).

   Regards

      Philippe

<Prev in Thread] Current Thread [Next in Thread>