diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/lmv')
-rw-r--r-- | drivers/staging/lustre/lustre/lmv/lmv_fld.c | 2 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lmv/lmv_intent.c | 16 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lmv/lmv_internal.h | 14 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lmv/lmv_obd.c | 111 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lmv/lproc_lmv.c | 8 |
5 files changed, 87 insertions, 64 deletions
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_fld.c b/drivers/staging/lustre/lustre/lmv/lmv_fld.c index 8289bcc5f8e1..e8421f04beda 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_fld.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_fld.c @@ -53,7 +53,7 @@ int lmv_fld_lookup(struct lmv_obd *lmv, const struct lu_fid *fid, - mdsno_t *mds) + u32 *mds) { int rc; diff --git a/drivers/staging/lustre/lustre/lmv/lmv_intent.c b/drivers/staging/lustre/lustre/lmv/lmv_intent.c index aba698f4489c..5106124b7d92 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c @@ -41,7 +41,7 @@ #include <asm/div64.h> #include <linux/seq_file.h> #include <linux/namei.h> -#include "../include/linux/lustre_intent.h" +#include "../include/lustre_intent.h" #include "../include/obd_support.h" #include "../include/lustre/lustre_idl.h" #include "../include/lustre_lib.h" @@ -94,12 +94,16 @@ static int lmv_intent_remote(struct obd_export *exp, void *lmm, LASSERT(fid_is_sane(&body->fid1)); tgt = lmv_find_target(lmv, &body->fid1); - if (IS_ERR(tgt)) - GOTO(out, rc = PTR_ERR(tgt)); + if (IS_ERR(tgt)) { + rc = PTR_ERR(tgt); + goto out; + } OBD_ALLOC_PTR(op_data); - if (op_data == NULL) - GOTO(out, rc = -ENOMEM); + if (op_data == NULL) { + rc = -ENOMEM; + goto out; + } op_data->op_fid1 = body->fid1; /* Sent the parent FID to the remote MDT */ @@ -121,7 +125,7 @@ static int lmv_intent_remote(struct obd_export *exp, void *lmm, rc = md_intent_lock(tgt->ltd_exp, op_data, lmm, lmmsize, it, flags, &req, cb_blocking, extra_lock_flags); if (rc) - GOTO(out_free_op_data, rc); + goto out_free_op_data; /* * LLite needs LOOKUP lock to track dentry revocation in order to diff --git a/drivers/staging/lustre/lustre/lmv/lmv_internal.h b/drivers/staging/lustre/lustre/lmv/lmv_internal.h index eb18a5900e13..b911e7643874 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_internal.h +++ b/drivers/staging/lustre/lustre/lmv/lmv_internal.h @@ -70,10 +70,8 @@ int lmv_intent_open(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(struct obd_export *exp, struct lu_fid *fid, struct md_op_data *op_data); @@ -95,7 +93,7 @@ static inline struct lmv_stripe_md *lmv_get_mea(struct ptlrpc_request *req) if (mea->mea_count == 0) return NULL; - if( mea->mea_magic != MEA_MAGIC_LAST_CHAR && + if (mea->mea_magic != MEA_MAGIC_LAST_CHAR && mea->mea_magic != MEA_MAGIC_ALL_CHARS && mea->mea_magic != MEA_MAGIC_HASH_SEGMENT) return NULL; @@ -111,7 +109,7 @@ static inline int lmv_get_easize(struct lmv_obd *lmv) } static inline struct lmv_tgt_desc * -lmv_get_target(struct lmv_obd *lmv, mdsno_t mds) +lmv_get_target(struct lmv_obd *lmv, u32 mds) { int count = lmv->desc.ld_tgt_count; int i; @@ -130,7 +128,7 @@ lmv_get_target(struct lmv_obd *lmv, mdsno_t mds) static inline struct lmv_tgt_desc * lmv_find_target(struct lmv_obd *lmv, const struct lu_fid *fid) { - mdsno_t mds = 0; + u32 mds = 0; int rc; if (lmv->desc.ld_tgt_count > 1) { @@ -146,7 +144,7 @@ struct lmv_tgt_desc *lmv_locate_mds(struct lmv_obd *lmv, struct md_op_data *op_data, struct lu_fid *fid); /* lproc_lmv.c */ -#if defined (CONFIG_PROC_FS) +#if defined(CONFIG_PROC_FS) void lprocfs_lmv_init_vars(struct lprocfs_static_vars *lvars); #else static inline void lprocfs_lmv_init_vars(struct lprocfs_static_vars *lvars) diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index a66b3e000d57..1a5821289c39 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -97,12 +97,16 @@ static int lmv_set_mdc_active(struct lmv_obd *lmv, struct obd_uuid *uuid, break; } - if (i == lmv->desc.ld_tgt_count) - GOTO(out_lmv_lock, rc = -EINVAL); + if (i == lmv->desc.ld_tgt_count) { + rc = -EINVAL; + goto out_lmv_lock; + } obd = class_exp2obd(tgt->ltd_exp); - if (obd == NULL) - GOTO(out_lmv_lock, rc = -ENOTCONN); + if (obd == NULL) { + rc = -ENOTCONN; + goto out_lmv_lock; + } CDEBUG(D_INFO, "Found OBD %s=%s device %d (%p) type %s at LMV idx %d\n", obd->obd_name, obd->obd_uuid.uuid, obd->obd_minor, obd, @@ -112,7 +116,7 @@ static int lmv_set_mdc_active(struct lmv_obd *lmv, struct obd_uuid *uuid, if (tgt->ltd_active == activate) { CDEBUG(D_INFO, "OBD %p already %sactive!\n", obd, activate ? "" : "in"); - GOTO(out_lmv_lock, rc); + goto out_lmv_lock; } CDEBUG(D_INFO, "Marking OBD %p %sactive\n", obd, @@ -574,7 +578,7 @@ int lmv_check_connect(struct obd_device *obd) continue; rc = lmv_connect_mdc(obd, tgt); if (rc) - GOTO(out_disc, rc); + goto out_disc; } lmv_set_timeouts(obd); @@ -712,7 +716,7 @@ static int lmv_fid2path(struct obd_export *exp, int len, void *karg, void *uarg) repeat_fid2path: rc = obd_iocontrol(OBD_IOC_FID2PATH, tgt->ltd_exp, len, gf, uarg); if (rc != 0 && rc != -EREMOTE) - GOTO(out_fid2path, rc); + goto out_fid2path; /* If remote_gf != NULL, it means just building the * path on the remote MDT, copy this path segment to gf */ @@ -722,8 +726,10 @@ repeat_fid2path: ori_gf = (struct getinfo_fid2path *)karg; if (strlen(ori_gf->gf_path) + - strlen(gf->gf_path) > ori_gf->gf_pathlen) - GOTO(out_fid2path, rc = -EOVERFLOW); + strlen(gf->gf_path) > ori_gf->gf_pathlen) { + rc = -EOVERFLOW; + goto out_fid2path; + } ptr = ori_gf->gf_path; @@ -741,14 +747,16 @@ repeat_fid2path: gf->gf_linkno); if (rc == 0) - GOTO(out_fid2path, rc); + goto out_fid2path; /* sigh, has to go to another MDT to do path building further */ if (remote_gf == NULL) { remote_gf_size = sizeof(*remote_gf) + PATH_MAX; OBD_ALLOC(remote_gf, remote_gf_size); - if (remote_gf == NULL) - GOTO(out_fid2path, rc = -ENOMEM); + if (remote_gf == NULL) { + rc = -ENOMEM; + goto out_fid2path; + } remote_gf->gf_pathlen = PATH_MAX; } @@ -756,12 +764,15 @@ repeat_fid2path: CERROR("%s: invalid FID "DFID": rc = %d\n", tgt->ltd_exp->exp_obd->obd_name, PFID(&gf->gf_fid), -EINVAL); - GOTO(out_fid2path, rc = -EINVAL); + rc = -EINVAL; + goto out_fid2path; } tgt = lmv_find_target(lmv, &gf->gf_fid); - if (IS_ERR(tgt)) - GOTO(out_fid2path, rc = -EINVAL); + if (IS_ERR(tgt)) { + rc = -EINVAL; + goto out_fid2path; + } remote_gf->gf_fid = gf->gf_fid; remote_gf->gf_recno = -1; @@ -1178,7 +1189,7 @@ static int lmv_nid_policy(struct lmv_obd *lmv) } static int lmv_choose_mds(struct lmv_obd *lmv, struct md_op_data *op_data, - placement_policy_t placement) + enum placement_policy placement) { switch (placement) { case PLACEMENT_CHAR_POLICY: @@ -1201,8 +1212,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; @@ -1241,8 +1251,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; @@ -1257,8 +1266,10 @@ int __lmv_fid_alloc(struct lmv_obd *lmv, struct lu_fid *fid, */ mutex_lock(&tgt->ltd_fid_mutex); - if (tgt->ltd_active == 0 || tgt->ltd_exp == NULL) - GOTO(out, rc = -ENODEV); + if (tgt->ltd_active == 0 || tgt->ltd_exp == NULL) { + rc = -ENODEV; + goto out; + } /* * Asking underlaying tgt layer to allocate new fid. @@ -1279,7 +1290,7 @@ int lmv_fid_alloc(struct obd_export *exp, struct lu_fid *fid, { struct obd_device *obd = class_exp2obd(exp); struct lmv_obd *lmv = &obd->u.lmv; - mdsno_t mds = 0; + u32 mds = 0; int rc; LASSERT(op_data != NULL); @@ -1352,7 +1363,7 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg) LUSTRE_CLI_FLD_HASH_DHT); if (rc) { CERROR("Can't init FLD, err %d\n", rc); - GOTO(out, rc); + goto out; } return 0; @@ -1379,7 +1390,7 @@ static int lmv_cleanup(struct obd_device *obd) return 0; } -static int lmv_process_config(struct obd_device *obd, obd_count len, void *buf) +static int lmv_process_config(struct obd_device *obd, u32 len, void *buf) { struct lustre_cfg *lcfg = buf; struct obd_uuid obd_uuid; @@ -1391,20 +1402,27 @@ static int lmv_process_config(struct obd_device *obd, obd_count len, void *buf) case LCFG_ADD_MDC: /* modify_mdc_tgts add 0:lustre-clilmv 1:lustre-MDT0000_UUID * 2:0 3:1 4:lustre-MDT0000-mdc_UUID */ - if (LUSTRE_CFG_BUFLEN(lcfg, 1) > sizeof(obd_uuid.uuid)) - GOTO(out, rc = -EINVAL); + if (LUSTRE_CFG_BUFLEN(lcfg, 1) > sizeof(obd_uuid.uuid)) { + rc = -EINVAL; + goto out; + } obd_str2uuid(&obd_uuid, lustre_cfg_buf(lcfg, 1)); - if (sscanf(lustre_cfg_buf(lcfg, 2), "%d", &index) != 1) - GOTO(out, rc = -EINVAL); - if (sscanf(lustre_cfg_buf(lcfg, 3), "%d", &gen) != 1) - GOTO(out, rc = -EINVAL); + if (sscanf(lustre_cfg_buf(lcfg, 2), "%d", &index) != 1) { + rc = -EINVAL; + goto out; + } + if (sscanf(lustre_cfg_buf(lcfg, 3), "%d", &gen) != 1) { + rc = -EINVAL; + goto out; + } rc = lmv_add_target(obd, &obd_uuid, index, gen); - GOTO(out, rc); + goto out; default: CERROR("Unknown command: %d\n", lcfg->lcfg_command); - GOTO(out, rc = -EINVAL); + rc = -EINVAL; + goto out; } out: return rc; @@ -1437,7 +1455,7 @@ static int lmv_statfs(const struct lu_env *env, struct obd_export *exp, CERROR("can't stat MDS #%d (%s), error %d\n", i, lmv->tgts[i]->ltd_exp->exp_obd->obd_name, rc); - GOTO(out_free_temp, rc); + goto out_free_temp; } if (i == 0) { @@ -1449,7 +1467,7 @@ static int lmv_statfs(const struct lu_env *env, struct obd_export *exp, * And also clients can be mounted as long as * MDT0 is in service*/ if (flags & OBD_STATFS_FOR_MDT0) - GOTO(out_free_temp, rc); + goto out_free_temp; } else { osfs->os_bavail += temp->os_bavail; osfs->os_blocks += temp->os_blocks; @@ -1480,7 +1498,7 @@ static int lmv_getstatus(struct obd_export *exp, } static int lmv_getxattr(struct obd_export *exp, const struct lu_fid *fid, - struct obd_capa *oc, obd_valid valid, const char *name, + struct obd_capa *oc, u64 valid, const char *name, const char *input, int input_size, int output_size, int flags, struct ptlrpc_request **request) { @@ -1504,7 +1522,7 @@ static int lmv_getxattr(struct obd_export *exp, const struct lu_fid *fid, } static int lmv_setxattr(struct obd_export *exp, const struct lu_fid *fid, - struct obd_capa *oc, obd_valid valid, const char *name, + struct obd_capa *oc, u64 valid, const char *name, const char *input, int input_size, int output_size, int flags, __u32 suppgid, struct ptlrpc_request **request) @@ -1750,12 +1768,16 @@ lmv_enqueue_remote(struct obd_export *exp, struct ldlm_enqueue_info *einfo, ptlrpc_req_finished(req); tgt = lmv_find_target(lmv, &fid1); - if (IS_ERR(tgt)) - GOTO(out, rc = PTR_ERR(tgt)); + if (IS_ERR(tgt)) { + rc = PTR_ERR(tgt); + goto out; + } OBD_ALLOC_PTR(rdata); - if (rdata == NULL) - GOTO(out, rc = -ENOMEM); + if (rdata == NULL) { + rc = -ENOMEM; + goto out; + } rdata->op_fid1 = fid1; rdata->op_bias = MDS_CROSS_REF; @@ -1804,7 +1826,7 @@ lmv_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo, } static int -lmv_getattr_name(struct obd_export *exp,struct md_op_data *op_data, +lmv_getattr_name(struct obd_export *exp, struct md_op_data *op_data, struct ptlrpc_request **request) { struct ptlrpc_request *req = NULL; @@ -2371,7 +2393,7 @@ static int lmv_get_info(const struct lu_env *env, struct obd_export *exp, } int lmv_set_info_async(const struct lu_env *env, struct obd_export *exp, - obd_count keylen, void *key, obd_count vallen, + u32 keylen, void *key, u32 vallen, void *val, struct ptlrpc_request_set *set) { struct lmv_tgt_desc *tgt; @@ -2488,8 +2510,7 @@ int lmv_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp, if (mea->mea_magic == MEA_MAGIC_LAST_CHAR || mea->mea_magic == MEA_MAGIC_ALL_CHARS || - mea->mea_magic == MEA_MAGIC_HASH_SEGMENT) - { + mea->mea_magic == MEA_MAGIC_HASH_SEGMENT) { magic = le32_to_cpu(mea->mea_magic); } else { /* diff --git a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c index 310df44f948d..117002097b28 100644 --- a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c +++ b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_CLASS #include <linux/seq_file.h> -#include <asm/statfs.h> +#include <linux/statfs.h> #include "../include/lprocfs_status.h" #include "../include/obd_class.h" @@ -58,7 +58,7 @@ static const char *placement_name[] = { [PLACEMENT_INVAL_POLICY] = "INVAL" }; -static placement_policy_t placement_name2policy(char *name, int len) +static enum placement_policy placement_name2policy(char *name, int len) { int i; @@ -69,7 +69,7 @@ static placement_policy_t placement_name2policy(char *name, int len) return PLACEMENT_INVAL_POLICY; } -static const char *placement_policy2name(placement_policy_t placement) +static const char *placement_policy2name(enum placement_policy placement) { LASSERT(placement < PLACEMENT_MAX_POLICY); return placement_name[placement]; @@ -94,7 +94,7 @@ static ssize_t lmv_placement_seq_write(struct file *file, struct obd_device *dev = ((struct seq_file *)file->private_data)->private; char dummy[MAX_POLICY_STRING_SIZE + 1]; int len = count; - placement_policy_t policy; + enum placement_policy policy; struct lmv_obd *lmv; if (copy_from_user(dummy, buffer, MAX_POLICY_STRING_SIZE)) |