xfs
[Top] [All Lists]

Re: [RFC][PATCH] VFS interface for extended attributes

To: Nathan Scott <nathans@xxxxxxx>
Subject: Re: [RFC][PATCH] VFS interface for extended attributes
From: Alexander Viro <viro@xxxxxxxxxxxx>
Date: Mon, 12 Nov 2001 01:47:02 -0500 (EST)
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxx>, Andreas Gruenbacher <ag@xxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-xfs@xxxxxxxxxxx
In-reply-to: <20011112172113.A636371@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
[Cc'd to Linus since API changes on that level definitely require his
approval]

On Mon, 12 Nov 2001, Nathan Scott wrote:

> +static long
> +extattr_inode(struct inode *i, int cmd, char *name, void *value, size_t size)

Broken.
        a) passing inode is an obvious mistake.  dentry or vfsmount/dentry.

        b) for crying out loud, what's that with SGI and ioctl-like abortions?

Rule of the tumb: if your function got a "cmd" argument - it's broken.
ioctl(2).  fcntl(2).  prctl(2).  quotactl(2).  sysfs(2).  Missed'em'V IPC
syscalls.  Enough, already.

        Folks, it's not a rocket science.  Let a function do _one_ thing,
don't turn it into a multiplexed monstrosity.  Yes, you've used only 3
syscalls.  But actually you've managed to hide ~20 of them in that code
and the fact that you've spent only 3 syscall table entries doesn't make
the things better.

        Please, come up with a decent API.


<Prev in Thread] Current Thread [Next in Thread>