#define OBD_CONNECT2_LOCKAHEAD 0x2ULL /* ladvise lockahead v2 */
#define OBD_CONNECT2_DIR_MIGRATE 0x4ULL /* migrate striped dir */
#define OBD_CONNECT2_SUM_STATFS 0x8ULL /* MDT return aggregated stats */
+#define OBD_CONNECT2_OVERSTRIPING 0x10ULL /* OST overstriping support */
#define OBD_CONNECT2_FLR 0x20ULL /* FLR support */
#define OBD_CONNECT2_WBC_INTENTS 0x40ULL /* create/unlink/... intents for wbc, also operations under client-held parent locks */
#define OBD_CONNECT2_LOCK_CONVERT 0x80ULL /* IBITS lock convert support */
#define OBD_CONNECT2_ARCHIVE_ID_ARRAY 0x100ULL /* store HSM archive_id in array */
+#define OBD_CONNECT2_INC_XID 0x200ULL /* Increasing xid */
#define OBD_CONNECT2_SELINUX_POLICY 0x400ULL /* has client SELinux policy */
#define OBD_CONNECT2_LSOM 0x800ULL /* LSOM support */
#define OBD_CONNECT2_PCC 0x1000ULL /* Persistent Client Cache */
-#define OBD_CONNECT2_PLAIN_LAYOUT 0x2000ULL /* Plain Directory Layout */
+#define OBD_CONNECT2_ASYNC_DISCARD 0x4000ULL /* support async DoM data discard */
/* XXX README XXX:
* Please DO NOT add flag values here before first ensuring that this same
OBD_CONNECT_GRANT_PARAM | \
OBD_CONNECT_SHORTIO | OBD_CONNECT_FLAGS2)
-#define MDT_CONNECT_SUPPORTED2 (OBD_CONNECT2_FILE_SECCTX | OBD_CONNECT2_FLR | \
- OBD_CONNECT2_SUM_STATFS | \
- OBD_CONNECT2_LOCK_CONVERT | \
+#define MDT_CONNECT_SUPPORTED2 (OBD_CONNECT2_FILE_SECCTX | \
OBD_CONNECT2_DIR_MIGRATE | \
+ OBD_CONNECT2_SUM_STATFS | \
+ OBD_CONNECT2_OVERSTRIPING | \
+ OBD_CONNECT2_FLR |\
+ OBD_CONNECT2_LOCK_CONVERT | \
OBD_CONNECT2_ARCHIVE_ID_ARRAY | \
OBD_CONNECT2_SELINUX_POLICY | \
- OBD_CONNECT2_LSOM)
+ OBD_CONNECT2_LSOM | \
+ OBD_CONNECT2_ASYNC_DISCARD | \
+ OBD_CONNECT2_PCC)
#define OST_CONNECT_SUPPORTED (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \
OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \
#define LOV_MAGIC_SPECIFIC (0x0BD50000 | LOV_MAGIC_MAGIC)
#define LOV_MAGIC LOV_MAGIC_V1
#define LOV_MAGIC_COMP_V1 (0x0BD60000 | LOV_MAGIC_MAGIC)
+#define LOV_MAGIC_FOREIGN (0x0BD70000 | LOV_MAGIC_MAGIC)
+#define LOV_MAGIC_SEL (0x0BD80000 | LOV_MAGIC_MAGIC)
/*
* magic for fully defined striping
#define OBD_MD_FLPROJID (0x0100000000000000ULL) /* project ID */
#define OBD_MD_SECCTX (0x0200000000000000ULL) /* embed security xattr */
-#define OBD_MD_FLLSIZE (0x0200000000000000ULL) /* Lazy size */
-#define OBD_MD_FLLBLOCKS (0x0400000000000000ULL) /* Lazy blocks */
-
#define OBD_MD_FLALLQUOTA (OBD_MD_FLUSRQUOTA | \
OBD_MD_FLGRPQUOTA | \
OBD_MD_FLPRJQUOTA)
MDS_HSM_CT_REGISTER = 59,
MDS_HSM_CT_UNREGISTER = 60,
MDS_SWAP_LAYOUTS = 61,
+ MDS_RMFID = 62,
MDS_LAST_OPC
};
#define DISP_OPEN_DENY 0x10000000
/* INODE LOCK PARTS */
-#define MDS_INODELOCK_LOOKUP 0x000001 /* For namespace, dentry etc, and also
- * was used to protect permission (mode,
- * owner, group etc) before 2.4. */
-#define MDS_INODELOCK_UPDATE 0x000002 /* size, links, timestamps */
-#define MDS_INODELOCK_OPEN 0x000004 /* For opened files */
-#define MDS_INODELOCK_LAYOUT 0x000008 /* for layout */
-
-/* The PERM bit is added int 2.4, and it is used to protect permission(mode,
- * owner, group, acl etc), so to separate the permission from LOOKUP lock.
- * Because for remote directories(in DNE), these locks will be granted by
- * different MDTs(different ldlm namespace).
- *
- * For local directory, MDT will always grant UPDATE_LOCK|PERM_LOCK together.
- * For Remote directory, the master MDT, where the remote directory is, will
- * grant UPDATE_LOCK|PERM_LOCK, and the remote MDT, where the name entry is,
- * 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 6
+enum mds_ibits_locks {
+ MDS_INODELOCK_LOOKUP = 0x000001, /* For namespace, dentry etc. Was
+ * used to protect permission (mode,
+ * owner, group, etc) before 2.4. */
+ MDS_INODELOCK_UPDATE = 0x000002, /* size, links, timestamps */
+ MDS_INODELOCK_OPEN = 0x000004, /* For opened files */
+ MDS_INODELOCK_LAYOUT = 0x000008, /* for layout */
+
+ /* The PERM bit is added in 2.4, and is used to protect permission
+ * (mode, owner, group, ACL, etc.) separate from LOOKUP lock.
+ * For remote directories (in DNE) these locks will be granted by
+ * different MDTs (different LDLM namespace).
+ *
+ * For local directory, the MDT always grants UPDATE|PERM together.
+ * For remote directory, master MDT (where remote directory is) grants
+ * UPDATE|PERM, and remote MDT (where name entry is) grants LOOKUP_LOCK.
+ */
+ MDS_INODELOCK_PERM = 0x000010,
+ MDS_INODELOCK_XATTR = 0x000020, /* non-permission extended attrs */
+ MDS_INODELOCK_DOM = 0x000040, /* Data for Data-on-MDT files */
+ /* Do not forget to increase MDS_INODELOCK_NUMBITS when adding bits */
+};
+#define MDS_INODELOCK_NUMBITS 7
/* This FULL lock is useful to take on unlink sort of operations */
-#define MDS_INODELOCK_FULL ((1<<(MDS_INODELOCK_MAXSHIFT+1))-1)
+#define MDS_INODELOCK_FULL ((1 << MDS_INODELOCK_NUMBITS) - 1)
/* DOM lock shouldn't be canceled early, use this macro for ELC */
#define MDS_INODELOCK_ELC (MDS_INODELOCK_FULL & ~MDS_INODELOCK_DOM)
MDS_CLOSE_RESYNC_DONE = 1 << 16,
MDS_CLOSE_LAYOUT_SPLIT = 1 << 17,
MDS_TRUNC_KEEP_LEASE = 1 << 18,
+ MDS_PCC_ATTACH = 1 << 19,
};
#define MDS_CLOSE_INTENT (MDS_HSM_RELEASE | MDS_CLOSE_LAYOUT_SWAP | \
struct lu_fid cr_fid2;
struct lustre_handle cr_open_handle_old; /* in case of open replay */
__s64 cr_time;
- __u64 cr_rdev;
+ union {
+ __u64 cr_rdev;
+ __u32 cr_archive_id;
+ };
__u64 cr_ioepoch;
__u64 cr_padding_1; /* rr_blocks */
__u32 cr_mode;
__u16 rr_padding_4; /* also fix lustre_swab_mdt_rec_reint */
};
+#define LMV_DESC_QOS_MAXAGE_DEFAULT 60 /* Seconds */
+
/* lmv structures */
struct lmv_desc {
__u32 ld_tgt_count; /* how many MDS's */
struct lu_fid lmv_stripe_fids[0]; /* FIDs for each stripe */
};
+/* foreign LMV EA */
+struct lmv_foreign_md {
+ __u32 lfm_magic; /* magic number = LMV_MAGIC_FOREIGN */
+ __u32 lfm_length; /* length of lfm_value */
+ __u32 lfm_type; /* type, see LU_FOREIGN_TYPE_ */
+ __u32 lfm_flags; /* flags, type specific */
+ char lfm_value[]; /* free format value */
+};
+
#define LMV_MAGIC_V1 0x0CD20CD0 /* normal stripe lmv magic */
#define LMV_MAGIC LMV_MAGIC_V1
/* #define LMV_USER_MAGIC 0x0CD30CD0 */
#define LMV_MAGIC_STRIPE 0x0CD40CD0 /* magic for dir sub_stripe */
-
-/* Right now only the lower part(0-16bits) of lmv_hash_type is being used,
- * and the higher part will be the flag to indicate the status of object,
- * for example the object is being migrated. And the hash function
- * might be interpreted differently with different flags. */
-#define LMV_HASH_TYPE_MASK 0x0000ffff
-
-#define LMV_HASH_FLAG_MIGRATION 0x80000000
-
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 12, 53, 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
- * flag when it checks the old FS */
-#define LMV_HASH_FLAG_DEAD 0x40000000
-#endif
-#define LMV_HASH_FLAG_BAD_TYPE 0x20000000
-
-/* The striped directory has ever lost its master LMV EA, then LFSCK
- * re-generated it. This flag is used to indicate such case. It is an
- * on-disk flag. */
-#define LMV_HASH_FLAG_LOST_LMV 0x10000000
+#define LMV_MAGIC_FOREIGN 0x0CD50CD0 /* magic for lmv foreign */
/**
* The FNV-1a hash algorithm is as follows:
__u32 lmv_magic;
struct lmv_mds_md_v1 lmv_md_v1;
struct lmv_user_md lmv_user_md;
+ struct lmv_foreign_md lmv_foreign_md;
};
static inline int lmv_mds_md_size(int stripe_count, unsigned int lmm_magic)
struct close_data_resync_done cd_resync;
/* split close */
__u16 cd_mirror_id;
+ /* PCC release */
+ __u32 cd_archive_id;
};
};