[linux-cifs-client] proposed new UNIX info level

James Peach jpeach at samba.org
Wed Feb 7 06:14:31 GMT 2007


Hi all,

This is a proposal for an extended SMB_QUERY_FILE_UNIX_BASIC info
level. The primary motivation for this is to provide an info level
that contains the BSD-style file flags and the file create time
(birth time).

The new info level is

     SMB_QUERY_FILE_UNIX_INFO2 0x20b /* info level */

     This is can be requested for QueryFileInfo, QueryPathInfo
     FindFirst, FindNext and PosixOpen, etc. Basically, anywhere you
     can ask for an info level :)

     For the FindFirst/FindNext, we should allocate a secondary info
     level to return the same data, SMB_FIND_FILE_UNIX2, if we want
     to be consistent with SMB_FIND_FILE_UNIX.

     The reply data block is:

         Size    Offset  Value
         ---------------------
         0      LARGE_INTEGER EndOfFile  File size
         8      LARGE_INTEGER Blocks     Number of blocks used on disk
         16     LARGE_INTEGER ChangeTime               Attribute  
change time
         24     LARGE_INTEGER LastAccessTime           Last access time
         32     LARGE_INTEGER LastModificationTime     Last  
modification time
         40     LARGE_INTEGER Uid        Numeric user id for the owner
         48     LARGE_INTEGER Gid        Numeric group id of owner
         56     ULONG Type               Enumeration specifying the  
file type
         60     LARGE_INTEGER devmajor   Major device number if type  
is device
         68     LARGE_INTEGER devminor   Minor device number if type  
is device
         76     LARGE_INTEGER uniqueid   This is a server-assigned  
unique id
         84     LARGE_INTEGER permissions  	      Standard UNIX  
permissions
         92     LARGE_INTEGER nlinks     Number of hard link)
         100    LARGE_INTEGER CreationTime             Create/birth time
         108    ULONG FileFlags          File flags enumeration
         112    ULONG FileFlagsMask      Mask of valid flags

     Note that this is simply the SMB_QUERY_FILE_UNIX_BASIC reply
     with a few fields tacked on the end. All the fields except the
     last 3 inherit their semantics from SMB_QUERY_FILE_UNIX_BASIC.

The BSD-style file flags.

     These are needed to support UI tools that can modify their
     behaviour appropriately for the flags. The mose useful flag
     will probably be the HIDDEN flag, but I imagine that people
     with particular I/O requirements will find the others useful
     as well.

     The list of flags is derived from the current Linux CIFS client
     headers. I have removed those flags that seemed very specific
     to the current EXT3 implementation, and renumbered the remainded
     to be sequential. I'm expecting some feedback on this :)

     Note that these flags do not preserve the BSD concept of versions
     that are settable by users and versions that are only settable
     by superuser. The correct behaviour on GET will be to report
     the union of the user and superuser flags. The correct behaviour
     on SET will be to set only the user flag.

     EXT_SECURE_DELETE       0x00000001 /* file should be deleted  
securely */
     EXT_ENABLE_UNDELETE     0x00000002 /* file is an undelete  
candidate */
     EXT_SYNCHRONOUS         0x00000004 /* use synchronous I/O */
     EXT_IMMUTABLE           0x00000008 /* file is immutable */
     EXT_OPEN_APPEND_ONLY    0x00000010 /* file is append-only */
     EXT_DO_NOT_BACKUP       0x00000020 /* file should not be backed  
up */
     EXT_NO_UPDATE_ATIME     0x00000040 /* don't update the atime */
     EXT_HIDDEN              0x00000080 /* don't show this file in UI */

File create (birth) time.

     This is the BSD st_birthtime field, serialised as an NTTIME
     structure in the same way as the other timestamps already present
     in SMB_QUERY_FILE_UNIX_BASIC.

--
James Peach | jpeach at samba.org




More information about the linux-cifs-client mailing list