# include <linux/lustre/lustre_ver.h>
#endif
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
/*
* GENERAL STUFF
*/
#define MDC_REPLY_PORTAL 10
//#define MDC_BULK_PORTAL 11
#define MDS_REQUEST_PORTAL 12
-//#define MDS_REPLY_PORTAL 13
+#define MDS_IO_PORTAL 13
#define MDS_BULK_PORTAL 14
#define LDLM_CB_REQUEST_PORTAL 15
#define LDLM_CB_REPLY_PORTAL 16
#define MSG_CONNECT_RECOVERING 0x00000001
#define MSG_CONNECT_RECONNECT 0x00000002
#define MSG_CONNECT_REPLAYABLE 0x00000004
-//#define MSG_CONNECT_PEER 0x8
+/* #define MSG_CONNECT_PEER 0x00000008 removed 1.5 */
#define MSG_CONNECT_LIBCLIENT 0x00000010
#define MSG_CONNECT_INITIAL 0x00000020
#define MSG_CONNECT_ASYNC 0x00000040
#define OBD_CONNECT_LARGE_ACL 0x200ULL /* more than 32 ACL entries */
#define OBD_CONNECT_TRUNCLOCK 0x400ULL /*locks on server for punch */
#define OBD_CONNECT_TRANSNO 0x800ULL /*replay sends init transno */
-#define OBD_CONNECT_IBITS 0x1000ULL /*support for inodebits locks*/
+#define OBD_CONNECT_IBITS 0x1000ULL /* not checked in 2.11+ */
#define OBD_CONNECT_BARRIER 0x2000ULL /* write barrier */
#define OBD_CONNECT_ATTRFID 0x4000ULL /*Server can GetAttr By Fid*/
#define OBD_CONNECT_NODEVOH 0x8000ULL /*No open hndl on specl nodes*/
OBD_CONNECT_FLOCK_DEAD | \
OBD_CONNECT_DISP_STRIPE | OBD_CONNECT_LFSCK | \
OBD_CONNECT_OPEN_BY_FID | \
- OBD_CONNECT_DIR_STRIPE | \
- OBD_CONNECT_BULK_MBITS | \
+ OBD_CONNECT_DIR_STRIPE | OBD_CONNECT_GRANT | \
+ OBD_CONNECT_TRUNCLOCK | OBD_CONNECT_SRVLOCK | \
+ OBD_CONNECT_BULK_MBITS | OBD_CONNECT_CKSUM | \
OBD_CONNECT_MULTIMODRPCS | \
OBD_CONNECT_SUBTREE | OBD_CONNECT_LARGE_ACL | \
+ OBD_CONNECT_GRANT_PARAM | \
OBD_CONNECT_FLAGS2)
#define MDT_CONNECT_SUPPORTED2 OBD_CONNECT2_FILE_SECCTX
#define MGS_CONNECT_SUPPORTED2 0
/* Features required for this version of the client to work with server */
-#define CLIENT_CONNECT_MDT_REQD (OBD_CONNECT_IBITS | OBD_CONNECT_FID | \
- OBD_CONNECT_FULL20)
+#define CLIENT_CONNECT_MDT_REQD (OBD_CONNECT_FID | \
+ OBD_CONNECT_ATTRFID | \
+ OBD_CONNECT_FULL20)
/* This structure is used for both request and reply.
*
* those *_DEF magics are only used on server side internally, they
* won't be put on wire or disk.
*/
-#define LOV_MAGIC_DEF 0x10000000
-#define LOV_MAGIC_V1_DEF (LOV_MAGIC_DEF | LOV_MAGIC_V1)
-#define LOV_MAGIC_V3_DEF (LOV_MAGIC_DEF | LOV_MAGIC_V3)
-#define LOV_MAGIC_COMP_V1_DEF (LOV_MAGIC_DEF | LOV_MAGIC_COMP_V1)
+#define LOV_MAGIC_DEFINED 0x10000000
+#define LOV_MAGIC_V1_DEFINED (LOV_MAGIC_DEFINED | LOV_MAGIC_V1)
+#define LOV_MAGIC_V3_DEFINED (LOV_MAGIC_DEFINED | LOV_MAGIC_V3)
+#define LOV_MAGIC_COMP_V1_DEFINED (LOV_MAGIC_DEFINED | LOV_MAGIC_COMP_V1)
#define lov_pattern(pattern) (pattern & ~LOV_PATTERN_F_MASK)
#define lov_pattern_flags(pattern) (pattern & LOV_PATTERN_F_MASK)
#define XATTR_TRUSTED_PREFIX "trusted."
#define XATTR_SECURITY_PREFIX "security."
+#define XATTR_NAME_SOM "trusted.som"
#define XATTR_NAME_LOV "trusted.lov"
#define XATTR_NAME_LMA "trusted.lma"
#define XATTR_NAME_LMV "trusted.lmv"
#define OBD_MD_FLUID (0x00000200ULL) /* user ID */
#define OBD_MD_FLGID (0x00000400ULL) /* group ID */
#define OBD_MD_FLFLAGS (0x00000800ULL) /* flags word */
+#define OBD_MD_DOM_SIZE (0X00001000ULL) /* Data-on-MDT component size */
#define OBD_MD_FLNLINK (0x00002000ULL) /* link count */
#define OBD_MD_FLGENER (0x00004000ULL) /* generation number */
-/*#define OBD_MD_FLINLINE (0x00008000ULL) inline data. used until 1.6.5 */
+#define OBD_MD_LAYOUT_VERSION (0x00008000ULL) /* layout version for
+ * OST objects */
#define OBD_MD_FLRDEV (0x00010000ULL) /* device number */
#define OBD_MD_FLEASIZE (0x00020000ULL) /* extended attribute data */
#define OBD_MD_LINKNAME (0x00040000ULL) /* symbolic link target */
#define OBD_BRW_READ 0x01
#define OBD_BRW_WRITE 0x02
#define OBD_BRW_RWMASK (OBD_BRW_READ | OBD_BRW_WRITE)
+#define OBD_BRW_NDELAY 0x04 /* Non-delay RPC should be issued for
+ * this page. Non-delay RPCs have bit
+ * rq_no_delay set. */
#define OBD_BRW_SYNC 0x08 /* this page is a part of synchronous
* transfer and is not accounted in
* the grant. */
OBD_BRW_OVER_GRPQUOTA | \
OBD_BRW_OVER_PRJQUOTA)
+#define OBD_BRW_LOCAL1 0x80000000UL /*
+ * osd-ldiskfs internal,
+ * page mapped to real block
+ */
+
+#define OBD_BRW_LOCALS (OBD_BRW_LOCAL1)
+
#define OBD_OBJECT_EOF LUSTRE_EOF
#define OST_MIN_PRECREATE 32
struct lu_fid qid_fid; /* FID for per-directory quota */
__u64 qid_uid; /* user identifier */
__u64 qid_gid; /* group identifier */
+ __u64 qid_projid; /* project identifier */
};
/* quotactl management */
* Do not exceed 63
*/
-typedef enum {
+enum mds_reint_op {
REINT_SETATTR = 1,
REINT_CREATE = 2,
REINT_LINK = 3,
REINT_SETXATTR = 7,
REINT_RMENTRY = 8,
REINT_MIGRATE = 9,
- REINT_MAX
-} mds_reint_t, mdt_reint_t;
+ REINT_RESYNC = 10,
+ REINT_MAX
+};
/* the disposition of the intent outlines what was executed */
#define DISP_IT_EXECD 0x00000001
* will grant LOOKUP_LOCK. */
#define MDS_INODELOCK_PERM 0x000010
#define MDS_INODELOCK_XATTR 0x000020 /* extended attributes */
+#define MDS_INODELOCK_DOM 0x000040 /* Data for data-on-mdt files */
-#define MDS_INODELOCK_MAXSHIFT 5
+#define MDS_INODELOCK_MAXSHIFT 6
/* This FULL lock is useful to take on unlink sort of operations */
#define MDS_INODELOCK_FULL ((1<<(MDS_INODELOCK_MAXSHIFT+1))-1)
+/* DOM lock shouldn't be canceled early, use this macro for ELC */
+#define MDS_INODELOCK_ELC (MDS_INODELOCK_FULL & ~MDS_INODELOCK_DOM)
/* NOTE: until Lustre 1.8.7/2.1.1 the fid_ver() was packed into name[2],
* but was moved into name[1] along with the OID to avoid consuming the
__u32 mbo_uid_h; /* high 32-bits of uid, for FUID */
__u32 mbo_gid_h; /* high 32-bits of gid, for FUID */
__u32 mbo_projid;
- __u64 mbo_padding_6; /* also fix lustre_swab_mdt_body */
- __u64 mbo_padding_7;
- __u64 mbo_padding_8;
+ __u64 mbo_dom_size; /* size of DOM component */
+ __u64 mbo_dom_blocks; /* blocks consumed by DOM component */
+ __u64 mbo_padding_8; /* also fix lustre_swab_mdt_body */
__u64 mbo_padding_9;
__u64 mbo_padding_10;
}; /* 216 */
*/
#define MDS_OPEN_RELEASE 02000000000000ULL /* Open the file for HSM release */
+#define MDS_OPEN_RESYNC 04000000000000ULL /* FLR: file resync */
+
/* 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_RELEASE | MDS_OPEN_RESYNC)
enum mds_op_bias {
MDS_CHECK_SPLIT = 1 << 0,
MDS_HSM_RELEASE = 1 << 12,
MDS_RENAME_MIGRATE = 1 << 13,
MDS_CLOSE_LAYOUT_SWAP = 1 << 14,
+ MDS_CLOSE_LAYOUT_MERGE = 1 << 15,
+ MDS_CLOSE_RESYNC_DONE = 1 << 16,
};
+#define MDS_CLOSE_INTENT (MDS_HSM_RELEASE | MDS_CLOSE_LAYOUT_SWAP | \
+ MDS_CLOSE_LAYOUT_MERGE | MDS_CLOSE_RESYNC_DONE)
+
/* instance of mdt_reint_rec */
struct mdt_rec_create {
__u32 cr_opcode;
__u32 sx_padding_11; /* rr_padding_4 */
};
+/* instance of mdt_reint_rec
+ * FLR: for file resync MDS_REINT_RESYNC RPC. */
+struct mdt_rec_resync {
+ __u32 rs_opcode;
+ __u32 rs_cap;
+ __u32 rs_fsuid;
+ __u32 rs_fsuid_h;
+ __u32 rs_fsgid;
+ __u32 rs_fsgid_h;
+ __u32 rs_suppgid1;
+ __u32 rs_suppgid1_h;
+ __u32 rs_suppgid2;
+ __u32 rs_suppgid2_h;
+ struct lu_fid rs_fid;
+ __u8 rs_padding0[sizeof(struct lu_fid)];
+ struct lustre_handle rs_handle; /* rr_mtime */
+ __s64 rs_padding1; /* rr_atime */
+ __s64 rs_padding2; /* rr_ctime */
+ __u64 rs_padding3; /* rr_size */
+ __u64 rs_padding4; /* rr_blocks */
+ __u32 rs_bias;
+ __u32 rs_padding5; /* rr_mode */
+ __u32 rs_padding6; /* rr_flags */
+ __u32 rs_padding7; /* rr_flags_h */
+ __u32 rs_padding8; /* rr_umask */
+ __u32 rs_padding9; /* rr_padding_4 */
+};
+
/*
* mdt_rec_reint is the template for all mdt_reint_xxx structures.
* Do NOT change the size of various members, otherwise the value
/* lmv structures */
struct lmv_desc {
- __u32 ld_tgt_count; /* how many MDS's */
- __u32 ld_active_tgt_count; /* how many active */
- __u32 ld_default_stripe_count; /* how many objects are used */
- __u32 ld_pattern; /* default hash pattern */
- __u64 ld_default_hash_size;
- __u64 ld_padding_1; /* also fix lustre_swab_lmv_desc */
- __u32 ld_padding_2; /* also fix lustre_swab_lmv_desc */
- __u32 ld_qos_maxage; /* in second */
- __u32 ld_padding_3; /* also fix lustre_swab_lmv_desc */
- __u32 ld_padding_4; /* also fix lustre_swab_lmv_desc */
- struct obd_uuid ld_uuid;
+ __u32 ld_tgt_count; /* how many MDS's */
+ __u32 ld_active_tgt_count; /* how many active */
+ __u32 ld_default_stripe_count; /* how many objects are used */
+ __u32 ld_pattern; /* default hash pattern */
+ __u64 ld_default_hash_size;
+ __u64 ld_padding_1; /* also fix lustre_swab_lmv_desc */
+ __u32 ld_padding_2; /* also fix lustre_swab_lmv_desc */
+ __u32 ld_qos_maxage; /* in second */
+ __u32 ld_padding_3; /* also fix lustre_swab_lmv_desc */
+ __u32 ld_padding_4; /* also fix lustre_swab_lmv_desc */
+ struct obd_uuid ld_uuid;
};
/* LMV layout EA, and it will be stored both in master and slave object */
#define LMV_HASH_FLAG_MIGRATION 0x80000000
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 10, 56, 0)
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 11, 56, 0)
/* Since lustre 2.8, this flag will not be needed, instead this DEAD
* and orphan flags will be stored in LMA (see LMAI_ORPHAN)
* Keep this flag just for LFSCK, because it still might meet such
/* LOV settings descriptor (should only contain static info) */
struct lov_desc {
- __u32 ld_tgt_count; /* how many OBD's */
- __u32 ld_active_tgt_count; /* how many active */
- __u32 ld_default_stripe_count; /* how many objects are used */
- __u32 ld_pattern; /* default PATTERN_RAID0 */
- __u64 ld_default_stripe_size; /* in bytes */
- __u64 ld_default_stripe_offset; /* in bytes */
- __u32 ld_padding_0; /* unused */
- __u32 ld_qos_maxage; /* in second */
- __u32 ld_padding_1; /* also fix lustre_swab_lov_desc */
- __u32 ld_padding_2; /* also fix lustre_swab_lov_desc */
- struct obd_uuid ld_uuid;
+ __u32 ld_tgt_count; /* how many OBD's */
+ __u32 ld_active_tgt_count; /* how many active */
+ __s32 ld_default_stripe_count; /* how many objects are used */
+ __u32 ld_pattern; /* default PATTERN_RAID0 */
+ __u64 ld_default_stripe_size; /* in bytes */
+ __s64 ld_default_stripe_offset; /* starting OST index */
+ __u32 ld_padding_0; /* unused */
+ __u32 ld_qos_maxage; /* in second */
+ __u32 ld_padding_1; /* also fix lustre_swab_lov_desc */
+ __u32 ld_padding_2; /* also fix lustre_swab_lov_desc */
+ struct obd_uuid ld_uuid;
};
#define ld_magic ld_active_tgt_count /* for swabbing from llogs */
IT_QUOTA_DQACQ = 0x00000800,
IT_QUOTA_CONN = 0x00001000,
IT_SETXATTR = 0x00002000,
+ IT_GLIMPSE = 0x00004000,
+ IT_BRW = 0x00008000,
};
struct ldlm_intent {
__u32 lsr_gid_h;
__u64 lsr_valid;
__u32 lsr_projid;
- __u32 lsr_padding1;
+ __u32 lsr_layout_version;
__u64 lsr_padding2;
__u64 lsr_padding3;
struct llog_rec_tail lsr_tail;
#define CHANGELOG_USER_PREFIX "cl"
struct llog_changelog_user_rec {
- struct llog_rec_hdr cur_hdr;
- __u32 cur_id;
- __u32 cur_padding;
- __u64 cur_endrec;
- struct llog_rec_tail cur_tail;
+ struct llog_rec_hdr cur_hdr;
+ __u32 cur_id;
+ /* only intended to be used in relative time comparisons to
+ * detect idle users */
+ __u32 cur_time;
+ __u64 cur_endrec;
+ struct llog_rec_tail cur_tail;
} __attribute__((packed));
enum agent_req_status {
LLOG_F_IS_PLAIN = 0x4,
LLOG_F_EXT_JOBID = 0x8,
LLOG_F_IS_FIXSIZE = 0x10,
+ LLOG_F_EXT_EXTRA_FLAGS = 0x20,
+ LLOG_F_EXT_X_UIDGID = 0x40,
/* Note: Flags covered by LLOG_F_EXT_MASK will be inherited from
* catlog to plain log, so do not add LLOG_F_IS_FIXSIZE here,
* because the catlog record is usually fixed size, but its plain
* log record can be variable */
- LLOG_F_EXT_MASK = LLOG_F_EXT_JOBID,
+ LLOG_F_EXT_MASK = LLOG_F_EXT_JOBID | LLOG_F_EXT_EXTRA_FLAGS |
+ LLOG_F_EXT_X_UIDGID,
};
/* On-disk header structure of each log object, stored in little endian order */
*
* sizeof(ost_layout) + sieof(__u32) == sizeof(llog_cookie). */
struct ost_layout o_layout;
- __u32 o_padding_3;
+ __u32 o_layout_version;
__u32 o_uid_h;
__u32 o_gid_h;
char gp_name[0]; /**< zero-terminated link name */
} __attribute__((packed));
-enum {
+enum layout_intent_opc {
LAYOUT_INTENT_ACCESS = 0, /** generic access */
LAYOUT_INTENT_READ = 1, /** not used */
LAYOUT_INTENT_WRITE = 2, /** write file, for comp layout */
struct layout_intent {
__u32 li_opc; /* intent operation for enqueue, read, write etc */
__u32 li_flags;
- __u64 li_start;
- __u64 li_end;
+ struct lu_extent li_extent;
} __attribute__((packed));
/**
*/
struct hsm_progress_kernel {
/* Field taken from struct hsm_progress */
- lustre_fid hpk_fid;
+ struct lu_fid hpk_fid;
__u64 hpk_cookie;
struct hsm_extent hpk_extent;
__u16 hpk_flags;
__u64 msl_flags;
} __attribute__((packed));
+#define INLINE_RESYNC_ARRAY_SIZE 15
+struct close_data_resync_done {
+ __u32 resync_count;
+ __u32 resync_ids_inline[INLINE_RESYNC_ARRAY_SIZE];
+};
+
struct close_data {
struct lustre_handle cd_handle;
struct lu_fid cd_fid;
__u64 cd_data_version;
- __u64 cd_reserved[8];
+ union {
+ __u64 cd_reserved[8];
+ struct close_data_resync_done cd_resync;
+ };
};
/* Update llog format */
struct lu_ladvise lah_advise[0]; /* advices in this header */
};
+#if defined(__cplusplus)
+}
+#endif
+
#endif
/** @} lustreidl */