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

From: Jeff Garzik (jgarzik@mandrakesoft.com)
Date: Tue Mar 21 2000 - 14:25:34 EST


Jamie Lokier wrote:
>
> Stephen C. Tweedie wrote:
> > Yes. In fact, it's worse than that: to perform either an ioctl or a
> > fcntl, you need to have a file handle on the inode. But for device
> > inodes, you cannot open the inode unless the device is present. This
> > hits us already on ext2: you cannot, for example, do a "chattr +I
> > /dev/*" to make all /dev inodes immutable, because most of the inodes
> > present in that directory will not have valid devices (just how many
> > people do you know who use every possible partition number of every
> > possible scsi, ide, smart, mylex .... device?)
>
> The very nice O_NONE idea would sort this out. O_NONE means you can
> always open the file object, but you can't do much with it. For a
> device, the device wouldn't get opened, but fstat() would return the
> same device information as stat() returns.
>
> Things like fchmod _are_ permitted though.
>
> We could say that fs-specific ioctls (or fcntls if it goes that way) are
> permitted on O_NONE file handles.

On a similar subject, how feasible is it to implement O_DIRECT?

This would be wonderful for video players or other apps which deal with
things at a filesystem (not raw device) level, but are still smart
enough to do their own caching. Or deal with such large files that they
wind up killing your other cached fs data...

        Jeff

-- 
Jeff Garzik              | Tact is the ability to tell a man 
Building 1024            | he has an open mind when he has a
MandrakeSoft, Inc.       | hole in his head.  (-random fortune)

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