Re: [PATCH] address_space_operations unification

From: Alexander Viro (aviro@redhat.com)
Date: Sun May 07 2000 - 14:30:16 EST


On Sun, 7 May 2000, Linus Torvalds wrote:

> I think the proper way of thinking about the problem is simply that we do
> a "best effort" to give the specific _instance_ (ie "file") information if
> we have it.
>
> The only case where we cannot point to a specific instance is when paging
> out memory-mapped dirty data. Because we simply do not know which instance
> the dirtying was associated with.

Sigh... Trond _already_ has the struct file * on prepare_write() and friends,
no? What was missing is the same for ->readpage(). Yes, "who reads" may be
necessary too, Roman's code (p9fs itself) had finally convinced me in that.
If you remember, idea of ripping the struct file * the hell out of ->readpage()
and other methods was mine - I have to admit that it was Wrong Thing(tm).
So here comes another case - readpage() on symlinks. And here we also can't
tell who opened the file - aside of "nobody", that is.

> So a filesystem should always be able to rely on just "page" if possible
> (which it is, in quite a lot of cases), but should be able to get, and
> use, the extra "instance" information if it is available.
>
> I don't see a real problem with this.

Me neither. Just that ->readpage() for many symlinks can rely just on "page"
but uses struct dentry * passed by caller. If we are switching to passing
struct file * it becomes lethal - we have struct dentry *, we don't need
anything else, but we don't have struct file * anywhere around. IOW, after
such a change ->readpage() for symlinks _must_ use ->mapping->host. And
Roman's patch does that.

> > c) everything that doesn't care about pagecache sharing (e.g. all
> > symlinks - by necessity; there is _no_ struct file * there and creating a
> > phoney one just to pass ->f_dentry->d_inode that already _is_ available in
> > page->mapping->host just plain sucks) must be happy with NULL. Same goes
> > for directories, etc.
>
> I'd be happy with this - admit up front that the data is not always
> available. Sometimes the filesystem might _wish_ for it, but we can't
> always have what we wish for ;)

Wonderful. If that is done (and ->readpage() on symlinks falls into that
cathegory - no struct file* around) I have no problems with passing struct
file *.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:21 EST