All of lore.kernel.org
 help / color / mirror / Atom feed
* Questions about redirect_fd feature
@ 2017-04-18 12:59 Rock Lee
  2017-04-18 14:16 ` Amir Goldstein
  0 siblings, 1 reply; 2+ messages in thread
From: Rock Lee @ 2017-04-18 12:59 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: linux-unionfs

Hi, Amir
I am a little confused. redirect_fd feature needs to wrt a file handle
to a xattr in upper dir, but what are the advantages ? Because it is
faster to lookup than ordinary lookup ? Could you please give me some
hints about why redirect by file handle is faster ?

BTW, there are too few comments in the overlayfs code which makes me
very hard to understand.

Thanks for your time.
-- 
Cheers,
Rock

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Questions about redirect_fd feature
  2017-04-18 12:59 Questions about redirect_fd feature Rock Lee
@ 2017-04-18 14:16 ` Amir Goldstein
  0 siblings, 0 replies; 2+ messages in thread
From: Amir Goldstein @ 2017-04-18 14:16 UTC (permalink / raw)
  To: Rock Lee; +Cc: linux-unionfs

On Tue, Apr 18, 2017 at 3:59 PM, Rock Lee <rockdotlee@gmail.com> wrote:
> Hi, Amir
> I am a little confused. redirect_fd feature needs to wrt a file handle

typo: redirect_fh (not to be confused with consistent_fd)

> to a xattr in upper dir, but what are the advantages ? Because it is
> faster to lookup than ordinary lookup ? Could you please give me some
> hints about why redirect by file handle is faster ?

There are some use cases where lookup by fh could be faster than
by path because it just needs one inode lookup (by ino) as opposed
to name lookup per path element (e.g. in path /a/b/c/d/e/f/g/h/i/g/k)
and also redirect by path is limited to certain path length (which is less
than MAX_PATH).

But to be honest, those optimizations are not  the reason I needed
redirect_fh. My reasons are related to overlayfs snapshots and it
not easy to explain.

In my recent submission of "stable inode" feature, redirect_fh is used
to track the origin of non-dir copy up files.
That is an easier motivation to explain and that is the strongest advantage
that overlayfs gains from redirect_fh.

>
> BTW, there are too few comments in the overlayfs code which makes me
> very hard to understand.
>

I can only say that my comment to code ratio is only slightly better than
Miklos's ;-)
I'll do my best to improve.

Thanks,
Amir.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-18 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-18 12:59 Questions about redirect_fd feature Rock Lee
2017-04-18 14:16 ` Amir Goldstein

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.