Whamcloud - gitweb
LU-13826 utils: fix compatibility for LL_IOC_MDC_GETINFO
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_user.h
index 25ff63c..e3553cf 100644 (file)
@@ -50,6 +50,7 @@
 #include <linux/types.h>
 #include <linux/unistd.h>
 #include <linux/lustre/lustre_fiemap.h>
+#include <linux/lustre/lustre_ver.h>
 
 #ifndef __KERNEL__
 # define __USE_ISOC99  1
@@ -244,8 +245,6 @@ struct statx {
 
 typedef struct statx lstatx_t;
 
-#define HAVE_LOV_USER_MDS_DATA
-
 #define LUSTRE_EOF 0xffffffffffffffffULL
 
 /* for statfs() */
@@ -648,8 +647,6 @@ struct fsxattr {
 #define FS_IOC_FSGETXATTR              _IOR('X', 31, struct fsxattr)
 #define FS_IOC_FSSETXATTR              _IOW('X', 32, struct fsxattr)
 #endif
-#define LL_IOC_FSGETXATTR              FS_IOC_FSGETXATTR
-#define LL_IOC_FSSETXATTR              FS_IOC_FSSETXATTR
 #ifndef FS_XFLAG_PROJINHERIT
 #define FS_XFLAG_PROJINHERIT           0x00000200
 #endif
@@ -662,12 +659,12 @@ struct fsxattr {
 #define IOC_MDC_TYPE           'i'
 #define IOC_MDC_LOOKUP         _IOWR(IOC_MDC_TYPE, 20, struct obd_device *)
 #define IOC_MDC_GETFILESTRIPE  _IOWR(IOC_MDC_TYPE, 21, struct lov_user_md *)
-#ifdef HAVE_LOV_USER_MDS_DATA
-#define IOC_MDC_GETFILEINFO_OLD        _IOWR(IOC_MDC_TYPE, 22, struct lov_user_mds_data_v1 *)
-#define IOC_MDC_GETFILEINFO    _IOWR(IOC_MDC_TYPE, 22, struct lov_user_mds_data)
-#define LL_IOC_MDC_GETINFO_OLD _IOWR(IOC_MDC_TYPE, 23, struct lov_user_mds_data_v1 *)
-#define LL_IOC_MDC_GETINFO     _IOWR(IOC_MDC_TYPE, 23, struct lov_user_mds_data)
-#endif
+#define IOC_MDC_GETFILEINFO_V1 _IOWR(IOC_MDC_TYPE, 22, struct lov_user_mds_data_v1 *)
+#define IOC_MDC_GETFILEINFO_V2 _IOWR(IOC_MDC_TYPE, 22, struct lov_user_mds_data)
+#define LL_IOC_MDC_GETINFO_V1  _IOWR(IOC_MDC_TYPE, 23, struct lov_user_mds_data_v1 *)
+#define LL_IOC_MDC_GETINFO_V2  _IOWR(IOC_MDC_TYPE, 23, struct lov_user_mds_data)
+#define IOC_MDC_GETFILEINFO    IOC_MDC_GETFILEINFO_V1
+#define LL_IOC_MDC_GETINFO     LL_IOC_MDC_GETINFO_V1
 
 #define MAX_OBD_NAME 128 /* If this changes, a NEW ioctl must be added */
 
@@ -689,7 +686,6 @@ struct fsxattr {
 #define LL_FILE_GROUP_LOCKED    0x00000002
 #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
@@ -970,7 +966,6 @@ static inline __u32 lov_user_md_size(__u16 stripes, __u32 lmm_magic)
 /* Compile with -D_LARGEFILE64_SOURCE or -D_GNU_SOURCE (or #define) to
  * use this.  It is unsafe to #define those values in this header as it
  * is possible the application has already #included <sys/stat.h>. */
-#ifdef HAVE_LOV_USER_MDS_DATA
 #define lov_user_mds_data lov_user_mds_data_v2
 struct lov_user_mds_data_v1 {
        lstat_t lmd_st;                 /* MDS stat struct */
@@ -985,7 +980,6 @@ struct lov_user_mds_data_v2 {
        __u32 lmd_padding;              /* unused */
        struct lov_user_md_v1 lmd_lmm;  /* LOV EA user data */
 } __attribute__((packed));
-#endif
 
 struct lmv_user_mds_data {
        struct lu_fid   lum_fid;
@@ -1290,7 +1284,6 @@ static inline const char *qtype_name(int qtype)
 }
 
 #define IDENTITY_DOWNCALL_MAGIC 0x6d6dd629
-#define SEPOL_DOWNCALL_MAGIC 0x8b8bb842
 
 /* permission */
 #define N_PERMS_MAX      64
@@ -1312,12 +1305,25 @@ struct identity_downcall_data {
        __u32                            idd_groups[0];
 };
 
-struct sepol_downcall_data {
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 16, 53, 0)
+/* old interface struct is deprecated in 2.14 */
+#define SEPOL_DOWNCALL_MAGIC_OLD 0x8b8bb842
+struct sepol_downcall_data_old {
        __u32           sdd_magic;
        __s64           sdd_sepol_mtime;
        __u16           sdd_sepol_len;
        char            sdd_sepol[0];
 };
+#endif
+
+#define SEPOL_DOWNCALL_MAGIC 0x8b8bb843
+struct sepol_downcall_data {
+       __u32           sdd_magic;
+       __u16           sdd_sepol_len;
+       __u16           sdd_padding1;
+       __s64           sdd_sepol_mtime;
+       char            sdd_sepol[0];
+};
 
 #ifdef NEED_QUOTA_DEFS
 #ifndef QIF_BLIMITS
@@ -1355,9 +1361,9 @@ struct obd_dqinfo {
 
 /* XXX: same as if_dqblk struct in kernel, plus one padding */
 struct obd_dqblk {
-       __u64 dqb_bhardlimit;
-       __u64 dqb_bsoftlimit;
-       __u64 dqb_curspace;
+       __u64 dqb_bhardlimit;   /* kbytes unit */
+       __u64 dqb_bsoftlimit;   /* kbytes unit */
+       __u64 dqb_curspace;     /* bytes unit */
        __u64 dqb_ihardlimit;
        __u64 dqb_isoftlimit;
        __u64 dqb_curinodes;
@@ -2435,31 +2441,6 @@ struct hsm_copy {
        struct hsm_action_item  hc_hai;
 };
 
-/* JSON objects */
-enum llapi_json_types {
-       LLAPI_JSON_INTEGER = 1,
-       LLAPI_JSON_BIGNUM,
-       LLAPI_JSON_REAL,
-       LLAPI_JSON_STRING
-};
-
-struct llapi_json_item {
-       char                    *lji_key;
-       __u32                   lji_type;
-       union {
-               int     lji_integer;
-               __u64   lji_u64;
-               double  lji_real;
-               char    *lji_string;
-       };
-       struct llapi_json_item  *lji_next;
-};
-
-struct llapi_json_item_list {
-       int                     ljil_item_count;
-       struct llapi_json_item  *ljil_items;
-};
-
 enum lu_ladvise_type {
        LU_LADVISE_INVALID      = 0,
        LU_LADVISE_WILLREAD     = 1,