lkml.org 
[lkml]   [2000]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectfcntl(2) and other file systems like XFS
Date

I don't see a callout from sys_fcntl into a file system specific routine
(other than for file locking). There is a lock callout in
the file operations that can be invoked in fcntl_getlk/fcntl_setlk/...
(I'm looking in 2.3.42). But, this is different than file system specific
fcntls. There is a call to sock_fcntl if the inode is a socket. But, I
don't see a call for a file system specific fcntl in sys_fcntl..

XFS has several fcntls for things like preallocating space. This is used
by some applications who want very large files. This let's a file system
allocate the space all at once.

Has the issue of a file_operation callout for fcntl gone around before?
Anyone opposed to adding this? I don't think this belongs in the
inode_operations.

Here are the current fcntls XFS supports:

F_DIOINFO # return info for apps to handle Direct I/O (no buffer cache).
F_FSGETXATTR # get a bigger stat structure with extended attr info.
F_FSGETXATTRA # same as previous, but different parms.
F_FSSETXATTR # set some extended attribute parameters.
F_GETBMAP # get the extents of a file.
F_GETBMAPA # same as F_GETBMAP but different format.
F_GETBMAPX # same as F_GETBMAP but different format.
F_FSSETDM # Set DMI event mask and state (XFS only, today)

F_ALLOCSP # pre allocate disk space for a file
F_FREESP # free some pre allocated disk space.
F_RESVSP # same as ALLOCSP but different parms.
F_UNRESVSP # same as F_FREESP except different parms.
F_ALLOCSP64 # same as ALLOCSP but different parms.
F_FREESP64 # same as F_FREESP except different parms.
F_RESVSP64 # same as ALLOCSP but different parms
F_UNRESVSP64 # same as F_FREESP except different parms.
F_SETBIOSIZE # set preferred buffered I/O size
F_GETBIOSIZE # get preferred buffered I/O size

I think we want to add a few more like F_FATTR_SET, F_FATTR_GET,
F_FATTR_LIST, and F_FATTR_REMOVE to implement the extended attribute
capability XFS has. This allows processes to add more info to files
besides the data. Then again, we could add new system calls for
attr_set, attr_get, attr_remove, attr_list, hmmm.
I think for now we should just add the fcntl callout to sys_fcntl and
not add the new system calls.

If sys_fcntl doesn't understand the fcntl and the inode is not
a socket and the file has an op for an fcntl callout, invoke the callout.

Sound good?

If noone objects, we'll get a patch together for this.

Thanks,

Jim

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.109 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site