~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/fileattr.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 
  3 #ifndef _LINUX_FILEATTR_H
  4 #define _LINUX_FILEATTR_H
  5 
  6 /* Flags shared betwen flags/xflags */
  7 #define FS_COMMON_FL \
  8         (FS_SYNC_FL | FS_IMMUTABLE_FL | FS_APPEND_FL | \
  9          FS_NODUMP_FL | FS_NOATIME_FL | FS_DAX_FL | \
 10          FS_PROJINHERIT_FL)
 11 
 12 #define FS_XFLAG_COMMON \
 13         (FS_XFLAG_SYNC | FS_XFLAG_IMMUTABLE | FS_XFLAG_APPEND | \
 14          FS_XFLAG_NODUMP | FS_XFLAG_NOATIME | FS_XFLAG_DAX | \
 15          FS_XFLAG_PROJINHERIT)
 16 
 17 /*
 18  * Merged interface for miscellaneous file attributes.  'flags' originates from
 19  * ext* and 'fsx_flags' from xfs.  There's some overlap between the two, which
 20  * is handled by the VFS helpers, so filesystems are free to implement just one
 21  * or both of these sub-interfaces.
 22  */
 23 struct fileattr {
 24         u32     flags;          /* flags (FS_IOC_GETFLAGS/FS_IOC_SETFLAGS) */
 25         /* struct fsxattr: */
 26         u32     fsx_xflags;     /* xflags field value (get/set) */
 27         u32     fsx_extsize;    /* extsize field value (get/set)*/
 28         u32     fsx_nextents;   /* nextents field value (get)   */
 29         u32     fsx_projid;     /* project identifier (get/set) */
 30         u32     fsx_cowextsize; /* CoW extsize field value (get/set)*/
 31         /* selectors: */
 32         bool    flags_valid:1;
 33         bool    fsx_valid:1;
 34 };
 35 
 36 int copy_fsxattr_to_user(const struct fileattr *fa, struct fsxattr __user *ufa);
 37 
 38 void fileattr_fill_xflags(struct fileattr *fa, u32 xflags);
 39 void fileattr_fill_flags(struct fileattr *fa, u32 flags);
 40 
 41 /**
 42  * fileattr_has_fsx - check for extended flags/attributes
 43  * @fa:         fileattr pointer
 44  *
 45  * Return: true if any attributes are present that are not represented in
 46  * ->flags.
 47  */
 48 static inline bool fileattr_has_fsx(const struct fileattr *fa)
 49 {
 50         return fa->fsx_valid &&
 51                 ((fa->fsx_xflags & ~FS_XFLAG_COMMON) || fa->fsx_extsize != 0 ||
 52                  fa->fsx_projid != 0 || fa->fsx_cowextsize != 0);
 53 }
 54 
 55 int vfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
 56 int vfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry,
 57                      struct fileattr *fa);
 58 
 59 #endif /* _LINUX_FILEATTR_H */
 60 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php