staging: lustre: remove space between function name and and open parenthesis
PATCH v2 1/13 staging: lustre: remove space between function name and and open parenthesis
Fixes following checkpatch warning:
WARNING: space prohibited between function name and open parenthesis '('
--- drivers/staging/lustre/lustre/mdc/mdc_internal.h | 2 +- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 4 ++-- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 14 +++++++------- 4 files changed, 11 insertions(+), 11 deletions(-)
drivers/staging/lustre/lustre/mdc/mdc_internal.h +1 -1
@@ -40,7 +40,7 @@#include "../include/lustre_mdc.h" #include "../include/lustre_mds.h" -#if defined (CONFIG_PROC_FS ) +#if definedCONFIG_PROC_FS void lprocfs_mdc_init_vars (struct lprocfs_static_vars *lvars);#else static inline void lprocfs_mdc_init_vars (struct lprocfs_static_vars *lvars)
drivers/staging/lustre/lustre/mdc/mdc_lib.c +2 -2
@@ -42,7 +42,7 @@static void __mdc_pack_body (struct mdt_body *b,__u32 suppgid) { -LASSERT (b !=NULL ); +LASSERT (b !=NULL ); b->suppgid = suppgid; b->uid =from_kuid (&init_user_ns,current_uid ());
@@ -409,7 +409,7 @@ void mdc_link_pack(struct ptlrpc_request *req, struct md_op_data *op_data)CLASSERT (sizeof (struct mdt_rec_reint ) ==sizeof (struct mdt_rec_link )); rec =req_capsule_client_get (&req->rq_pill, &RMF_REC_REINT ); -LASSERT (rec !=NULL ); +LASSERT (rec !=NULL ); rec->lk_opcode =REINT_LINK ; rec->lk_fsuid = op_data->op_fsuid;//current->fsuid;
drivers/staging/lustre/lustre/mdc/mdc_locks.c +1 -1
@@ -633,7 +633,7 @@ static int mdc_finish_enqueue(struct obd_export *exp, body =req_capsule_server_get (pill, &RMF_MDT_BODY );if (body ==NULL ) { -CERROR ("Can't swab mdt_body\n" ); +CERROR ("Can't swab mdt_body\n" );return -EPROTO ; }
drivers/staging/lustre/lustre/mdc/mdc_request.c +7 -7
@@ -1702,7 +1702,7 @@ static int mdc_quotactl(struct obd_device *unused, struct obd_export *exp,if (oqc) { *oqctl = *oqc; }else if (!rc) { -CERROR ("Can't unpack obd_quotactl\n" ); +CERROR ("Can't unpack obd_quotactl\n" ); rc = -EPROTO ; } }else if (!rc) {
@@ -2426,14 +2426,14 @@ static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)struct lprocfs_static_vars lvars = {NULL };int rc; -OBD_ALLOC (cli->cl_rpc_lock,sizeof (*cli->cl_rpc_lock)); +OBD_ALLOC (cli->cl_rpc_lock,sizeof (*cli->cl_rpc_lock));if (!cli->cl_rpc_lock)return -ENOMEM ;mdc_init_rpc_lock (cli->cl_rpc_lock);ptlrpcd_addref (); -OBD_ALLOC (cli->cl_close_lock,sizeof (*cli->cl_close_lock)); +OBD_ALLOC (cli->cl_close_lock,sizeof (*cli->cl_close_lock));if (!cli->cl_close_lock)GOTO (err_rpc_lock, rc = -ENOMEM );mdc_init_rpc_lock (cli->cl_close_lock);
@@ -2459,9 +2459,9 @@ static int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)return rc; err_close_lock: -OBD_FREE (cli->cl_close_lock,sizeof (*cli->cl_close_lock)); +OBD_FREE (cli->cl_close_lock,sizeof (*cli->cl_close_lock)); err_rpc_lock: -OBD_FREE (cli->cl_rpc_lock,sizeof (*cli->cl_rpc_lock)); +OBD_FREE (cli->cl_rpc_lock,sizeof (*cli->cl_rpc_lock));ptlrpcd_decref ();return rc; }
@@ -2523,8 +2523,8 @@ static int mdc_cleanup(struct obd_device *obd) {struct client_obd *cli = &obd->u.cli; -OBD_FREE (cli->cl_rpc_lock,sizeof (*cli->cl_rpc_lock)); -OBD_FREE (cli->cl_close_lock,sizeof (*cli->cl_close_lock)); +OBD_FREE (cli->cl_rpc_lock,sizeof (*cli->cl_rpc_lock)); +OBD_FREE (cli->cl_close_lock,sizeof (*cli->cl_close_lock));ptlrpcd_decref ();
Signature · 1 line
1.9.3
PATCH v2 2/13 staging: lustre: remove spaces from start of line
Fixes the following checkpatch warning:
WARNING: please, no spaces at the start of a line
--- drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lustre/lustre/mdc/lproc_mdc.c +2 -2
@@ -209,6 +209,6 @@ static struct lprocfs_vars lprocfs_mdc_module_vars[] = {void lprocfs_mdc_init_vars (struct lprocfs_static_vars *lvars) { - lvars->module_vars = lprocfs_mdc_module_vars; - lvars->obd_vars = lprocfs_mdc_obd_vars; + lvars->module_vars = lprocfs_mdc_module_vars; + lvars->obd_vars = lprocfs_mdc_obd_vars; }
Signature · 1 line
1.9.3
PATCH v2 3/13 staging: lustre: move open brace to next line after functions
In reply to Srikrishan MalikFixes the following checkpatch error:
ERROR: open brace '{' following function declarations go on the next line
--- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 3 ++- drivers/staging/lustre/lustre/mdc/mdc_request.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/staging/lustre/lustre/mdc/mdc_lib.c +2 -1
@@ -256,7 +256,8 @@ void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data,set_mrc_cr_flags (rec, cr_flags); } -static inline __u64 attr_pack (unsigned int ia_valid) { +static inline __u64 attr_pack (unsigned int ia_valid) +{__u64 sa_valid =0 ;if (ia_valid &ATTR_MODE )
drivers/staging/lustre/lustre/mdc/mdc_request.c +2 -1
@@ -2384,7 +2384,8 @@ int mdc_fid_alloc(struct obd_export *exp, struct lu_fid *fid,return seq_client_alloc_fid (NULL , seq, fid); } -struct obd_uuid *mdc_get_uuid (struct obd_export *exp) { +struct obd_uuid *mdc_get_uuid (struct obd_export *exp) +{struct client_obd *cli = &exp->exp_obd->u.cli;return &cli->cl_target_uuid; }
Signature · 1 line
1.9.3
PATCH v2 4/13 staging: lustre: fix lines over 80 chars
In reply to Srikrishan MalikFixes the following checkpatch warning:
WARNING: line over 80 characters
--- drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 6 ++++-- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 9 ++++++--- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 7 ++++--- drivers/staging/lustre/lustre/mdc/mdc_request.c | 6 ++++-- 4 files changed, 18 insertions(+), 10 deletions(-)
drivers/staging/lustre/lustre/mdc/lproc_mdc.c +4 -2
@@ -56,7 +56,8 @@ static ssize_t mdc_max_rpcs_in_flight_seq_write(struct file *file,size_t count, loff_t *off) { - struct obd_device *dev = ((struct seq_file *)file->private_data)->private; + struct obd_device *dev = + ((struct seq_file *)file->private_data)->private;struct client_obd *cli = &dev->u.cli;int val, rc;
@@ -84,7 +85,8 @@ static int mdc_kuc_open(struct inode *inode, struct file *file)static ssize_t mdc_kuc_write (struct file *file,const char *buffer,size_t count,loff_t *off) { -struct obd_device *obd = ((struct seq_file *)file->private_data)->private; +struct obd_device *obd = + ((struct seq_file *)file->private_data)->private;struct kuc_hdr *lh;struct hsm_action_list *hal;struct hsm_action_item *hai;
drivers/staging/lustre/lustre/mdc/mdc_lib.c +6 -3
@@ -52,7 +52,8 @@ static void __mdc_pack_body(struct mdt_body *b, __u32 suppgid) b->capability =cfs_curproc_cap_pack (); } -void mdc_pack_capa (struct ptlrpc_request *req,const struct req_msg_field *field, +void mdc_pack_capa (struct ptlrpc_request *req, +const struct req_msg_field *field,struct obd_capa *oc) {struct req_capsule *pill = &req->rq_pill;
@@ -317,7 +318,8 @@ static void mdc_setattr_pack_rec(struct mdt_rec_setattr *rec, rec->sa_atime =LTIME_S (op_data->op_attr.ia_atime); rec->sa_mtime =LTIME_S (op_data->op_attr.ia_mtime); rec->sa_ctime =LTIME_S (op_data->op_attr.ia_ctime); - rec->sa_attr_flags = ((struct ll_iattr *)&op_data->op_attr)->ia_attr_flags; + rec->sa_attr_flags = + ((struct ll_iattr *)&op_data->op_attr)->ia_attr_flags;if ((op_data->op_attr.ia_valid &ATTR_GID ) &&in_group_p (op_data->op_attr.ia_gid)) rec->sa_suppgid =
@@ -552,7 +554,8 @@ int mdc_enter_request(struct client_obd *cli)list_add_tail (&mcw.mcw_entry, &cli->cl_cache_waiters);init_waitqueue_head (&mcw.mcw_waitq);client_obd_list_unlock (&cli->cl_loi_list_lock); - rc =l_wait_event (mcw.mcw_waitq,mdc_req_avail (cli, &mcw), &lwi); + rc =l_wait_event (mcw.mcw_waitq,mdc_req_avail (cli, &mcw), + &lwi);if (rc) {client_obd_list_lock (&cli->cl_loi_list_lock);if (list_empty (&mcw.mcw_entry))
drivers/staging/lustre/lustre/mdc/mdc_locks.c +4 -3
@@ -450,8 +450,8 @@ static struct ptlrpc_request *mdc_intent_unlink_pack(struct obd_export *exp, }static struct ptlrpc_request *mdc_intent_getattr_pack (struct obd_export *exp, -struct lookup_intent *it, -struct md_op_data *op_data) +struct lookup_intent *it, +struct md_op_data *op_data) {struct ptlrpc_request *req;struct obd_device *obddev =class_exp2obd (exp);
@@ -1039,7 +1039,8 @@ static int mdc_finish_intent_lock(struct obd_export *exp,memcpy (&old_lock, lockh,sizeof (*lockh));if (ldlm_lock_match (NULL ,LDLM_FL_BLOCK_GRANTED ,NULL , -LDLM_IBITS , &policy,LCK_NL , &old_lock,0 )) { +LDLM_IBITS , &policy,LCK_NL , + &old_lock,0 )) {ldlm_lock_decref_and_cancel (lockh, it->d.lustre.it_lock_mode);memcpy (lockh, &old_lock,sizeof (old_lock));
drivers/staging/lustre/lustre/mdc/mdc_request.c +4 -2
@@ -897,7 +897,8 @@ int mdc_close(struct obd_export *exp, struct md_op_data *op_data, mod->mod_open_req->rq_replay =0 ;spin_unlock (&mod->mod_open_req->rq_lock); }else { -CDEBUG (D_HA ,"couldn't find open req; expecting close error\n" ); +CDEBUG (D_HA , +"couldn't find open req; expecting close error\n" ); }mdc_close_pack (req, op_data);
@@ -1084,7 +1085,8 @@ restart_bulk:CERROR ("too many resend retries, returning error\n" );return -EIO ; } - lwi =LWI_TIMEOUT_INTR (cfs_time_seconds (resends),NULL ,NULL ,NULL ); + lwi =LWI_TIMEOUT_INTR (cfs_time_seconds (resends), +NULL ,NULL ,NULL );l_wait_event (waitq,0 , &lwi); goto restart_bulk;
Signature · 1 line
1.9.3
PATCH v2 5/13 staging: lustre: Add missing spaces around operators and braces.
In reply to Srikrishan MalikFixes the following checkpatch errors:
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required after that close brace '}'
--- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 25 +++++++++++++------------ drivers/staging/lustre/lustre/mdc/mdc_locks.c | 5 +++-- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 7 ++++--- 4 files changed, 21 insertions(+), 18 deletions(-)
drivers/staging/lustre/lustre/mdc/mdc_lib.c +13 -12
@@ -345,7 +345,8 @@ void mdc_setattr_pack(struct ptlrpc_request *req, struct md_op_data *op_data,struct mdt_ioepoch *epoch;struct lov_user_md *lum =NULL ; -CLASSERT (sizeof (struct mdt_rec_reint ) ==sizeof (struct mdt_rec_setattr )); +CLASSERT (sizeof (struct mdt_rec_reint ) == +sizeof (struct mdt_rec_setattr )); rec =req_capsule_client_get (&req->rq_pill, &RMF_REC_REINT );mdc_setattr_pack_rec (rec, op_data);
@@ -385,18 +386,18 @@ void mdc_unlink_pack(struct ptlrpc_request *req, struct md_op_data *op_data) rec =req_capsule_client_get (&req->rq_pill, &RMF_REC_REINT );LASSERT (rec !=NULL ); - rec->ul_opcode = op_data->op_cli_flags &CLI_RM_ENTRY ? + rec->ul_opcode = op_data->op_cli_flags &CLI_RM_ENTRY ?REINT_RMENTRY :REINT_UNLINK ; - rec->ul_fsuid = op_data->op_fsuid; - rec->ul_fsgid = op_data->op_fsgid; - rec->ul_cap = op_data->op_cap; - rec->ul_mode = op_data->op_mode; - rec->ul_suppgid1= op_data->op_suppgids[0 ]; - rec->ul_suppgid2=-1 ; - rec->ul_fid1 = op_data->op_fid1; - rec->ul_fid2 = op_data->op_fid2; - rec->ul_time = op_data->op_mod_time; - rec->ul_bias = op_data->op_bias; + rec->ul_fsuid = op_data->op_fsuid; + rec->ul_fsgid = op_data->op_fsgid; + rec->ul_cap = op_data->op_cap; + rec->ul_mode = op_data->op_mode; + rec->ul_suppgid1 = op_data->op_suppgids[0 ]; + rec->ul_suppgid2 =-1 ; + rec->ul_fid1 = op_data->op_fid1; + rec->ul_fid2 = op_data->op_fid2; + rec->ul_time = op_data->op_mod_time; + rec->ul_bias = op_data->op_bias;mdc_pack_capa (req, &RMF_CAPA1 , op_data->op_capa1);
drivers/staging/lustre/lustre/mdc/mdc_locks.c +3 -2
@@ -621,7 +621,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,* function without doing so, and try to replay a failed create * (bug 3440) */ if (it->it_op &IT_OPEN && req->rq_replay && - (!it_disposition (it,DISP_OPEN_OPEN ) ||intent->it_status !=0 )) + (!it_disposition (it,DISP_OPEN_OPEN ) || intent->it_status !=0 ))mdc_clear_replay_flag (req, intent->it_status); DEBUG_REQ(D_RPCTRACE, req, "op: %d disposition: %x, status: %d",
@@ -1047,7 +1047,8 @@ static int mdc_finish_intent_lock(struct obd_export *exp, it->d.lustre.it_lock_handle = lockh->cookie; } } -CDEBUG (D_DENTRY ,"D_IT dentry %.*s intent: %s status %d disp %x rc %d\n" , +CDEBUG (D_DENTRY , +"D_IT dentry %.*s intent: %s status %d disp %x rc %d\n" , op_data->op_namelen, op_data->op_name,ldlm_it2str (it->it_op), it->d.lustre.it_status, it->d.lustre.it_disposition, rc);return rc;
drivers/staging/lustre/lustre/mdc/mdc_reint.c +1 -1
@@ -71,7 +71,7 @@ int mdc_resource_get_unused(struct obd_export *exp, const struct lu_fid *fid, __u64 bits) {struct ldlm_namespace *ns = exp->exp_obd->obd_namespace; -ldlm_policy_data_t policy = {{0 }}; +ldlm_policy_data_t policy = {};struct ldlm_res_id res_id;struct ldlm_resource *res;int count;
drivers/staging/lustre/lustre/mdc/mdc_request.c +4 -3
@@ -326,7 +326,8 @@ static int mdc_is_subdir(struct obd_export *exp,return rc; } -static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt, +static int mdc_xattr_common(struct obd_export *exp, + const struct req_format *fmt, const struct lu_fid *fid, struct obd_capa *oc, int opcode, obd_valid valid, const char *xattr_name, const char *input,
@@ -544,7 +545,7 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,int lmvsize;struct lov_mds_md *lmv; -if (!S_ISDIR (md->body->mode)) { +if (!S_ISDIR (md->body->mode)) {CDEBUG (D_INFO ,"OBD_MD_FLDIREA set, should be a " "directory, but is not\n" );GOTO (out, rc = -EPROTO );
@@ -1536,7 +1537,7 @@ static int changelog_kkuc_cb(const struct lu_env *env, struct llog_handle *llh,memcpy (lh +1 , &rec->cr, len -sizeof (*lh)); rc =libcfs_kkuc_msg_put (cs->cs_fp, lh); -CDEBUG (D_CHANGELOG ,"kucmsg fp %p len %d rc %d\n" , cs->cs_fp, len,rc); +CDEBUG (D_CHANGELOG ,"kucmsg fp %p len %d rc %d\n" , cs->cs_fp, len, rc);return rc; }
Signature · 1 line
1.9.3
PATCH v2 6/13 staging: lustre: replace c99 style comments with C89
In reply to Srikrishan MalikFixes the following checkpatch error:
ERROR: do not use C99 // comments
--- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/mdc/mdc_lib.c +3 -3
@@ -416,9 +416,9 @@ void mdc_link_pack(struct ptlrpc_request *req, struct md_op_data *op_data)LASSERT (rec !=NULL ); rec->lk_opcode =REINT_LINK ; - rec->lk_fsuid = op_data->op_fsuid;//current->fsuid; - rec->lk_fsgid = op_data->op_fsgid;//current->fsgid; - rec->lk_cap = op_data->op_cap;//current->cap_effective; + rec->lk_fsuid = op_data->op_fsuid;/* current->fsuid; */ + rec->lk_fsgid = op_data->op_fsgid;/* current->fsgid; */ + rec->lk_cap = op_data->op_cap;/* current->cap_effective; */ rec->lk_suppgid1 = op_data->op_suppgids[0 ]; rec->lk_suppgid2 = op_data->op_suppgids[1 ]; rec->lk_fid1 = op_data->op_fid1;
Signature · 1 line
1.9.3
PATCH v2 7/13 staging: lustre: add blank lines after declarations
In reply to Srikrishan MalikFixes the following checkpatch warning:
WARNING: Missing a blank line after declarations
--- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 1 + drivers/staging/lustre/lustre/mdc/mdc_locks.c | 3 +++ drivers/staging/lustre/lustre/mdc/mdc_request.c | 5 +++++ 3 files changed, 9 insertions(+)
drivers/staging/lustre/lustre/mdc/mdc_lib.c +1 -0
@@ -490,6 +490,7 @@ void mdc_getattr_pack(struct ptlrpc_request *req, __u64 valid, int flags,if (op_data->op_name) {char *tmp =req_capsule_client_get (&req->rq_pill, &RMF_NAME ); +LOGL0 (op_data->op_name, op_data->op_namelen, tmp); }
drivers/staging/lustre/lustre/mdc/mdc_locks.c +3 -0
@@ -134,6 +134,7 @@ int mdc_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,if (lock->l_resource->lr_lvb_inode && lock->l_resource->lr_lvb_inode != data) {struct inode *old_inode = lock->l_resource->lr_lvb_inode; + LASSERTF(old_inode->i_state & I_FREEING, "Found existing inode %p/%lu/%u state %lu in lock: " "setting data to %p/%lu/%u\n", old_inode,
@@ -678,6 +679,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,*/ if ((it->it_op &IT_OPEN ) && req->rq_replay) {void *lmm; +if (req_capsule_get_size (pill, &RMF_EADATA ,RCL_CLIENT ) < body->eadatasize)
@@ -1029,6 +1031,7 @@ static int mdc_finish_intent_lock(struct obd_export *exp, lock =ldlm_handle2lock (lockh);if (lock) {ldlm_policy_data_t policy = lock->l_policy_data; +LDLM_DEBUG (lock,"matching against this" ); LASSERTF(fid_res_name_eq(&mdt_body->fid1,
drivers/staging/lustre/lustre/mdc/mdc_request.c +5 -0
@@ -203,6 +203,7 @@ static int mdc_getattr_common(struct obd_export *exp,if (body->valid &OBD_MD_FLMDSCAPA ) {struct lustre_capa *capa; + capa =req_capsule_server_get (pill, &RMF_CAPA1 );if (capa ==NULL )return -EPROTO ;
@@ -283,6 +284,7 @@ int mdc_getattr_name(struct obd_export *exp, struct md_op_data *op_data,if (op_data->op_name) {char *name =req_capsule_client_get (&req->rq_pill, &RMF_NAME ); +LASSERT (strnlen (op_data->op_name, op_data->op_namelen) == op_data->op_namelen);memcpy (name, op_data->op_name, op_data->op_namelen);
@@ -696,6 +698,7 @@ void mdc_replay_open(struct ptlrpc_request *req)void mdc_commit_open (struct ptlrpc_request *req) {struct md_open_data *mod = req->rq_cb_data; +if (mod ==NULL )return ;
@@ -2390,6 +2393,7 @@ int mdc_fid_alloc(struct obd_export *exp, struct lu_fid *fid,struct obd_uuid *mdc_get_uuid (struct obd_export *exp) {struct client_obd *cli = &exp->exp_obd->u.cli; +return &cli->cl_target_uuid; }
@@ -2742,6 +2746,7 @@ int __init mdc_init(void) {int rc;struct lprocfs_static_vars lvars = {NULL }; +lprocfs_mdc_init_vars (&lvars); rc = class_register_type(&mdc_obd_ops, &mdc_md_ops, lvars.module_vars,
Signature · 1 line
1.9.3
PATCH v2 8/13 staging: lustre: fix multi line strings
In reply to Srikrishan MalikFixes the following checkpatch warning:
WARNING: quoted string split across lines
--- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 9 +++---- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 3 +-- drivers/staging/lustre/lustre/mdc/mdc_request.c | 36 ++++++++++++------------- 3 files changed, 23 insertions(+), 25 deletions(-)
drivers/staging/lustre/lustre/mdc/mdc_locks.c +4 -5
@@ -136,11 +136,10 @@ int mdc_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,struct inode *old_inode = lock->l_resource->lr_lvb_inode;LASSERTF (old_inode->i_state &I_FREEING , -"Found existing inode %p/%lu/%u state %lu in lock: " -"setting data to %p/%lu/%u\n" , old_inode, - old_inode->i_ino, old_inode->i_generation, - old_inode->i_state, - new_inode, new_inode->i_ino, new_inode->i_generation); +"Found existing inode %p/%lu/%u state %lu in lock: setting data to %p/%lu/%u\n" , + old_inode, old_inode->i_ino, old_inode->i_generation, + old_inode->i_state, new_inode, new_inode->i_ino, + new_inode->i_generation); } lock->l_resource->lr_lvb_inode = new_inode;if (bits)
drivers/staging/lustre/lustre/mdc/mdc_reint.c +1 -2
@@ -158,8 +158,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data, *mod =obd_mod_alloc ();if (*mod ==NULL ) { -DEBUG_REQ (D_ERROR , req,"Can't allocate " -"md_open_data" ); +DEBUG_REQ (D_ERROR , req,"Can't allocate md_open_data" ); }else { req->rq_replay =1 ; req->rq_cb_data = *mod;
drivers/staging/lustre/lustre/mdc/mdc_request.c +18 -18
@@ -517,14 +517,14 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,struct lov_mds_md *lmm;if (!S_ISREG (md->body->mode)) { -CDEBUG (D_INFO ,"OBD_MD_FLEASIZE set, should be a " -"regular file, but is not\n" ); +CDEBUG (D_INFO , +"OBD_MD_FLEASIZE set, should be a regular file, but is not\n" );GOTO (out, rc = -EPROTO ); }if (md->body->eadatasize ==0 ) { -CDEBUG (D_INFO ,"OBD_MD_FLEASIZE set, " -"but eadatasize 0\n" ); +CDEBUG (D_INFO , +"OBD_MD_FLEASIZE set, but eadatasize 0\n" );GOTO (out, rc = -EPROTO ); } lmmsize = md->body->eadatasize;
@@ -537,8 +537,8 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,GOTO (out, rc);if (rc <sizeof (*md->lsm)) { -CDEBUG (D_INFO ,"lsm size too small: " -"rc < sizeof (*md->lsm) (%d < %d)\n" , +CDEBUG (D_INFO , +"lsm size too small: rc < sizeof (*md->lsm) (%d < %d)\n" , rc, (int )sizeof (*md->lsm));GOTO (out, rc = -EPROTO ); }
@@ -548,14 +548,14 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,struct lov_mds_md *lmv;if (!S_ISDIR (md->body->mode)) { -CDEBUG (D_INFO ,"OBD_MD_FLDIREA set, should be a " -"directory, but is not\n" ); +CDEBUG (D_INFO , +"OBD_MD_FLDIREA set, should be a directory, but is not\n" );GOTO (out, rc = -EPROTO ); }if (md->body->eadatasize ==0 ) { -CDEBUG (D_INFO ,"OBD_MD_FLDIREA is set, " -"but eadatasize 0\n" ); +CDEBUG (D_INFO , +"OBD_MD_FLDIREA is set, but eadatasize 0\n" );return -EPROTO ; }if (md->body->valid &OBD_MD_MEA ) {
@@ -571,8 +571,8 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,GOTO (out, rc);if (rc <sizeof (*md->mea)) { -CDEBUG (D_INFO ,"size too small: " -"rc < sizeof(*md->mea) (%d < %d)\n" , +CDEBUG (D_INFO , +"size too small: rc < sizeof(*md->mea) (%d < %d)\n" , rc, (int )sizeof (*md->mea));GOTO (out, rc = -EPROTO ); }
@@ -778,8 +778,8 @@ int mdc_set_open_replay_data(struct obd_export *exp, rec->cr_old_handle.cookie = body->handle.cookie; open_req->rq_replay_cb = mdc_replay_open;if (!fid_is_sane (&body->fid1)) { -DEBUG_REQ (D_ERROR , open_req,"Saving replay request with " -"insane fid" ); +DEBUG_REQ (D_ERROR , open_req, +"Saving replay request with insane fid" );LBUG (); }
@@ -928,8 +928,8 @@ int mdc_close(struct obd_export *exp, struct md_op_data *op_data, rc =lustre_msg_get_status (req->rq_repmsg);if (lustre_msg_get_type (req->rq_repmsg) ==PTL_RPC_MSG_ERR ) { -DEBUG_REQ (D_ERROR , req,"type == PTL_RPC_MSG_ERR, err " -"= %d" , rc); +DEBUG_REQ (D_ERROR , req, +"type == PTL_RPC_MSG_ERR, err = %d" , rc);if (rc >0 ) rc = -rc; }
@@ -2055,8 +2055,8 @@ static int mdc_hsm_copytool_send(int len, void *val)return -EPROTO ; } -CDEBUG (D_HSM ," Received message mg=%x t=%d m=%d l=%d actions=%d " -"on %s\n" , +CDEBUG (D_HSM , +" Received message mg=%x t=%d m=%d l=%d actions=%d on %s\n" , lh->kuc_magic, lh->kuc_transport, lh->kuc_msgtype, lh->kuc_msglen, hal->hal_count, hal->hal_fsname);
Signature · 1 line
1.9.3
Re: [PATCH v2 08/13] staging: lustre: fix multi line strings
Quoted 9 lines · Srikrishan Malik
Fixes the following checkpatch warning:
WARNING: quoted string split across lines
drivers/staging/lustre/lustre/mdc/mdc_request.c +0
-0
drivers/staging/lustre/lustre/mdc/mdc_request.c static int mdc_hsm_copytool_send(int len, void *val) · line 2061
Quoted 9 lines
drivers/staging/lustre/lustre/mdc/mdc_request.c +2
-2@@ -2055,8 +2055,8 @@ static int mdc_hsm_copytool_send(int len, void *val)return -EPROTO ; } -CDEBUG (D_HSM ," Received message mg=%x t=%d m=%d l=%d actions=%d " -"on %s\n" , +CDEBUG (D_HSM , +" Received message mg=%x t=%d m=%d l=%d actions=%d on %s\n" , lh->kuc_magic, lh->kuc_transport, lh->kuc_msgtype, lh->kuc_msglen, hal->hal_count, hal->hal_fsname);
I imagine we can drop the leading space here as well.
Thanks.
Bye,
Oleg
Re: [PATCH v2 08/13] staging: lustre: fix multi line strings
Quoted 15 lines · Oleg
Quoted 12 lines · Srikrishan Malik
Fixes the following checkpatch warning:
WARNING: quoted string split across lines
drivers/staging/lustre/lustre/mdc/mdc_request.c +0
-0@@ -2055,8 +2055,8 @@ static int mdc_hsm_copytool_send(int len, void *val)return -EPROTO ; }
Quoted 8 lines
drivers/staging/lustre/lustre/mdc/mdc_request.c static int mdc_hsm_copytool_send(int len, void *val) · line 2061
Quoted 6 lines
drivers/staging/lustre/lustre/mdc/mdc_request.c +2
-2-CDEBUG (D_HSM ," Received message mg=%x t=%d m=%d l=%d actions=%d " -"on %s\n" , +CDEBUG (D_HSM , +" Received message mg=%x t=%d m=%d l=%d actions=%d on %s\n" , lh->kuc_magic, lh->kuc_transport, lh->kuc_msgtype, lh->kuc_msglen, hal->hal_count, hal->hal_fsname);I imagine we can drop the leading space here as well.
ok, I will resend this patch including the suggested change. I was not sure if we can do this in single patch.
Quoted 5 lines
Thanks.
Bye,
Oleg
PATCH v3 8/13 ] staging: lustre: fix multi line strings
In reply to Srikrishan MalikFixes the following checkpatch warning:
WARNING: quoted string split across lines
---
Changes in v3: Removed leading space from debug message.
drivers/staging/lustre/lustre/mdc/mdc_locks.c | 9 +++---- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 3 +-- drivers/staging/lustre/lustre/mdc/mdc_request.c | 36 ++++++++++++------------- 3 files changed, 23 insertions(+), 25 deletions(-)
drivers/staging/lustre/lustre/mdc/mdc_locks.c +4 -5
@@ -136,11 +136,10 @@ int mdc_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,struct inode *old_inode = lock->l_resource->lr_lvb_inode;LASSERTF (old_inode->i_state &I_FREEING , -"Found existing inode %p/%lu/%u state %lu in lock: " -"setting data to %p/%lu/%u\n" , old_inode, - old_inode->i_ino, old_inode->i_generation, - old_inode->i_state, - new_inode, new_inode->i_ino, new_inode->i_generation); +"Found existing inode %p/%lu/%u state %lu in lock: setting data to %p/%lu/%u\n" , + old_inode, old_inode->i_ino, old_inode->i_generation, + old_inode->i_state, new_inode, new_inode->i_ino, + new_inode->i_generation); } lock->l_resource->lr_lvb_inode = new_inode;if (bits)
drivers/staging/lustre/lustre/mdc/mdc_reint.c +1 -2
@@ -158,8 +158,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data, *mod =obd_mod_alloc ();if (*mod ==NULL ) { -DEBUG_REQ (D_ERROR , req,"Can't allocate " -"md_open_data" ); +DEBUG_REQ (D_ERROR , req,"Can't allocate md_open_data" ); }else { req->rq_replay =1 ; req->rq_cb_data = *mod;
drivers/staging/lustre/lustre/mdc/mdc_request.c +18 -18
@@ -517,14 +517,14 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,struct lov_mds_md *lmm;if (!S_ISREG (md->body->mode)) { -CDEBUG (D_INFO ,"OBD_MD_FLEASIZE set, should be a " -"regular file, but is not\n" ); +CDEBUG (D_INFO , +"OBD_MD_FLEASIZE set, should be a regular file, but is not\n" );GOTO (out, rc = -EPROTO ); }if (md->body->eadatasize ==0 ) { -CDEBUG (D_INFO ,"OBD_MD_FLEASIZE set, " -"but eadatasize 0\n" ); +CDEBUG (D_INFO , +"OBD_MD_FLEASIZE set, but eadatasize 0\n" );GOTO (out, rc = -EPROTO ); } lmmsize = md->body->eadatasize;
@@ -537,8 +537,8 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,GOTO (out, rc);if (rc <sizeof (*md->lsm)) { -CDEBUG (D_INFO ,"lsm size too small: " -"rc < sizeof (*md->lsm) (%d < %d)\n" , +CDEBUG (D_INFO , +"lsm size too small: rc < sizeof (*md->lsm) (%d < %d)\n" , rc, (int )sizeof (*md->lsm));GOTO (out, rc = -EPROTO ); }
@@ -548,14 +548,14 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,struct lov_mds_md *lmv;if (!S_ISDIR (md->body->mode)) { -CDEBUG (D_INFO ,"OBD_MD_FLDIREA set, should be a " -"directory, but is not\n" ); +CDEBUG (D_INFO , +"OBD_MD_FLDIREA set, should be a directory, but is not\n" );GOTO (out, rc = -EPROTO ); }if (md->body->eadatasize ==0 ) { -CDEBUG (D_INFO ,"OBD_MD_FLDIREA is set, " -"but eadatasize 0\n" ); +CDEBUG (D_INFO , +"OBD_MD_FLDIREA is set, but eadatasize 0\n" );return -EPROTO ; }if (md->body->valid &OBD_MD_MEA ) {
@@ -571,8 +571,8 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req,GOTO (out, rc);if (rc <sizeof (*md->mea)) { -CDEBUG (D_INFO ,"size too small: " -"rc < sizeof(*md->mea) (%d < %d)\n" , +CDEBUG (D_INFO , +"size too small: rc < sizeof(*md->mea) (%d < %d)\n" , rc, (int )sizeof (*md->mea));GOTO (out, rc = -EPROTO ); }
@@ -778,8 +778,8 @@ int mdc_set_open_replay_data(struct obd_export *exp, rec->cr_old_handle.cookie = body->handle.cookie; open_req->rq_replay_cb = mdc_replay_open;if (!fid_is_sane (&body->fid1)) { -DEBUG_REQ (D_ERROR , open_req,"Saving replay request with " -"insane fid" ); +DEBUG_REQ (D_ERROR , open_req, +"Saving replay request with insane fid" );LBUG (); }
@@ -928,8 +928,8 @@ int mdc_close(struct obd_export *exp, struct md_op_data *op_data, rc =lustre_msg_get_status (req->rq_repmsg);if (lustre_msg_get_type (req->rq_repmsg) ==PTL_RPC_MSG_ERR ) { -DEBUG_REQ (D_ERROR , req,"type == PTL_RPC_MSG_ERR, err " -"= %d" , rc); +DEBUG_REQ (D_ERROR , req, +"type == PTL_RPC_MSG_ERR, err = %d" , rc);if (rc >0 ) rc = -rc; }
@@ -2055,8 +2055,8 @@ static int mdc_hsm_copytool_send(int len, void *val)return -EPROTO ; } -CDEBUG (D_HSM ," Received message mg=%x t=%d m=%d l=%d actions=%d " -"on %s\n" , +CDEBUG (D_HSM , +"Received message mg=%x t=%d m=%d l=%d actions=%d on %s\n" , lh->kuc_magic, lh->kuc_transport, lh->kuc_msgtype, lh->kuc_msglen, hal->hal_count, hal->hal_fsname);
Signature · 1 line
1.9.3
PATCH v2 9/13 staging: lustre: Added space between type name and *
In reply to Srikrishan MalikFixes the following checkpatch error:
ERROR: "(foo*)" should be "(foo *)"
--- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/mdc/mdc_locks.c +1 -1
@@ -218,7 +218,7 @@ int mdc_find_cbdata(struct obd_export *exp,struct ldlm_res_id res_id;int rc =0 ; -fid_build_reg_res_name ((struct lu_fid *)fid, &res_id); +fid_build_reg_res_name ((struct lu_fid *)fid, &res_id); rc =ldlm_resource_iterate (class_exp2obd (exp)->obd_namespace, &res_id, it, data);if (rc ==LDLM_ITER_STOP )
Signature · 1 line
1.9.3
PATCH v2 10/13 staging: lustre: Fix misplaced opening brace warnings
In reply to Srikrishan MalikFixes the following checkpatch error:
ERROR: that open brace { should be on the previous line
--- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 18 +++++++++++------- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 3 +-- drivers/staging/lustre/lustre/mdc/mdc_request.c | 7 +++++-- 3 files changed, 17 insertions(+), 11 deletions(-)
drivers/staging/lustre/lustre/mdc/mdc_locks.c +11 -7
@@ -785,14 +785,18 @@ int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,__u64 flags, saved_flags = extra_lock_flags;int rc;struct ldlm_res_id res_id; -static const ldlm_policy_data_t lookup_policy = - { .l_inodebits = {MDS_INODELOCK_LOOKUP } }; -static const ldlm_policy_data_t update_policy = - { .l_inodebits = {MDS_INODELOCK_UPDATE } }; -static const ldlm_policy_data_t layout_policy = - { .l_inodebits = {MDS_INODELOCK_LAYOUT } }; +static const ldlm_policy_data_t lookup_policy = { + .l_inodebits = {MDS_INODELOCK_LOOKUP } + }; +static const ldlm_policy_data_t update_policy = { + .l_inodebits = {MDS_INODELOCK_UPDATE } + }; +static const ldlm_policy_data_t layout_policy = { + .l_inodebits = {MDS_INODELOCK_LAYOUT } + };static const ldlm_policy_data_t getxattr_policy = { - .l_inodebits = {MDS_INODELOCK_XATTR } }; + .l_inodebits = {MDS_INODELOCK_XATTR } + };ldlm_policy_data_t const *policy = &lookup_policy;int generation, resends =0 ;struct ldlm_reply *lockrep;
drivers/staging/lustre/lustre/mdc/mdc_reint.c +1 -2
@@ -152,8 +152,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,ptlrpc_request_set_replen (req);if (mod && (op_data->op_flags &MF_EPOCH_OPEN ) && - req->rq_import->imp_replayable) - { + req->rq_import->imp_replayable) {LASSERT (*mod ==NULL ); *mod =obd_mod_alloc ();
drivers/staging/lustre/lustre/mdc/mdc_request.c +5 -2
@@ -1794,8 +1794,11 @@ static int mdc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,GOTO (out, rc);case OBD_IOC_CHANGELOG_CLEAR : {struct ioc_changelog *icc = karg; -struct changelog_setinfo cs = - {.cs_recno = icc->icc_recno, .cs_id = icc->icc_id}; +struct changelog_setinfo cs = { + .cs_recno = icc->icc_recno, + .cs_id = icc->icc_id + }; + rc =obd_set_info_async (NULL , exp,strlen (KEY_CHANGELOG_CLEAR ),KEY_CHANGELOG_CLEAR ,sizeof (cs), &cs,NULL );
Signature · 1 line
1.9.3
PATCH v2 11/13 staging: lustre: move else on the same line as closing brace
In reply to Srikrishan MalikFix the following checkpatch error:
ERROR: else should follow close brace '}'
--- drivers/staging/lustre/lustre/mdc/mdc_request.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/lustre/lustre/mdc/mdc_request.c +1 -2
@@ -587,8 +587,7 @@ int mdc_get_lustre_md(struct obd_export *exp, struct ptlrpc_request *req, lustre_swab_mdt_remote_perm);if (!md->remote_perm)GOTO (out, rc = -EPROTO ); - } -else if (md->body->valid &OBD_MD_FLACL ) { + }else if (md->body->valid &OBD_MD_FLACL ) {/* for ACL, it's possible that FLACL is set but aclsize is zero. * only when aclsize != 0 there's an actual segment for ACL * in reply buffer.
Signature · 1 line
1.9.3
PATCH v2 12/13 staging: lustre: remove parentheses usage with return
In reply to Srikrishan MalikFix the following checkpatch error:
ERROR: return is not a function, parentheses are not required
--- drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/mdc/mdc_request.c +1 -1
@@ -2588,7 +2588,7 @@ static int mdc_process_config(struct obd_device *obd, obd_count len, void *buf) rc =0 ;break ; } -return (rc); +return rc; }
Signature · 1 line
1.9.3
PATCH v2 13/13 staging: lustre: Cleanup variable declarations in mdc_enqueue()
In reply to Srikrishan MalikChanges:
- move const union vars to the top
- move rc to bottom
- do not initialize req
- set lvb_type to enum member instead of 0
- change __u64 to u64
- fix inconsistant columnization
---
These changes were suggested by Dan Carpenter <[email protected]>.
drivers/staging/lustre/lustre/mdc/mdc_locks.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/staging/lustre/lustre/mdc/mdc_locks.c +9 -9
@@ -778,13 +778,8 @@ static int mdc_finish_enqueue(struct obd_export *exp,int mdc_enqueue (struct obd_export *exp,struct ldlm_enqueue_info *einfo,struct lookup_intent *it,struct md_op_data *op_data,struct lustre_handle *lockh,void *lmm,int lmmsize, -struct ptlrpc_request **reqp,__u64 extra_lock_flags) +struct ptlrpc_request **reqp,u64 extra_lock_flags) { -struct obd_device *obddev =class_exp2obd (exp); -struct ptlrpc_request *req =NULL ; -__u64 flags, saved_flags = extra_lock_flags; -int rc; -struct ldlm_res_id res_id;static const ldlm_policy_data_t lookup_policy = { .l_inodebits = {MDS_INODELOCK_LOOKUP } };
@@ -798,9 +793,14 @@ int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo, .l_inodebits = { MDS_INODELOCK_XATTR } };ldlm_policy_data_t const *policy = &lookup_policy; -int generation, resends =0 ; -struct ldlm_reply *lockrep; -enum lvb_type lvb_type =0 ; +struct obd_device *obddev =class_exp2obd (exp); +struct ptlrpc_request *req; +u64 flags, saved_flags = extra_lock_flags; +struct ldlm_res_id res_id; +int generation, resends =0 ; +struct ldlm_reply *lockrep; +enum lvb_type lvb_type =LVB_T_NONE ; +int rc;LASSERTF (!it || einfo->ei_type ==LDLM_IBITS ,"lock type %d\n" , einfo->ei_type);
Signature · 1 line
1.9.3