Whamcloud - gitweb
LU-12349 llite: console message for disabled flock call
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_user.h
index 9ead0fc..66c8fd1 100644 (file)
@@ -132,6 +132,7 @@ enum obd_statfs_state {
        OS_STATE_ENOSPC         = 0x00000020, /**< not enough free space */
        OS_STATE_ENOINO         = 0x00000040, /**< not enough inodes */
        OS_STATE_SUM            = 0x00000100, /**< aggregated for all tagrets */
+       OS_STATE_NONROT         = 0x00000200, /**< non-rotational device */
 };
 
 /** filesystem statistics/attributes for target device */
@@ -392,6 +393,7 @@ enum ll_lease_flags {
        LL_LEASE_RESYNC_DONE    = 0x2,
        LL_LEASE_LAYOUT_MERGE   = 0x4,
        LL_LEASE_LAYOUT_SPLIT   = 0x8,
+       LL_LEASE_PCC_ATTACH     = 0x10,
 };
 
 #define IOC_IDS_MAX    4096
@@ -480,6 +482,9 @@ struct ll_ioc_lease_id {
 #define LL_IOC_LADVISE                 _IOR('f', 250, struct llapi_lu_ladvise)
 #define LL_IOC_HEAT_GET                        _IOWR('f', 251, struct lu_heat)
 #define LL_IOC_HEAT_SET                        _IOW('f', 251, __u64)
+#define LL_IOC_PCC_DETACH              _IOW('f', 252, struct lu_pcc_detach)
+#define LL_IOC_PCC_DETACH_BY_FID       _IOW('f', 252, struct lu_pcc_detach_fid)
+#define LL_IOC_PCC_STATE               _IOR('f', 252, struct lu_pcc_state)
 
 #ifndef        FS_IOC_FSGETXATTR
 /*
@@ -533,6 +538,7 @@ struct fsxattr {
 #define LL_FILE_READAHEA        0x00000004
 #define LL_FILE_LOCKED_DIRECTIO 0x00000008 /* client-side locks with dio */
 #define LL_FILE_LOCKLESS_IO     0x00000010 /* server-side locks with cio */
+#define LL_FILE_FLOCK_WARNING   0x00000020 /* warned about disabled flock */
 
 #define LOV_USER_MAGIC_V1      0x0BD10BD0
 #define LOV_USER_MAGIC         LOV_USER_MAGIC_V1
@@ -1213,12 +1219,15 @@ enum la_valid {
 #define MDS_OPEN_RELEASE   02000000000000ULL /* Open the file for HSM release */
 
 #define MDS_OPEN_RESYNC    04000000000000ULL /* FLR: file resync */
+#define MDS_OPEN_PCC      010000000000000ULL /* PCC: auto RW-PCC cache attach
+                                             * for newly created file */
 
 /* lustre internal open flags, which should not be set from user space */
 #define MDS_OPEN_FL_INTERNAL (MDS_OPEN_HAS_EA | MDS_OPEN_HAS_OBJS |    \
                              MDS_OPEN_OWNEROVERRIDE | MDS_OPEN_LOCK |  \
                              MDS_OPEN_BY_FID | MDS_OPEN_LEASE |        \
-                             MDS_OPEN_RELEASE | MDS_OPEN_RESYNC)
+                             MDS_OPEN_RELEASE | MDS_OPEN_RESYNC |      \
+                             MDS_OPEN_PCC)
 
 
 /********* Changelogs **********/
@@ -2293,6 +2302,62 @@ struct lu_heat {
        __u64 lh_heat[0];
 };
 
+enum lu_pcc_type {
+       LU_PCC_NONE = 0,
+       LU_PCC_READWRITE,
+       LU_PCC_MAX
+};
+
+static inline const char *pcc_type2string(enum lu_pcc_type type)
+{
+       switch (type) {
+       case LU_PCC_NONE:
+               return "none";
+       case LU_PCC_READWRITE:
+               return "readwrite";
+       default:
+               return "fault";
+       }
+}
+
+struct lu_pcc_attach {
+       __u32 pcca_type; /* PCC type */
+       __u32 pcca_id; /* archive ID for readwrite, group ID for readonly */
+};
+
+enum lu_pcc_detach_opts {
+       PCC_DETACH_OPT_NONE = 0, /* Detach only, keep the PCC copy */
+       PCC_DETACH_OPT_UNCACHE, /* Remove the cached file after detach */
+};
+
+struct lu_pcc_detach_fid {
+       /* fid of the file to detach */
+       struct lu_fid   pccd_fid;
+       __u32           pccd_opt;
+};
+
+struct lu_pcc_detach {
+       __u32           pccd_opt;
+};
+
+enum lu_pcc_state_flags {
+       PCC_STATE_FL_NONE               = 0x0,
+       /* The inode attr is cached locally */
+       PCC_STATE_FL_ATTR_VALID         = 0x01,
+       /* The file is being attached into PCC */
+       PCC_STATE_FL_ATTACHING          = 0x02,
+       /* Allow to auto attach at open */
+       PCC_STATE_FL_OPEN_ATTACH        = 0x04,
+};
+
+struct lu_pcc_state {
+       __u32   pccs_type; /* enum lu_pcc_type */
+       __u32   pccs_open_count;
+       __u32   pccs_flags; /* enum lu_pcc_state_flags */
+       __u32   pccs_padding;
+       char    pccs_path[PATH_MAX];
+};
+
 #if defined(__cplusplus)
 }
 #endif