From d6e910de5ae56688650014189aaa02b3727dd76e Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Tue, 12 Aug 2014 13:19:29 -0400 Subject: [PATCH] LU-5478 style: get rid of seqno_t and mdsno_t typedefs seqno_t is u64 and mdsno_t is u32 Change-Id: I68be5077ced8a73a8f7bce93ac058d03ecc64b2e Signed-off-by: Oleg Drokin Reviewed-on: http://review.whamcloud.com/11420 Tested-by: Jenkins Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: wangdi --- lustre/fid/fid_request.c | 6 +++--- lustre/fld/fld_cache.c | 18 +++++++++--------- lustre/fld/fld_handler.c | 4 ++-- lustre/fld/fld_index.c | 6 +++--- lustre/fld/fld_internal.h | 4 ++-- lustre/fld/fld_request.c | 13 ++++++------- lustre/include/lustre/lustre_idl.h | 2 -- lustre/include/lustre_fid.h | 2 +- lustre/include/lustre_fld.h | 9 ++++----- lustre/include/lustre_lmv.h | 2 +- lustre/include/md_object.h | 2 +- lustre/include/obd.h | 2 +- lustre/lfsck/lfsck_internal.h | 2 +- lustre/lmv/lmv_fld.c | 3 +-- lustre/lmv/lmv_internal.h | 10 ++++------ lustre/lmv/lmv_obd.c | 10 ++++------ lustre/lod/lod_object.c | 2 +- lustre/mdt/mdt_capa.c | 7 +++---- 18 files changed, 47 insertions(+), 57 deletions(-) diff --git a/lustre/fid/fid_request.c b/lustre/fid/fid_request.c index 3d8a401..520cc63 100644 --- a/lustre/fid/fid_request.c +++ b/lustre/fid/fid_request.c @@ -208,7 +208,7 @@ static int seq_client_alloc_meta(const struct lu_env *env, /* Allocate new sequence for client. */ static int seq_client_alloc_seq(const struct lu_env *env, - struct lu_client_seq *seq, seqno_t *seqnr) + struct lu_client_seq *seq, u64 *seqnr) { int rc; ENTRY; @@ -271,7 +271,7 @@ static void seq_fid_alloc_fini(struct lu_client_seq *seq) * Allocate the whole seq to the caller. **/ int seq_client_get_seq(const struct lu_env *env, - struct lu_client_seq *seq, seqno_t *seqnr) + struct lu_client_seq *seq, u64 *seqnr) { wait_queue_t link; int rc; @@ -336,7 +336,7 @@ int seq_client_alloc_fid(const struct lu_env *env, seq->lcs_fid.f_oid = seq->lcs_width; while (1) { - seqno_t seqnr; + u64 seqnr; if (!fid_is_zero(&seq->lcs_fid) && fid_oid(&seq->lcs_fid) < seq->lcs_width) { diff --git a/lustre/fld/fld_cache.c b/lustre/fld/fld_cache.c index 24c1f79..bb42482 100644 --- a/lustre/fld/fld_cache.c +++ b/lustre/fld/fld_cache.c @@ -272,8 +272,8 @@ static void fld_cache_punch_hole(struct fld_cache *cache, struct fld_cache_entry *f_new) { const struct lu_seq_range *range = &f_new->fce_range; - const seqno_t new_start = range->lsr_start; - const seqno_t new_end = range->lsr_end; + const u64 new_start = range->lsr_start; + const u64 new_end = range->lsr_end; struct fld_cache_entry *fldt; ENTRY; @@ -313,10 +313,10 @@ static void fld_cache_overlap_handle(struct fld_cache *cache, struct fld_cache_entry *f_curr, struct fld_cache_entry *f_new) { - const struct lu_seq_range *range = &f_new->fce_range; - const seqno_t new_start = range->lsr_start; - const seqno_t new_end = range->lsr_end; - const mdsno_t mdt = range->lsr_index; + const struct lu_seq_range *range = &f_new->fce_range; + const u64 new_start = range->lsr_start; + const u64 new_end = range->lsr_end; + const u32 mdt = range->lsr_index; /* this is overlap case, these case are checking overlapping with * prev range only. fixup will handle overlaping with next range. */ @@ -398,8 +398,8 @@ int fld_cache_insert_nolock(struct fld_cache *cache, struct fld_cache_entry *n; struct list_head *head; struct list_head *prev = NULL; - const seqno_t new_start = f_new->fce_range.lsr_start; - const seqno_t new_end = f_new->fce_range.lsr_end; + const u64 new_start = f_new->fce_range.lsr_start; + const u64 new_end = f_new->fce_range.lsr_end; __u32 new_flags = f_new->fce_range.lsr_flags; ENTRY; @@ -532,7 +532,7 @@ fld_cache_entry_lookup(struct fld_cache *cache, * lookup \a seq sequence for range in fld cache. */ int fld_cache_lookup(struct fld_cache *cache, - const seqno_t seq, struct lu_seq_range *range) + const u64 seq, struct lu_seq_range *range) { struct fld_cache_entry *flde; struct fld_cache_entry *prev = NULL; diff --git a/lustre/fld/fld_handler.c b/lustre/fld/fld_handler.c index eae79ea..468d32f 100644 --- a/lustre/fld/fld_handler.c +++ b/lustre/fld/fld_handler.c @@ -204,7 +204,7 @@ EXPORT_SYMBOL(fld_update_from_controller); * Lookup sequece in local cache/fldb. **/ int fld_local_lookup(const struct lu_env *env, struct lu_server_fld *fld, - seqno_t seq, struct lu_seq_range *range) + u64 seq, struct lu_seq_range *range) { struct lu_seq_range *erange; struct fld_thread_info *info; @@ -240,7 +240,7 @@ EXPORT_SYMBOL(fld_local_lookup); * cache fld entries, but this cache is not persistent. */ int fld_server_lookup(const struct lu_env *env, struct lu_server_fld *fld, - seqno_t seq, struct lu_seq_range *range) + u64 seq, struct lu_seq_range *range) { __u32 index; int rc; diff --git a/lustre/fld/fld_index.c b/lustre/fld/fld_index.c index 56042a0..48b00d0 100644 --- a/lustre/fld/fld_index.c +++ b/lustre/fld/fld_index.c @@ -79,8 +79,8 @@ static const struct lu_seq_range ROOT_FLD_RANGE = { static const struct dt_index_features fld_index_features = { .dif_flags = DT_IND_UPDATE, - .dif_keysize_min = sizeof(seqno_t), - .dif_keysize_max = sizeof(seqno_t), + .dif_keysize_min = sizeof(u64), + .dif_keysize_max = sizeof(u64), .dif_recsize_min = sizeof(struct lu_seq_range), .dif_recsize_max = sizeof(struct lu_seq_range), .dif_ptrsize = 4 @@ -237,7 +237,7 @@ out: * \retval -ve other error; */ int fld_index_lookup(const struct lu_env *env, struct lu_server_fld *fld, - seqno_t seq, struct lu_seq_range *range) + u64 seq, struct lu_seq_range *range) { struct lu_seq_range *fld_rec; struct fld_thread_info *info; diff --git a/lustre/fld/fld_internal.h b/lustre/fld/fld_internal.h index ae8dce1..9267937 100644 --- a/lustre/fld/fld_internal.h +++ b/lustre/fld/fld_internal.h @@ -179,7 +179,7 @@ int fld_index_create(const struct lu_env *env, struct lu_server_fld *fld, const struct lu_seq_range *new_range, struct thandle *th); int fld_index_lookup(const struct lu_env *env, struct lu_server_fld *fld, - seqno_t seq, struct lu_seq_range *range); + u64 seq, struct lu_seq_range *range); int fld_name_to_index(const char *name, __u32 *index); int fld_server_mod_init(void); @@ -220,7 +220,7 @@ void fld_cache_delete(struct fld_cache *cache, void fld_cache_delete_nolock(struct fld_cache *cache, const struct lu_seq_range *range); int fld_cache_lookup(struct fld_cache *cache, - const seqno_t seq, struct lu_seq_range *range); + const u64 seq, struct lu_seq_range *range); struct fld_cache_entry * fld_cache_entry_lookup(struct fld_cache *cache, diff --git a/lustre/fld/fld_request.c b/lustre/fld/fld_request.c index 1ca31c0..832d1f8 100644 --- a/lustre/fld/fld_request.c +++ b/lustre/fld/fld_request.c @@ -60,15 +60,14 @@ #include #include "fld_internal.h" -static int fld_rrb_hash(struct lu_client_fld *fld, - seqno_t seq) +static int fld_rrb_hash(struct lu_client_fld *fld, u64 seq) { - LASSERT(fld->lcf_count > 0); - return do_div(seq, fld->lcf_count); + LASSERT(fld->lcf_count > 0); + return do_div(seq, fld->lcf_count); } static struct lu_fld_target * -fld_rrb_scan(struct lu_client_fld *fld, seqno_t seq) +fld_rrb_scan(struct lu_client_fld *fld, u64 seq) { struct lu_fld_target *target; int hash; @@ -134,7 +133,7 @@ struct lu_fld_hash fld_hash[] = { }; static struct lu_fld_target * -fld_client_get_target(struct lu_client_fld *fld, seqno_t seq) +fld_client_get_target(struct lu_client_fld *fld, u64 seq) { struct lu_fld_target *target; ENTRY; @@ -468,7 +467,7 @@ out_req: return rc; } -int fld_client_lookup(struct lu_client_fld *fld, seqno_t seq, mdsno_t *mds, +int fld_client_lookup(struct lu_client_fld *fld, u64 seq, u32 *mds, __u32 flags, const struct lu_env *env) { struct lu_seq_range res = { 0 }; diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index dcd9923..56f6cfb 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -163,8 +163,6 @@ #define LUSTRE_LOG_VERSION 0x00050000 #define LUSTRE_MGS_VERSION 0x00060000 -typedef __u32 mdsno_t; -typedef __u64 seqno_t; typedef __u64 obd_id; typedef __u64 obd_seq; typedef __s64 obd_time; diff --git a/lustre/include/lustre_fid.h b/lustre/include/lustre_fid.h index f37c5a8..a84754b 100644 --- a/lustre/include/lustre_fid.h +++ b/lustre/include/lustre_fid.h @@ -487,7 +487,7 @@ void seq_client_flush(struct lu_client_seq *seq); int seq_client_alloc_fid(const struct lu_env *env, struct lu_client_seq *seq, struct lu_fid *fid); int seq_client_get_seq(const struct lu_env *env, struct lu_client_seq *seq, - seqno_t *seqnr); + u64 *seqnr); int seq_site_fini(const struct lu_env *env, struct seq_server_site *ss); /* Fids common stuff */ int fid_is_local(const struct lu_env *env, diff --git a/lustre/include/lustre_fld.h b/lustre/include/lustre_fld.h index d018941..6f730b0 100644 --- a/lustre/include/lustre_fld.h +++ b/lustre/include/lustre_fld.h @@ -157,10 +157,10 @@ int fld_insert_entry(const struct lu_env *env, const struct lu_seq_range *range); int fld_server_lookup(const struct lu_env *env, struct lu_server_fld *fld, - seqno_t seq, struct lu_seq_range *range); + u64 seq, struct lu_seq_range *range); int fld_local_lookup(const struct lu_env *env, struct lu_server_fld *fld, - seqno_t seq, struct lu_seq_range *range); + u64 seq, struct lu_seq_range *range); int fld_update_from_controller(const struct lu_env *env, struct lu_server_fld *fld); @@ -173,15 +173,14 @@ void fld_client_fini(struct lu_client_fld *fld); void fld_client_flush(struct lu_client_fld *fld); -int fld_client_lookup(struct lu_client_fld *fld, seqno_t seq, mdsno_t *mds, +int fld_client_lookup(struct lu_client_fld *fld, u64 seq, u32 *mds, __u32 flags, const struct lu_env *env); int fld_client_create(struct lu_client_fld *fld, struct lu_seq_range *range, const struct lu_env *env); -int fld_client_delete(struct lu_client_fld *fld, - seqno_t seq, +int fld_client_delete(struct lu_client_fld *fld, u64 seq, const struct lu_env *env); int fld_client_add_target(struct lu_client_fld *fld, diff --git a/lustre/include/lustre_lmv.h b/lustre/include/lustre_lmv.h index 5843f8f..9dced71 100644 --- a/lustre/include/lustre_lmv.h +++ b/lustre/include/lustre_lmv.h @@ -36,7 +36,7 @@ struct lmv_oinfo { struct lu_fid lmo_fid; - mdsno_t lmo_mds; + u32 lmo_mds; struct inode *lmo_root; }; diff --git a/lustre/include/md_object.h b/lustre/include/md_object.h index f8d0f46..cf7b4a5 100644 --- a/lustre/include/md_object.h +++ b/lustre/include/md_object.h @@ -439,7 +439,7 @@ struct seq_server_site { /** * mds number of this site. */ - mdsno_t ss_node_id; + u32 ss_node_id; /** * Fid location database */ diff --git a/lustre/include/obd.h b/lustre/include/obd.h index d7eb8b0..1e39945 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -808,7 +808,7 @@ struct md_op_data { struct lu_fid op_fid2; /* operation fid2 (usualy child) */ struct lu_fid op_fid3; /* 2 extra fids to find conflicting */ struct lu_fid op_fid4; /* to the operation locks. */ - mdsno_t op_mds; /* what mds server open will go to */ + u32 op_mds; /* what mds server open will go to */ struct lustre_handle op_handle; obd_time op_mod_time; const char *op_name; diff --git a/lustre/lfsck/lfsck_internal.h b/lustre/lfsck/lfsck_internal.h index 29a24d4..5fdb7a4 100644 --- a/lustre/lfsck/lfsck_internal.h +++ b/lustre/lfsck/lfsck_internal.h @@ -874,7 +874,7 @@ static inline void lfsck_instance_put(const struct lu_env *env, lfsck_instance_cleanup(env, lfsck); } -static inline mdsno_t lfsck_dev_idx(struct dt_device *dev) +static inline u32 lfsck_dev_idx(struct dt_device *dev) { return dev->dd_lu_dev.ld_site->ld_seq_site->ss_node_id; } diff --git a/lustre/lmv/lmv_fld.c b/lustre/lmv/lmv_fld.c index 80f37a3..6d3244b 100644 --- a/lustre/lmv/lmv_fld.c +++ b/lustre/lmv/lmv_fld.c @@ -53,8 +53,7 @@ #include #include "lmv_internal.h" -int lmv_fld_lookup(struct lmv_obd *lmv, const struct lu_fid *fid, - mdsno_t *mds) +int lmv_fld_lookup(struct lmv_obd *lmv, const struct lu_fid *fid, u32 *mds) { struct obd_device *obd = lmv2obd_dev(lmv); int rc; diff --git a/lustre/lmv/lmv_internal.h b/lustre/lmv/lmv_internal.h index b6245b3..637c5a2 100644 --- a/lustre/lmv/lmv_internal.h +++ b/lustre/lmv/lmv_internal.h @@ -58,10 +58,8 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data, int lmv_blocking_ast(struct ldlm_lock *, struct ldlm_lock_desc *, void *, int); -int lmv_fld_lookup(struct lmv_obd *lmv, const struct lu_fid *fid, - mdsno_t *mds); -int __lmv_fid_alloc(struct lmv_obd *lmv, struct lu_fid *fid, - mdsno_t mds); +int lmv_fld_lookup(struct lmv_obd *lmv, const struct lu_fid *fid, u32 *mds); +int __lmv_fid_alloc(struct lmv_obd *lmv, struct lu_fid *fid, u32 mds); int lmv_fid_alloc(const struct lu_env *env, struct obd_export *exp, struct lu_fid *fid, struct md_op_data *op_data); @@ -79,7 +77,7 @@ static inline struct obd_device *lmv2obd_dev(struct lmv_obd *lmv) } static inline struct lmv_tgt_desc * -lmv_get_target(struct lmv_obd *lmv, mdsno_t mdt_idx, int *index) +lmv_get_target(struct lmv_obd *lmv, u32 mdt_idx, int *index) { int i; @@ -101,7 +99,7 @@ static inline int lmv_find_target_index(struct lmv_obd *lmv, const struct lu_fid *fid) { struct lmv_tgt_desc *ltd; - mdsno_t mdt_idx = 0; + u32 mdt_idx = 0; int index = 0; if (lmv->desc.ld_tgt_count > 1) { diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index 5c452db..2b3c715 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -1322,8 +1322,7 @@ static int lmv_choose_mds(struct lmv_obd *lmv, struct md_op_data *op_data, * This is _inode_ placement policy function (not name). */ static int lmv_placement_policy(struct obd_device *obd, - struct md_op_data *op_data, - mdsno_t *mds) + struct md_op_data *op_data, u32 *mds) { struct lmv_obd *lmv = &obd->u.lmv; ENTRY; @@ -1361,8 +1360,7 @@ static int lmv_placement_policy(struct obd_device *obd, RETURN(0); } -int __lmv_fid_alloc(struct lmv_obd *lmv, struct lu_fid *fid, - mdsno_t mds) +int __lmv_fid_alloc(struct lmv_obd *lmv, struct lu_fid *fid, u32 mds) { struct lmv_tgt_desc *tgt; int rc; @@ -1401,7 +1399,7 @@ int lmv_fid_alloc(const struct lu_env *env, struct obd_export *exp, { struct obd_device *obd = class_exp2obd(exp); struct lmv_obd *lmv = &obd->u.lmv; - mdsno_t mds = 0; + u32 mds = 0; int rc; ENTRY; @@ -1787,7 +1785,7 @@ static int lmv_close(struct obd_export *exp, struct md_op_data *op_data, struct lmv_tgt_desc * lmv_locate_target_for_name(struct lmv_obd *lmv, struct lmv_stripe_md *lsm, const char *name, int namelen, struct lu_fid *fid, - mdsno_t *mds) + u32 *mds) { struct lmv_tgt_desc *tgt; const struct lmv_oinfo *oinfo; diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c index e3ad890..a936f52 100644 --- a/lustre/lod/lod_object.c +++ b/lustre/lod/lod_object.c @@ -3326,7 +3326,7 @@ static int lod_object_init(const struct lu_env *env, struct lu_object *lo, struct lu_object *cobj; struct lod_tgt_descs *ltd = NULL; struct lod_tgt_desc *tgt; - mdsno_t idx = 0; + u32 idx = 0; int type = LU_SEQ_RANGE_ANY; int rc; ENTRY; diff --git a/lustre/mdt/mdt_capa.c b/lustre/mdt/mdt_capa.c index ee316d7..e1c52ee 100644 --- a/lustre/mdt/mdt_capa.c +++ b/lustre/mdt/mdt_capa.c @@ -49,8 +49,7 @@ static inline void set_capa_key_expiry(struct mdt_device *mdt) mdt->mdt_ck_expiry = jiffies + mdt->mdt_ck_timeout * HZ; } -static void make_capa_key(struct lustre_capa_key *key, - mdsno_t mdsnum, int keyid) +static void make_capa_key(struct lustre_capa_key *key, u32 mdsnum, int keyid) { key->lk_seq = mdsnum; key->lk_keyid = keyid + 1; @@ -150,7 +149,7 @@ int mdt_capa_keys_init(const struct lu_env *env, struct mdt_device *mdt) struct mdt_thread_info *mti; struct dt_object *obj; struct lu_attr *la; - mdsno_t mdsnum; + u32 mdsnum; unsigned long size; int rc; ENTRY; @@ -215,7 +214,7 @@ static int mdt_ck_thread_main(void *args) struct mdt_thread_info *info; struct md_device *next; struct l_wait_info lwi = { 0 }; - mdsno_t mdsnum; + u32 mdsnum; int rc; ENTRY; -- 1.8.3.1