From 823bf53e80e7a524ae5470123f1715a4b11db851 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Mon, 12 Feb 2024 15:48:54 +0530 Subject: [PATCH] LU-6142 llite: Fix style issues for files under llite This patch fixes issues reported by checkpatch for files: lustre/llite/lcommon_cl.c lustre/llite/vvp_object.c lustre/llite/xattr.c lustre/llite/xattr_cache.c Test-Parameters: trivial Signed-off-by: Arshad Hussain Change-Id: I8c4e89b73e29b1a687e1703e721ee083457be84f Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54005 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Timothy Day Reviewed-by: Oleg Drokin --- lustre/llite/lcommon_cl.c | 26 +++++++++++++------------- lustre/llite/vvp_object.c | 25 +++++++++++-------------- lustre/llite/xattr.c | 5 +++-- lustre/llite/xattr_cache.c | 19 ++++++++++--------- 4 files changed, 37 insertions(+), 38 deletions(-) diff --git a/lustre/llite/lcommon_cl.c b/lustre/llite/lcommon_cl.c index 69bd6da..cf3e215 100644 --- a/lustre/llite/lcommon_cl.c +++ b/lustre/llite/lcommon_cl.c @@ -133,16 +133,16 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md) { struct lu_env *env; struct ll_inode_info *lli; - struct cl_object *clob; - struct lu_site *site; - struct lu_fid *fid; + struct cl_object *clob; + struct lu_site *site; + struct lu_fid *fid; struct cl_object_conf conf = { .coc_inode = inode, .u = { .coc_layout = md->layout, } }; - int result = 0; + int result = 0; __u16 refcheck; LASSERT(md->body->mbo_valid & OBD_MD_FLID); @@ -248,15 +248,15 @@ void cl_inode_fini(struct inode *inode) env = cl_inode_fini_env; } - /* - * cl_object cache is a slave to inode cache (which, in turn - * is a slave to dentry cache), don't keep cl_object in memory - * when its master is evicted. - */ - cl_object_kill(env, clob); - lu_object_ref_del(&clob->co_lu, "inode", inode); - cl_object_put_last(env, clob); - lli->lli_clob = NULL; + /* + * cl_object cache is a slave to inode cache (which, in turn + * is a slave to dentry cache), don't keep cl_object in memory + * when its master is evicted. + */ + cl_object_kill(env, clob); + lu_object_ref_del(&clob->co_lu, "inode", inode); + cl_object_put_last(env, clob); + lli->lli_clob = NULL; if (emergency) mutex_unlock(&cl_inode_fini_guard); else diff --git a/lustre/llite/vvp_object.c b/lustre/llite/vvp_object.c index a931f66..9ded948 100644 --- a/lustre/llite/vvp_object.c +++ b/lustre/llite/vvp_object.c @@ -44,12 +44,7 @@ #include "llite_internal.h" #include "vvp_internal.h" -/***************************************************************************** - * - * Object operations. - * - */ - +/* Object operations.*/ int vvp_object_invariant(const struct cl_object *obj) { struct inode *inode = vvp_object_inode(obj); @@ -80,7 +75,7 @@ static int vvp_object_print(const struct lu_env *env, void *cookie, } static int vvp_attr_get(const struct lu_env *env, struct cl_object *obj, - struct cl_attr *attr) + struct cl_attr *attr) { struct inode *inode = vvp_object_inode(obj); @@ -103,7 +98,7 @@ static int vvp_attr_get(const struct lu_env *env, struct cl_object *obj, } static int vvp_attr_update(const struct lu_env *env, struct cl_object *obj, - const struct cl_attr *attr, unsigned valid) + const struct cl_attr *attr, unsigned int valid) { struct inode *inode = vvp_object_inode(obj); @@ -152,7 +147,8 @@ static int vvp_conf_set(const struct lu_env *env, struct cl_object *obj, * page may be stale due to layout change, and the process * will never be notified. * This operation is expensive but mmap processes have to pay - * a price themselves. */ + * a price themselves. + */ unmap_mapping_range(conf->coc_inode->i_mapping, 0, OBD_OBJECT_EOF, 0); pcc_layout_invalidate(conf->coc_inode); @@ -164,6 +160,7 @@ static int vvp_prune(const struct lu_env *env, struct cl_object *obj) { struct inode *inode = vvp_object_inode(obj); int rc; + ENTRY; rc = cl_sync_file_range(inode, 0, OBD_OBJECT_EOF, CL_FSYNC_LOCAL, 1); @@ -351,12 +348,12 @@ static const struct lu_object_operations vvp_lu_obj_ops = { struct vvp_object *cl_inode2vvp(struct inode *inode) { struct ll_inode_info *lli = ll_i2info(inode); - struct cl_object *obj = lli->lli_clob; - struct lu_object *lu; + struct cl_object *obj = lli->lli_clob; + struct lu_object *lu; - LASSERT(obj != NULL); - lu = lu_object_locate(obj->co_lu.lo_header, &vvp_device_type); - LASSERT(lu != NULL); + LASSERT(obj != NULL); + lu = lu_object_locate(obj->co_lu.lo_header, &vvp_device_type); + LASSERT(lu != NULL); return lu2vvp(lu); } diff --git a/lustre/llite/xattr.c b/lustre/llite/xattr.c index 6333d04..500dc66 100644 --- a/lustre/llite/xattr.c +++ b/lustre/llite/xattr.c @@ -115,7 +115,8 @@ static int ll_xattr_set_common(const struct xattr_handler *handler, /* When setxattr() is called with a size of 0 the value is * unconditionally replaced by "". When removexattr() is - * called we get a NULL value and XATTR_REPLACE for flags. */ + * called we get a NULL value and XATTR_REPLACE for flags. + */ if (!value && flags == XATTR_REPLACE) valid = OBD_MD_FLXATTRRM; else @@ -494,7 +495,7 @@ out_xattr: clear_bit(LL_SBI_USER_XATTR, sbi->ll_flags); } out: - ptlrpc_req_finished(req); + ptlrpc_req_finished(req); RETURN(rc); } diff --git a/lustre/llite/xattr_cache.c b/lustre/llite/xattr_cache.c index a980496..df3d11f 100644 --- a/lustre/llite/xattr_cache.c +++ b/lustre/llite/xattr_cache.c @@ -43,12 +43,11 @@ * using a hash or a tree structure instead of list for faster lookups. */ struct ll_xattr_entry { - struct list_head xe_list; /* protected with - * lli_xattrs_list_rwsem */ + struct list_head xe_list; /* protect by lli_xattrs_list_rwsem */ char *xe_name; /* xattr name, \0-terminated */ char *xe_value; /* xattr value */ - unsigned xe_namelen; /* strlen(xe_name) + 1 */ - unsigned xe_vallen; /* xattr value length */ + unsigned int xe_namelen; /* strlen(xe_name) + 1 */ + unsigned int xe_vallen; /* xattr value length */ }; static struct kmem_cache *xattr_kmem; @@ -132,7 +131,7 @@ static int ll_xattr_cache_find(struct list_head *cache, static int ll_xattr_cache_add(struct list_head *cache, const char *xattr_name, const char *xattr_val, - unsigned xattr_val_len) + unsigned int xattr_val_len) { struct ll_xattr_entry *xattr; @@ -293,7 +292,7 @@ static int ll_xattr_cache_destroy_locked(struct ll_inode_info *lli) RETURN(0); while (ll_xattr_cache_del(&lli->lli_xattrs, NULL) == 0) - /* empty loop */ ; + /* empty loop */; clear_bit(LLIF_XATTR_CACHE_FILLED, &lli->lli_flags); clear_bit(LLIF_XATTR_CACHE, &lli->lli_flags); @@ -378,7 +377,8 @@ static int ll_xattr_find_get_lock(struct inode *inode, mutex_lock(&lli->lli_xattrs_enq_lock); /* inode may have been shrunk and recreated, so data is gone, match lock - * only when data exists. */ + * only when data exists. + */ if (ll_xattr_cache_filled(lli)) { /* Try matching first. */ mode = ll_take_md_lock(inode, MDS_INODELOCK_XATTR, &lockh, 0, @@ -406,8 +406,9 @@ static int ll_xattr_find_get_lock(struct inode *inode, *req = oit->it_request; if (rc < 0) { - CDEBUG(D_CACHE, "md_intent_lock failed with %d for fid "DFID"\n", - rc, PFID(ll_inode2fid(inode))); + CDEBUG(D_CACHE, + "md_intent_lock failed with %d for fid "DFID"\n", rc, + PFID(ll_inode2fid(inode))); mutex_unlock(&lli->lli_xattrs_enq_lock); RETURN(rc); } -- 1.8.3.1