linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: fuse-devel <fuse-devel@lists.sourceforge.net>
Cc: "Jean-Pierre André" <jean-pierre.andre@wanadoo.fr>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [fuse-devel] [fuse] Relevance of st_ino values
Date: Tue, 12 Feb 2019 10:02:16 +0100	[thread overview]
Message-ID: <CAJfpegtW5nsmXjMCTUH-wvL3q+87buGtiswKPpCJA0U9vHyP0g@mail.gmail.com> (raw)
In-Reply-To: <878symukbw.fsf@vostro.rath.org>

On Mon, Feb 11, 2019 at 9:44 PM Nikolaus Rath <Nikolaus@rath.org> wrote:
>
> On Feb 11 2019, Miklos Szeredi <miklos@szeredi.hu> wrote:
> > On Mon, Feb 11, 2019 at 12:18 PM Jean-Pierre André
> > <jean-pierre.andre@wanadoo.fr> wrote:
> >>
> >> Nikolaus Rath wrote:
> >> > Hello,
> >> >
> >> > For several requests, FUSE userspace returns a struct stat to the
> >> > kernel. struct stat includes an st_ino field, but FUSE generally has a
> >> > separate field for the inode (e.g. fuse_entry_param.ino vs
> >> > fuse_entry_param.attr.st_ino).
> >> >
> >> > Does the kernel use the st_ino value at all, or is just passed through
> >> > to userspace?
> >
> > st_ino value is not used in any way by the kernel, just passed through
> > to userspace.
>
> Thanks! And there is nothing that userspace can do with those numbers
> other than comparing them to determine if two files are hardlinks of
> each other, right? They cannot be passed back to the kernel in a
> syscall?

True and true.   If you want something to pass back to the kernel, see
the name_to_handle_at(2) and open_by_handle_at(2) syscalls.

POSIX states that

  "The st_ino and st_dev fields taken together uniquely identify the
file within the system."

FUSE takes care of providing a unique st_dev, so the filesystem only
has to care about providing a unique st_ino.  Note: it's perfectly
fine to reuse st_ino value of an already deleted file, so {st_dev,
st_ino} only has to guarantee uniqueness at every single point in
time, but not across different points in time.

Thanks,
Miklos

      reply	other threads:[~2019-02-12  9:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-10 21:15 [fuse] Relevance of st_ino values Nikolaus Rath
2019-02-11 11:18 ` Jean-Pierre André
2019-02-11 15:59   ` [fuse-devel] " Miklos Szeredi
2019-02-11 20:44     ` Nikolaus Rath
2019-02-12  9:02       ` Miklos Szeredi [this message]

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=CAJfpegtW5nsmXjMCTUH-wvL3q+87buGtiswKPpCJA0U9vHyP0g@mail.gmail.com \
    --to=miklos@szeredi.hu \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=jean-pierre.andre@wanadoo.fr \
    --cc=linux-fsdevel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).