From 42eaefe0e3161266588909668032679f3c46c528 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Sun, 22 Sep 2024 10:08:30 -0400 Subject: [PATCH] LU-6142 mdd: Fix style issues for md_object.h This patch fixes issues reported by checkpatch for both files lustre/include/md_object.h Test-Parameters: trivial Signed-off-by: Arshad Hussain Change-Id: Id28dc3451cb3c79335684b5aa2dd5f821eba4f36 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56478 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Petros Koutoupis Reviewed-by: Oleg Drokin --- lustre/include/md_object.h | 209 ++++++++++++++++++++------------------------- 1 file changed, 92 insertions(+), 117 deletions(-) diff --git a/lustre/include/md_object.h b/lustre/include/md_object.h index a2cba1e..672ee72 100644 --- a/lustre/include/md_object.h +++ b/lustre/include/md_object.h @@ -20,18 +20,15 @@ # error "client code should not depend on md_object.h" #endif /* !HAVE_SERVER_SUPPORT */ -/** \defgroup md md - * Sub-class of lu_object with methods common for "meta-data" objects in MDT +/* md Sub-class of lu_object with methods common for "meta-data" objects in MDT * stack. * * Meta-data objects implement namespace operations: you can link, unlink * them, and treat them as directories. * * Examples: mdt, cmm, and mdt are implementations of md interface. - * @{ */ - /* * super-class definitions. */ @@ -59,15 +56,15 @@ enum ma_valid { }; typedef enum { - MDL_MINMODE = 0, - MDL_EX = 1, - MDL_PW = 2, - MDL_PR = 4, - MDL_CW = 8, - MDL_CR = 16, - MDL_NL = 32, - MDL_GROUP = 64, - MDL_MAXMODE + MDL_MINMODE = 0, + MDL_EX = 1, + MDL_PW = 2, + MDL_PR = 4, + MDL_CW = 8, + MDL_CR = 16, + MDL_NL = 32, + MDL_GROUP = 64, + MDL_MAXMODE } mdl_mode_t; typedef enum { @@ -251,12 +248,12 @@ struct md_object_operations { struct md_device *m, const struct lu_fid *fid); int (*moo_open)(const struct lu_env *env, struct md_object *obj, - u64 open_flags, struct md_op_spec*); + u64 open_flags, struct md_op_spec *spec); int (*moo_close)(const struct lu_env *env, struct md_object *obj, struct md_attr *ma, u64 open_flags); - int (*moo_object_sync)(const struct lu_env *, struct md_object *); + int (*moo_object_sync)(const struct lu_env *env, struct md_object *obj); int (*moo_object_lock)(const struct lu_env *env, struct md_object *obj, struct lustre_handle *lh, @@ -347,32 +344,32 @@ struct md_dir_operations { }; struct md_device_operations { - /** meta-data device related handlers. */ + /* meta-data device related handlers. */ int (*mdo_root_get)(const struct lu_env *env, struct md_device *m, struct lu_fid *f); const struct dt_device_param *(*mdo_dtconf_get)(const struct lu_env *e, struct md_device *m); - int (*mdo_statfs)(const struct lu_env *env, struct md_device *m, - struct obd_statfs *sfs); + int (*mdo_statfs)(const struct lu_env *env, struct md_device *m, + struct obd_statfs *sfs); - int (*mdo_llog_ctxt_get)(const struct lu_env *env, - struct md_device *m, int idx, void **h); + int (*mdo_llog_ctxt_get)(const struct lu_env *env, + struct md_device *m, int idx, void **h); - int (*mdo_iocontrol)(const struct lu_env *env, struct md_device *m, - unsigned int cmd, int len, void *data); + int (*mdo_iocontrol)(const struct lu_env *env, struct md_device *m, + unsigned int cmd, int len, void *data); }; struct md_device { - struct lu_device md_lu_dev; - const struct md_device_operations *md_ops; + struct lu_device md_lu_dev; + const struct md_device_operations *md_ops; }; struct md_object { - struct lu_object mo_lu; - const struct md_object_operations *mo_ops; - const struct md_dir_operations *mo_dir_ops; + struct lu_object mo_lu; + const struct md_object_operations *mo_ops; + const struct md_dir_operations *mo_dir_ops; }; static inline struct md_device *lu2md_dev(const struct lu_device *d) @@ -383,7 +380,7 @@ static inline struct md_device *lu2md_dev(const struct lu_device *d) static inline struct lu_device *md2lu_dev(struct md_device *d) { - return &d->md_lu_dev; + return &d->md_lu_dev; } static inline struct md_object *lu2md(const struct lu_object *o) @@ -394,19 +391,19 @@ static inline struct md_object *lu2md(const struct lu_object *o) static inline int md_device_init(struct md_device *md, struct lu_device_type *t) { - return lu_device_init(&md->md_lu_dev, t); + return lu_device_init(&md->md_lu_dev, t); } static inline void md_device_fini(struct md_device *md) { - lu_device_fini(&md->md_lu_dev); + lu_device_fini(&md->md_lu_dev); } static inline struct md_object *md_object_find_slice(const struct lu_env *env, - struct md_device *md, - const struct lu_fid *f) + struct md_device *md, + const struct lu_fid *f) { - return lu2md(lu_object_find_slice(env, md2lu_dev(md), f, NULL)); + return lu2md(lu_object_find_slice(env, md2lu_dev(md), f, NULL)); } @@ -426,12 +423,11 @@ static inline int mo_attr_get(const struct lu_env *env, struct md_object *m, return m->mo_ops->moo_attr_get(env, m, at); } -static inline int mo_readlink(const struct lu_env *env, - struct md_object *m, - struct lu_buf *buf) +static inline int mo_readlink(const struct lu_env *env, struct md_object *m, + struct lu_buf *buf) { - LASSERT(m->mo_ops->moo_readlink); - return m->mo_ops->moo_readlink(env, m, buf); + LASSERT(m->mo_ops->moo_readlink); + return m->mo_ops->moo_readlink(env, m, buf); } static inline int mo_changelog(const struct lu_env *env, @@ -459,47 +455,40 @@ static inline int mo_changelog(const struct lu_env *env, return rc; } -static inline int mo_attr_set(const struct lu_env *env, - struct md_object *m, - const struct md_attr *at) +static inline int mo_attr_set(const struct lu_env *env, struct md_object *m, + const struct md_attr *at) { - LASSERT(m->mo_ops->moo_attr_set); - return m->mo_ops->moo_attr_set(env, m, at); + LASSERT(m->mo_ops->moo_attr_set); + return m->mo_ops->moo_attr_set(env, m, at); } -static inline int mo_xattr_get(const struct lu_env *env, - struct md_object *m, - struct lu_buf *buf, - const char *name) +static inline int mo_xattr_get(const struct lu_env *env, struct md_object *m, + struct lu_buf *buf, const char *name) { - LASSERT(m->mo_ops->moo_xattr_get); - return m->mo_ops->moo_xattr_get(env, m, buf, name); + LASSERT(m->mo_ops->moo_xattr_get); + return m->mo_ops->moo_xattr_get(env, m, buf, name); } -static inline int mo_xattr_del(const struct lu_env *env, - struct md_object *m, - const char *name) +static inline int mo_xattr_del(const struct lu_env *env, struct md_object *m, + const char *name) { - LASSERT(m->mo_ops->moo_xattr_del); - return m->mo_ops->moo_xattr_del(env, m, name); + LASSERT(m->mo_ops->moo_xattr_del); + return m->mo_ops->moo_xattr_del(env, m, name); } -static inline int mo_xattr_set(const struct lu_env *env, - struct md_object *m, - const struct lu_buf *buf, - const char *name, - int flags) +static inline int mo_xattr_set(const struct lu_env *env, struct md_object *m, + const struct lu_buf *buf, const char *name, + int flags) { - LASSERT(m->mo_ops->moo_xattr_set); - return m->mo_ops->moo_xattr_set(env, m, buf, name, flags); + LASSERT(m->mo_ops->moo_xattr_set); + return m->mo_ops->moo_xattr_set(env, m, buf, name, flags); } -static inline int mo_xattr_list(const struct lu_env *env, - struct md_object *m, - struct lu_buf *buf) +static inline int mo_xattr_list(const struct lu_env *env, struct md_object *m, + struct lu_buf *buf) { - LASSERT(m->mo_ops->moo_xattr_list); - return m->mo_ops->moo_xattr_list(env, m, buf); + LASSERT(m->mo_ops->moo_xattr_list); + return m->mo_ops->moo_xattr_list(env, m, buf); } static inline int mo_invalidate(const struct lu_env *env, struct md_object *m) @@ -550,18 +539,17 @@ static inline int mo_close(const struct lu_env *env, struct md_object *m, return m->mo_ops->moo_close(env, m, ma, open_flags); } -static inline int mo_readpage(const struct lu_env *env, - struct md_object *m, - const struct lu_rdpg *rdpg) +static inline int mo_readpage(const struct lu_env *env, struct md_object *m, + const struct lu_rdpg *rdpg) { - LASSERT(m->mo_ops->moo_readpage); - return m->mo_ops->moo_readpage(env, m, rdpg); + LASSERT(m->mo_ops->moo_readpage); + return m->mo_ops->moo_readpage(env, m, rdpg); } static inline int mo_object_sync(const struct lu_env *env, struct md_object *m) { - LASSERT(m->mo_ops->moo_object_sync); - return m->mo_ops->moo_object_sync(env, m); + LASSERT(m->mo_ops->moo_object_sync); + return m->mo_ops->moo_object_sync(env, m); } static inline int mo_object_lock(const struct lu_env *env, @@ -583,58 +571,48 @@ static inline int mo_object_unlock(const struct lu_env *env, return m->mo_ops->moo_object_unlock(env, m, einfo, policy); } -static inline int mdo_lookup(const struct lu_env *env, - struct md_object *p, - const struct lu_name *lname, - struct lu_fid *f, - struct md_op_spec *spec) +static inline int mdo_lookup(const struct lu_env *env, struct md_object *p, + const struct lu_name *lname, struct lu_fid *f, + struct md_op_spec *spec) { - LASSERT(p->mo_dir_ops->mdo_lookup); - return p->mo_dir_ops->mdo_lookup(env, p, lname, f, spec); + LASSERT(p->mo_dir_ops->mdo_lookup); + return p->mo_dir_ops->mdo_lookup(env, p, lname, f, spec); } static inline mdl_mode_t mdo_lock_mode(const struct lu_env *env, - struct md_object *mo, - mdl_mode_t lm) + struct md_object *mo, mdl_mode_t lm) { - if (mo->mo_dir_ops->mdo_lock_mode == NULL) - return MDL_MINMODE; - return mo->mo_dir_ops->mdo_lock_mode(env, mo, lm); + if (mo->mo_dir_ops->mdo_lock_mode == NULL) + return MDL_MINMODE; + return mo->mo_dir_ops->mdo_lock_mode(env, mo, lm); } -static inline int mdo_create(const struct lu_env *env, - struct md_object *p, - const struct lu_name *lchild_name, - struct md_object *c, - struct md_op_spec *spc, - struct md_attr *at) +static inline int mdo_create(const struct lu_env *env, struct md_object *p, + const struct lu_name *lchild_name, + struct md_object *c, struct md_op_spec *spc, + struct md_attr *at) { LASSERT(p->mo_dir_ops->mdo_create); return p->mo_dir_ops->mdo_create(env, p, lchild_name, c, spc, at); } -static inline int mdo_create_data(const struct lu_env *env, - struct md_object *p, - struct md_object *c, - const struct md_op_spec *spec, - struct md_attr *ma) +static inline int mdo_create_data(const struct lu_env *env, struct md_object *p, + struct md_object *c, + const struct md_op_spec *spec, + struct md_attr *ma) { - LASSERT(c->mo_dir_ops->mdo_create_data); - return c->mo_dir_ops->mdo_create_data(env, p, c, spec, ma); + LASSERT(c->mo_dir_ops->mdo_create_data); + return c->mo_dir_ops->mdo_create_data(env, p, c, spec, ma); } -static inline int mdo_rename(const struct lu_env *env, - struct md_object *sp, - struct md_object *tp, - const struct lu_fid *lf, - const struct lu_name *lsname, - struct md_object *t, - const struct lu_name *ltname, - struct md_attr *ma) +static inline int mdo_rename(const struct lu_env *env, struct md_object *sp, + struct md_object *tp, const struct lu_fid *lf, + const struct lu_name *lsname, struct md_object *t, + const struct lu_name *ltname, struct md_attr *ma) { - LASSERT(tp->mo_dir_ops->mdo_rename); - return tp->mo_dir_ops->mdo_rename(env, sp, tp, lf, lsname, t, ltname, - ma); + LASSERT(tp->mo_dir_ops->mdo_rename); + return tp->mo_dir_ops->mdo_rename(env, sp, tp, lf, lsname, t, ltname, + ma); } static inline int mdo_migrate(const struct lu_env *env, @@ -659,14 +637,12 @@ static inline int mdo_is_subdir(const struct lu_env *env, return mo->mo_dir_ops->mdo_is_subdir(env, mo, fid); } -static inline int mdo_link(const struct lu_env *env, - struct md_object *p, - struct md_object *s, - const struct lu_name *lname, - struct md_attr *ma) +static inline int mdo_link(const struct lu_env *env, struct md_object *p, + struct md_object *s, const struct lu_name *lname, + struct md_attr *ma) { - LASSERT(s->mo_dir_ops->mdo_link); - return s->mo_dir_ops->mdo_link(env, p, s, lname, ma); + LASSERT(s->mo_dir_ops->mdo_link); + return s->mo_dir_ops->mdo_link(env, p, s, lname, ma); } static inline int mdo_unlink(const struct lu_env *env, @@ -737,5 +713,4 @@ int lu_ucred_global_init(void); void lu_ucred_global_fini(void); -/** @} md */ #endif /* _LINUX_MD_OBJECT_H */ -- 1.8.3.1