* Regarding Wrapfs Code - function wrapfs_interpose
@ 2006-04-08 4:51 UZAIR LAKHANI
2006-04-08 13:10 ` Avishay Traeger
0 siblings, 1 reply; 3+ messages in thread
From: UZAIR LAKHANI @ 2006-04-08 4:51 UTC (permalink / raw)
To: linux-fsdevel
Hello All,
I want to find out the purpose of a part of Wrapfs
code.
The function name is wrapfs_interpose
The code is
/* check that the lower file system didn't cross a
mount point */
if (lower_inode->i_sb != SUPERBLOCK_TO_LOWER(sb)) {
err = -EXDEV;
goto out;
}
I want to find out what is the purpose of the above
check.
Thanks,
Uzair Lakhnai
Karachi, Pakistan
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Regarding Wrapfs Code - function wrapfs_interpose
2006-04-08 4:51 Regarding Wrapfs Code - function wrapfs_interpose UZAIR LAKHANI
@ 2006-04-08 13:10 ` Avishay Traeger
2006-04-08 19:00 ` Erez Zadok
0 siblings, 1 reply; 3+ messages in thread
From: Avishay Traeger @ 2006-04-08 13:10 UTC (permalink / raw)
To: UZAIR LAKHANI; +Cc: linux-fsdevel
On Fri, 2006-04-07 at 21:51 -0700, UZAIR LAKHANI wrote:
> I want to find out the purpose of a part of Wrapfs
> code.
>
> The function name is wrapfs_interpose
>
> The code is
>
> /* check that the lower file system didn't cross a
> mount point */
> if (lower_inode->i_sb != SUPERBLOCK_TO_LOWER(sb)) {
> err = -EXDEV;
> goto out;
> }
>
> I want to find out what is the purpose of the above
> check.
Exactly what the comment says - it checks to make sure that we didn't
cross a mount point. It does this by making sure that the lower-level
superblock of this lower-level inode is the same as the lower-level
superblock that we expect (the one used at mount-time). So basically,
if we see a superblock that is different from the one we usually use, we
crossed a mount point and so we return an error.
Avishay Traeger
http://www.fsl.cs.sunysb.edu/~avishay/
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Regarding Wrapfs Code - function wrapfs_interpose
2006-04-08 13:10 ` Avishay Traeger
@ 2006-04-08 19:00 ` Erez Zadok
0 siblings, 0 replies; 3+ messages in thread
From: Erez Zadok @ 2006-04-08 19:00 UTC (permalink / raw)
To: Avishay Traeger; +Cc: UZAIR LAKHANI, linux-fsdevel
In message <1144501811.13374.13.camel@ool-44c32f98.dyn.optonline.net>, Avishay Traeger writes:
> On Fri, 2006-04-07 at 21:51 -0700, UZAIR LAKHANI wrote:
> > I want to find out the purpose of a part of Wrapfs
> > code.
> >
> > The function name is wrapfs_interpose
> >
> > The code is
> >
> > /* check that the lower file system didn't cross a
> > mount point */
> > if (lower_inode->i_sb != SUPERBLOCK_TO_LOWER(sb)) {
> > err = -EXDEV;
> > goto out;
> > }
> >
> > I want to find out what is the purpose of the above
> > check.
>
> Exactly what the comment says - it checks to make sure that we didn't
> cross a mount point. It does this by making sure that the lower-level
> superblock of this lower-level inode is the same as the lower-level
> superblock that we expect (the one used at mount-time). So basically,
> if we see a superblock that is different from the one we usually use, we
> crossed a mount point and so we return an error.
>
> Avishay Traeger
> http://www.fsl.cs.sunysb.edu/~avishay/
More detail.
In its default mode, Wrapfs generates inode numbers by inheriting the inum
of the lower inode: that way we are guaranteed unique inodes, and a fast
operation to generate inodes. But if you cross into a new sb, you could
clash with other inodes that have the same inum (confusing the icache) -- so
the default alg doesn't work unless we prohibit you from crossing into lower
sb's.
Wrapfs supports therefore another mode in which we use iunique() to generate
unique inums. In this mode you *can* cross into new sb's, but the
disadvantage now is that your inums are not persistent (this can mess up
certain tools like tar/find, and NFS).
In Unionfs we implemented yet another alternative (called "imap" or Inode
Map). We generate unique inums, but we store them persistently on the lower
f/s, in a special mapping file. That way we can map our own stacked inums
to the lower ones. So this allows you to cross into any number of sb's, and
it works with NFS (client/server) and with tools like tar and find. Problem
is, performance now suffers each time you have to consult the i-mapping file
to translate b/t upper and lower inums.
Erez.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-04-08 19:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-08 4:51 Regarding Wrapfs Code - function wrapfs_interpose UZAIR LAKHANI
2006-04-08 13:10 ` Avishay Traeger
2006-04-08 19:00 ` Erez Zadok
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.