Re: fcntl(2) and other file systems like XFS

From: William J. Earl (wje@engr.sgi.com)
Date: Fri Mar 17 2000 - 12:36:20 EST


tytso@mit.edu writes:
> From: Jim Mostek <mostek@sgi.com>
> Date: Thu, 16 Mar 2000 12:05:13 -0600 (CST)
>
> What should XFS or any other file system do with these? I guess they
> should return EINVAL. What if we accidentally or purposely get called
> with this? Applications don't normally check which file system they are
> running on. I don't suspect that all file systems should be including
> linux/include/linux/ext2_fs.h.
>
> Well, if you don't recognize the ioctl, you should return EINVAL.....
> If XFS doesn't support any ioctl's, then it can have a very trivial
> ioctl() handler, and you don't hve to worry about any device collisions.
>
> In practice the collision hasn't been a problem, since the 32-bit space
> is relatively sparsely occupied.
...

      The main question was how to represent in Linux certain XFS interfaces
which are represented in IRIX via file system-interpreted fcntls. ext2
does various operations in the same general class via ioctls, so various
people have suggested that XFS use ioctls in Linux. Apart from introducing
some minor application porting issues, this is generally ok, except that
these operations ought to be applicable to every file object (including
device special files) in an XFS file system. That is, if root is XFS,
and we are not using devfs (or if we create a device special file somewhere
outside devfs), then we need to be able to apply the XFS special operations to the
device special file itself, just as we can apply lstat(). Normally, this
is not possible, since the ioctls are passed through directly to the device
once one has the device open.

      It may be, however, that the main operations which can reasonably
apply to device special files (as opposed to the many others which can
only reasonably apply to regular files or perhaps directories) are the
extended attribute get and set operations. Since it appears that this may
be the subject of a separate interface in Linux, perhaps there is no
practical problem in regard to device special files.

-
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 : Thu Mar 23 2000 - 21:00:21 EST