Whamcloud - gitweb
LU-6179 llite: remove LOCKAHEAD_OLD compatibility
[fs/lustre-release.git] / lustre / include / uapi / linux / lustre / lustre_idl.h
index df2ce2b..1402fbb 100644 (file)
 
 #include <asm/byteorder.h>
 #include <linux/errno.h>
+#include <linux/fiemap.h>
 #include <linux/types.h>
-
 /*
  * This is due to us being out of kernel and the way the OpenSFS branch
  * handles CFLAGS.
  */
 #ifdef __KERNEL__
 # include <uapi/linux/lnet/lnet-types.h>
-# include <uapi/linux/lustre/lustre_user.h> /* Defn's shared with user-space. */
-# include <uapi/linux/lustre/lustre_ver.h>
 #else
 # include <linux/lnet/lnet-types.h>
-# include <linux/lustre/lustre_user.h>
-# include <linux/lustre/lustre_ver.h>
 #endif
+#include <linux/lustre/lustre_user.h>
+#include <linux/lustre/lustre_ver.h>
 
 #if defined(__cplusplus)
 extern "C" {
@@ -528,12 +526,12 @@ static inline struct lu_dirent *lu_dirent_next(struct lu_dirent *ent)
        return next;
 }
 
-static inline size_t lu_dirent_calc_size(size_t namelen, __u16 attr)
+static inline __kernel_size_t lu_dirent_calc_size(size_t namelen, __u16 attr)
 {
-       size_t size;
+       __kernel_size_t size;
 
        if (attr & LUDA_TYPE) {
-               const size_t align = sizeof(struct luda_type) - 1;
+               const __kernel_size_t align = sizeof(struct luda_type) - 1;
 
                size = (sizeof(struct lu_dirent) + namelen + 1 + align) &
                       ~align;
@@ -818,7 +816,7 @@ struct ptlrpc_body_v2 {
                                                         RPCs in parallel */
 #define OBD_CONNECT_DIR_STRIPE  0x400000000000000ULL /* striped DNE dir */
 #define OBD_CONNECT_SUBTREE    0x800000000000000ULL /* fileset mount */
-#define OBD_CONNECT_LOCKAHEAD_OLD 0x1000000000000000ULL /* Old Cray lockahead */
+/* was OBD_CONNECT_LOCKAHEAD_OLD 0x1000000000000000ULL old lockahead 2.12-2.13*/
 
 /** bulk matchbits is sent within ptlrpc_body */
 #define OBD_CONNECT_BULK_MBITS  0x2000000000000000ULL
@@ -902,7 +900,8 @@ struct ptlrpc_body_v2 {
                                OBD_CONNECT2_SELINUX_POLICY | \
                                OBD_CONNECT2_LSOM | \
                                OBD_CONNECT2_ASYNC_DISCARD | \
-                               OBD_CONNECT2_PCC)
+                               OBD_CONNECT2_PCC | \
+                               OBD_CONNECT2_CRUSH)
 
 #define OST_CONNECT_SUPPORTED  (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \
                                OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \
@@ -1048,9 +1047,10 @@ enum ost_cmd {
         OST_SYNC       = 16,
         OST_SET_INFO   = 17,
        OST_QUOTACHECK = 18, /* not used since 2.4 */
-        OST_QUOTACTL   = 19,
+       OST_QUOTACTL   = 19,
        OST_QUOTA_ADJUST_QUNIT = 20, /* not used since 2.4 */
        OST_LADVISE    = 21,
+       OST_FALLOCATE  = 22,
        OST_LAST_OPC /* must be < 33 to avoid MDS_GETATTR */
 };
 #define OST_FIRST_OPC  OST_REPLY
@@ -1225,7 +1225,7 @@ static inline __u32 lov_mds_md_size(__u16 stripes, __u32 lmm_magic)
 }
 
 static inline __u32
-lov_mds_md_max_stripe_count(size_t buf_size, __u32 lmm_magic)
+lov_mds_md_max_stripe_count(__kernel_size_t buf_size, __u32 lmm_magic)
 {
        switch (lmm_magic) {
        case LOV_MAGIC_V1: {
@@ -1371,6 +1371,7 @@ struct hsm_state_set {
                                      * space for unstable pages; asking
                                      * it to sync quickly */
 #define OBD_BRW_OVER_PRJQUOTA 0x8000 /* Running out of project quota */
+#define OBD_BRW_RDMA_ONLY    0x20000 /* RPC contains RDMA-only pages*/
 
 #define OBD_BRW_OVER_ALLQUOTA (OBD_BRW_OVER_USRQUOTA | \
                               OBD_BRW_OVER_GRPQUOTA | \
@@ -2223,6 +2224,13 @@ struct lmv_mds_md_v1 {
        struct lu_fid lmv_stripe_fids[0];       /* FIDs for each stripe */
 };
 
+#define LMV_DEBUG(mask, lmv, msg)                                      \
+       CDEBUG(mask, "%s LMV: magic %#x count %u index %u hash %#x version %u migrate offset %u migrate hash %u.\n",    \
+              msg, (lmv)->lmv_magic, (lmv)->lmv_stripe_count,          \
+              (lmv)->lmv_master_mdt_index, (lmv)->lmv_hash_type,       \
+              (lmv)->lmv_layout_version, (lmv)->lmv_migrate_offset,    \
+              (lmv)->lmv_migrate_hash)
+
 /* foreign LMV EA */
 struct lmv_foreign_md {
        __u32 lfm_magic;        /* magic number = LMV_MAGIC_FOREIGN */
@@ -2253,11 +2261,11 @@ struct lmv_foreign_md {
  **/
 #define LUSTRE_FNV_1A_64_PRIME 0x100000001b3ULL
 #define LUSTRE_FNV_1A_64_OFFSET_BIAS 0xcbf29ce484222325ULL
-static inline __u64 lustre_hash_fnv_1a_64(const void *buf, size_t size)
+static inline __u64 lustre_hash_fnv_1a_64(const void *buf, __kernel_size_t size)
 {
        __u64 hash = LUSTRE_FNV_1A_64_OFFSET_BIAS;
        const unsigned char *p = buf;
-       size_t i;
+       __kernel_size_t i;
 
        for (i = 0; i < size; i++) {
                hash ^= p[i];
@@ -2267,6 +2275,9 @@ static inline __u64 lustre_hash_fnv_1a_64(const void *buf, size_t size)
        return hash;
 }
 
+/* CRUSH placement group count */
+#define LMV_CRUSH_PG_COUNT     4096
+
 union lmv_mds_md {
        __u32                    lmv_magic;
        struct lmv_mds_md_v1     lmv_md_v1;
@@ -2558,15 +2569,6 @@ enum mgs_cmd {
        MGS_FIRST_OPC   = MGS_CONNECT
 };
 
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 13, 53, 0)
-#define MGS_PARAM_MAXLEN 1024
-#define KEY_SET_INFO "set_info"
-
-struct mgs_send_param {
-        char             mgs_param[MGS_PARAM_MAXLEN];
-};
-#endif
-
 /* We pass this info to the MGS so it can write config logs */
 #define MTI_NAME_MAXLEN  64
 #define MTI_PARAM_MAXLEN 4096
@@ -3084,6 +3086,7 @@ struct obdo {
 #define o_dropped o_misc
 #define o_cksum   o_nlink
 #define o_grant_used o_data_version
+#define o_falloc_mode o_nlink
 
 struct lfsck_request {
        __u32           lr_event;
@@ -3245,67 +3248,6 @@ enum sec_cmd {
         SEC_FIRST_OPC           = SEC_CTX_INIT
 };
 
-/*
- * capa related definitions
- */
-#define CAPA_HMAC_MAX_LEN       64
-#define CAPA_HMAC_KEY_MAX_LEN   56
-
-/* NB take care when changing the sequence of elements this struct,
- * because the offset info is used in find_capa() */
-struct lustre_capa {
-        struct lu_fid   lc_fid;         /** fid */
-        __u64           lc_opc;         /** operations allowed */
-        __u64           lc_uid;         /** file owner */
-        __u64           lc_gid;         /** file group */
-        __u32           lc_flags;       /** HMAC algorithm & flags */
-        __u32           lc_keyid;       /** key# used for the capability */
-        __u32           lc_timeout;     /** capa timeout value (sec) */
-        __u32           lc_expiry;      /** expiry time (sec) */
-        __u8            lc_hmac[CAPA_HMAC_MAX_LEN];   /** HMAC */
-} __attribute__((packed));
-
-/** lustre_capa::lc_opc */
-enum {
-        CAPA_OPC_BODY_WRITE   = 1<<0,  /**< write object data */
-        CAPA_OPC_BODY_READ    = 1<<1,  /**< read object data */
-        CAPA_OPC_INDEX_LOOKUP = 1<<2,  /**< lookup object fid */
-        CAPA_OPC_INDEX_INSERT = 1<<3,  /**< insert object fid */
-        CAPA_OPC_INDEX_DELETE = 1<<4,  /**< delete object fid */
-        CAPA_OPC_OSS_WRITE    = 1<<5,  /**< write oss object data */
-        CAPA_OPC_OSS_READ     = 1<<6,  /**< read oss object data */
-        CAPA_OPC_OSS_TRUNC    = 1<<7,  /**< truncate oss object */
-        CAPA_OPC_OSS_DESTROY  = 1<<8,  /**< destroy oss object */
-        CAPA_OPC_META_WRITE   = 1<<9,  /**< write object meta data */
-        CAPA_OPC_META_READ    = 1<<10, /**< read object meta data */
-};
-
-#define CAPA_OPC_OSS_RW (CAPA_OPC_OSS_READ | CAPA_OPC_OSS_WRITE)
-#define CAPA_OPC_MDS_ONLY                                                   \
-        (CAPA_OPC_BODY_WRITE | CAPA_OPC_BODY_READ | CAPA_OPC_INDEX_LOOKUP | \
-         CAPA_OPC_INDEX_INSERT | CAPA_OPC_INDEX_DELETE)
-#define CAPA_OPC_OSS_ONLY                                                   \
-        (CAPA_OPC_OSS_WRITE | CAPA_OPC_OSS_READ | CAPA_OPC_OSS_TRUNC |      \
-         CAPA_OPC_OSS_DESTROY)
-#define CAPA_OPC_MDS_DEFAULT ~CAPA_OPC_OSS_ONLY
-#define CAPA_OPC_OSS_DEFAULT ~(CAPA_OPC_MDS_ONLY | CAPA_OPC_OSS_ONLY)
-
-/* lustre_capa::lc_hmac_alg */
-enum {
-        CAPA_HMAC_ALG_SHA1 = 1, /**< sha1 algorithm */
-        CAPA_HMAC_ALG_MAX,
-};
-
-#define CAPA_FL_MASK            0x00ffffff
-#define CAPA_HMAC_ALG_MASK      0xff000000
-
-struct lustre_capa_key {
-        __u64   lk_seq;       /**< mds# */
-        __u32   lk_keyid;     /**< key# */
-        __u32   lk_padding;
-        __u8    lk_key[CAPA_HMAC_KEY_MAX_LEN];    /**< key */
-} __attribute__((packed));
-
 /** The link ea holds 1 \a link_ea_entry for each hardlink */
 #define LINK_EA_MAGIC 0x11EAF1DFUL
 struct link_ea_header {