Re: [PATCH] address_space_operations unification

From: Alexander Viro (aviro@redhat.com)
Date: Sat May 06 2000 - 15:10:06 EST


On Sat, 6 May 2000, Linus Torvalds wrote:

> On Sat, 6 May 2000, Roman V. Shaposhnick wrote:
>
> > I've attached a patch which appears to make address_space_operations' interface
> > more logical and easy to use ( as it was discussed at linux-fsdevel ). The main
> > idea was to change additional argument of all methods to something that
> > interface do not care of, but all callers do. That's it.
>
> I hate "cookies". Despicable. Why pass them in at all if they are not
> supposed to be used for anything but callbacks?

Wrong. Linus, let me describe the situation with that.

a) Network filesystems are, arguably, abusing the pagecache. While the
data is provided to specific _user_ (RPC signatures, etc.) we store it
for everyone. Moreover, we can't tell which user had placed the data into
mmaped page, so the signature/fhandle/fid may very well belong to another
user.

b) We can't even cache the auth data in inode to use the same for all
operations - access for the first user might be revoked later.

c) Natural way to deal with that is to store the relevant data in
file->private_data. However, we don't need the friggin' struct file
and for many situations we simply don't have one.

> What you did just added lots of ugly casts and private fields, because the
> low-level FS's actually _did_ need to get "struct inode" or "struct
> dentry".

? Linus, have you actually looked through the patch? Where did he add a
private field? And where are callbacks, for that matter?

> In short, if this was disscussed on fs-devel, then I can only say that
> "fs-devel" doesn't seem to have any taste at all. Worthless mailing list.

        Fine, propose better interface. I'ld _love_ to get rid of this
file/dentry/void * business completely, but the only conceptually clean
way is to stop using the same pagecache for all openers on the network
filesystems and make it per-opener. Ready to go for that?
        Because that is _the_ problem: one cache is used by many clients and
writeback/populating the cache depends on the client. Yes, it sucks.
        Use of struct file * is a major suckage in that context. Yes, there is
an abuse, but it's not in the interface - it's simply the fact that logically
these caches are per-opener ones and we are forcing them into inode. In theory,
NFS may even return different _data_ depending on who you are. It will break
our implementation completely (fortunately it will also break a lot of other
implementations, so it probably doesn't happen too often).

-
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:20 EST