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

From: Alexander Viro (viro@math.psu.edu)
Date: Mon Nov 12 2001 - 01:47:02 EST


[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.

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



This archive was generated by hypermail 2b29 : Thu Nov 15 2001 - 21:00:28 EST