public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: DENIEL Philippe <philippe.deniel@CEA.FR>
Cc: xfs@oss.sgi.com
Subject: Re: xfsprogs/libhandle : How to get the handle for a symbolic link ?
Date: Wed, 2 Jun 2010 09:29:17 +1000	[thread overview]
Message-ID: <20100601232917.GG1395@dastard> (raw)
In-Reply-To: <4C04F386.908@cea.fr>

On Tue, Jun 01, 2010 at 01:48:22PM +0200, DENIEL Philippe wrote:
> 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).

Doesn't path_to_handle() do what you want? From the man page:

	"... If the final component of the path name is a symbolic
	link, the handle returned is that of the link itself."

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2010-06-01 23:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01 11:48 xfsprogs/libhandle : How to get the handle for a symbolic link ? DENIEL Philippe
2010-06-01 23:29 ` Dave Chinner [this message]
2010-06-02  7:20   ` DENIEL Philippe
2010-06-02 10:06     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100601232917.GG1395@dastard \
    --to=david@fromorbit.com \
    --cc=philippe.deniel@CEA.FR \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox