From: Mikhail Pershin Date: Wed, 11 Mar 2020 13:28:15 +0000 (+0300) Subject: LU-13354 capa: remove remained lustre capa code X-Git-Tag: 2.13.53~32 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=cf7f0db32882ca2349c624bc9c5720cb829c87d4 LU-13354 capa: remove remained lustre capa code Remove remaining unused lustre capability structures and defines. Test-Parameters: trivial Signed-off-by: Mikhail Pershin Change-Id: Iebd5bf87537c19fb30804adaf623c185983c351b Reviewed-on: https://review.whamcloud.com/37895 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/lustre_mds.h b/lustre/include/lustre_mds.h index cb43281..31e05f9 100644 --- a/lustre/include/lustre_mds.h +++ b/lustre/include/lustre_mds.h @@ -50,16 +50,6 @@ #include #include -struct mds_group_info { - struct obd_uuid *uuid; - int group; -}; - -struct mds_capa_info { - struct obd_uuid *uuid; - struct lustre_capa_key *capa; -}; - struct md_rejig_data { struct md_object *mrd_obj; __u16 mrd_mirror_id; diff --git a/lustre/include/lustre_swab.h b/lustre/include/lustre_swab.h index 8a56513..bdf4f33 100644 --- a/lustre/include/lustre_swab.h +++ b/lustre/include/lustre_swab.h @@ -103,8 +103,6 @@ void lustre_swab_lov_user_md(struct lov_user_md *lum, size_t size); void lustre_swab_lov_mds_md(struct lov_mds_md *lmm); void lustre_swab_idx_info(struct idx_info *ii); void lustre_swab_lip_header(struct lu_idxpage *lip); -void lustre_swab_lustre_capa(struct lustre_capa *c); -void lustre_swab_lustre_capa_key(struct lustre_capa_key *k); void lustre_swab_fid2path(struct getinfo_fid2path *gf); void lustre_swab_layout_intent(struct layout_intent *li); void lustre_swab_hsm_user_state(struct hsm_user_state *hus); diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index c80435c..720119d 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -3246,67 +3246,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 { diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index 5d53f19..73ff06d 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -2803,25 +2803,6 @@ void _debug_req(struct ptlrpc_request *req, } EXPORT_SYMBOL(_debug_req); -void lustre_swab_lustre_capa(struct lustre_capa *c) -{ - lustre_swab_lu_fid(&c->lc_fid); - __swab64s(&c->lc_opc); - __swab64s(&c->lc_uid); - __swab64s(&c->lc_gid); - __swab32s(&c->lc_flags); - __swab32s(&c->lc_keyid); - __swab32s(&c->lc_timeout); - __swab32s(&c->lc_expiry); -} - -void lustre_swab_lustre_capa_key(struct lustre_capa_key *k) -{ - __swab64s(&k->lk_seq); - __swab32s(&k->lk_keyid); - BUILD_BUG_ON(offsetof(typeof(*k), lk_padding) == 0); -} - void lustre_swab_hsm_user_state(struct hsm_user_state *state) { __swab32s(&state->hus_states); diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index ebeaa91..7936cca 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -4577,68 +4577,6 @@ void lustre_assert_wire_constants(void) LASSERTF((int)sizeof(((struct mgs_config_res *)0)->mcr_size) == 8, "found %lld\n", (long long)(int)sizeof(((struct mgs_config_res *)0)->mcr_size)); - /* Checks for struct lustre_capa */ - LASSERTF((int)sizeof(struct lustre_capa) == 120, "found %lld\n", - (long long)(int)sizeof(struct lustre_capa)); - LASSERTF((int)offsetof(struct lustre_capa, lc_fid) == 0, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_fid)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_fid) == 16, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_fid)); - LASSERTF((int)offsetof(struct lustre_capa, lc_opc) == 16, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_opc)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_opc) == 8, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_opc)); - LASSERTF((int)offsetof(struct lustre_capa, lc_uid) == 24, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_uid)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_uid) == 8, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_uid)); - LASSERTF((int)offsetof(struct lustre_capa, lc_gid) == 32, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_gid)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_gid) == 8, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_gid)); - LASSERTF((int)offsetof(struct lustre_capa, lc_flags) == 40, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_flags)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_flags) == 4, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_flags)); - LASSERTF((int)offsetof(struct lustre_capa, lc_keyid) == 44, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_keyid)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_keyid) == 4, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_keyid)); - LASSERTF((int)offsetof(struct lustre_capa, lc_timeout) == 48, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_timeout)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_timeout) == 4, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_timeout)); - LASSERTF((int)offsetof(struct lustre_capa, lc_expiry) == 52, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_expiry)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_expiry) == 4, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_expiry)); - BUILD_BUG_ON(CAPA_HMAC_MAX_LEN != 64); - LASSERTF((int)offsetof(struct lustre_capa, lc_hmac[64]) == 120, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_hmac[64])); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_hmac[64]) == 1, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_hmac[64])); - - /* Checks for struct lustre_capa_key */ - LASSERTF((int)sizeof(struct lustre_capa_key) == 72, "found %lld\n", - (long long)(int)sizeof(struct lustre_capa_key)); - LASSERTF((int)offsetof(struct lustre_capa_key, lk_seq) == 0, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa_key, lk_seq)); - LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_seq) == 8, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_seq)); - LASSERTF((int)offsetof(struct lustre_capa_key, lk_keyid) == 8, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa_key, lk_keyid)); - LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_keyid) == 4, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_keyid)); - LASSERTF((int)offsetof(struct lustre_capa_key, lk_padding) == 12, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa_key, lk_padding)); - LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_padding) == 4, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_padding)); - BUILD_BUG_ON(CAPA_HMAC_KEY_MAX_LEN != 56); - LASSERTF((int)offsetof(struct lustre_capa_key, lk_key[56]) == 72, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa_key, lk_key[56])); - LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_key[56]) == 1, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_key[56])); - /* Checks for struct getinfo_fid2path */ LASSERTF((int)sizeof(struct getinfo_fid2path) == 32, "found %lld\n", (long long)(int)sizeof(struct getinfo_fid2path)); diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index 5e4d72a..c44450d 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -2063,35 +2063,6 @@ check_mgs_config_res(void) } static void -check_lustre_capa(void) -{ - BLANK_LINE(); - CHECK_STRUCT(lustre_capa); - CHECK_MEMBER(lustre_capa, lc_fid); - CHECK_MEMBER(lustre_capa, lc_opc); - CHECK_MEMBER(lustre_capa, lc_uid); - CHECK_MEMBER(lustre_capa, lc_gid); - CHECK_MEMBER(lustre_capa, lc_flags); - CHECK_MEMBER(lustre_capa, lc_keyid); - CHECK_MEMBER(lustre_capa, lc_timeout); - CHECK_MEMBER(lustre_capa, lc_expiry); - CHECK_CDEFINE(CAPA_HMAC_MAX_LEN); - CHECK_MEMBER(lustre_capa, lc_hmac[CAPA_HMAC_MAX_LEN]); -} - -static void -check_lustre_capa_key(void) -{ - BLANK_LINE(); - CHECK_STRUCT(lustre_capa_key); - CHECK_MEMBER(lustre_capa_key, lk_seq); - CHECK_MEMBER(lustre_capa_key, lk_keyid); - CHECK_MEMBER(lustre_capa_key, lk_padding); - CHECK_CDEFINE(CAPA_HMAC_KEY_MAX_LEN); - CHECK_MEMBER(lustre_capa_key, lk_key[CAPA_HMAC_KEY_MAX_LEN]); -} - -static void check_getinfo_fid2path(void) { BLANK_LINE(); @@ -3028,8 +2999,6 @@ main(int argc, char **argv) check_mgs_nidtbl_entry(); check_mgs_config_body(); check_mgs_config_res(); - check_lustre_capa(); - check_lustre_capa_key(); check_getinfo_fid2path(); check_ll_user_fiemap(); check_ll_fiemap_extent(); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index 69f56d9..a96469b 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -4609,68 +4609,6 @@ void lustre_assert_wire_constants(void) LASSERTF((int)sizeof(((struct mgs_config_res *)0)->mcr_size) == 8, "found %lld\n", (long long)(int)sizeof(((struct mgs_config_res *)0)->mcr_size)); - /* Checks for struct lustre_capa */ - LASSERTF((int)sizeof(struct lustre_capa) == 120, "found %lld\n", - (long long)(int)sizeof(struct lustre_capa)); - LASSERTF((int)offsetof(struct lustre_capa, lc_fid) == 0, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_fid)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_fid) == 16, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_fid)); - LASSERTF((int)offsetof(struct lustre_capa, lc_opc) == 16, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_opc)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_opc) == 8, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_opc)); - LASSERTF((int)offsetof(struct lustre_capa, lc_uid) == 24, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_uid)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_uid) == 8, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_uid)); - LASSERTF((int)offsetof(struct lustre_capa, lc_gid) == 32, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_gid)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_gid) == 8, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_gid)); - LASSERTF((int)offsetof(struct lustre_capa, lc_flags) == 40, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_flags)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_flags) == 4, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_flags)); - LASSERTF((int)offsetof(struct lustre_capa, lc_keyid) == 44, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_keyid)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_keyid) == 4, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_keyid)); - LASSERTF((int)offsetof(struct lustre_capa, lc_timeout) == 48, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_timeout)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_timeout) == 4, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_timeout)); - LASSERTF((int)offsetof(struct lustre_capa, lc_expiry) == 52, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_expiry)); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_expiry) == 4, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_expiry)); - BUILD_BUG_ON(CAPA_HMAC_MAX_LEN != 64); - LASSERTF((int)offsetof(struct lustre_capa, lc_hmac[64]) == 120, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa, lc_hmac[64])); - LASSERTF((int)sizeof(((struct lustre_capa *)0)->lc_hmac[64]) == 1, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa *)0)->lc_hmac[64])); - - /* Checks for struct lustre_capa_key */ - LASSERTF((int)sizeof(struct lustre_capa_key) == 72, "found %lld\n", - (long long)(int)sizeof(struct lustre_capa_key)); - LASSERTF((int)offsetof(struct lustre_capa_key, lk_seq) == 0, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa_key, lk_seq)); - LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_seq) == 8, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_seq)); - LASSERTF((int)offsetof(struct lustre_capa_key, lk_keyid) == 8, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa_key, lk_keyid)); - LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_keyid) == 4, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_keyid)); - LASSERTF((int)offsetof(struct lustre_capa_key, lk_padding) == 12, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa_key, lk_padding)); - LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_padding) == 4, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_padding)); - BUILD_BUG_ON(CAPA_HMAC_KEY_MAX_LEN != 56); - LASSERTF((int)offsetof(struct lustre_capa_key, lk_key[56]) == 72, "found %lld\n", - (long long)(int)offsetof(struct lustre_capa_key, lk_key[56])); - LASSERTF((int)sizeof(((struct lustre_capa_key *)0)->lk_key[56]) == 1, "found %lld\n", - (long long)(int)sizeof(((struct lustre_capa_key *)0)->lk_key[56])); - /* Checks for struct getinfo_fid2path */ LASSERTF((int)sizeof(struct getinfo_fid2path) == 32, "found %lld\n", (long long)(int)sizeof(struct getinfo_fid2path));