Whamcloud - gitweb
LU-8191 llite: convert functions to static 41/51441/2
authorTimothy Day <timday@amazon.com>
Fri, 23 Jun 2023 20:46:29 +0000 (20:46 +0000)
committerOleg Drokin <green@whamcloud.com>
Fri, 14 Jul 2023 03:08:29 +0000 (03:08 +0000)
Static analysis shows that a number of functions
could be made static. This patch declares several
functions in llite static.

Also, conserve more * in comments.

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Iafa3bb84de158e31b27b7784243bc15e78187f10
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51441
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: jsimmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_foreign_symlink.c
lustre/llite/llite_lib.c
lustre/llite/namei.c
lustre/llite/pcc.c
lustre/llite/rw.c
lustre/llite/vvp_dev.c
lustre/llite/vvp_io.c

index cc634a9..9289bf8 100644 (file)
@@ -1384,7 +1384,7 @@ out:
        RETURN(rc);
 }
 
-int ll_rmfid(struct file *file, void __user *arg)
+static int ll_rmfid(struct file *file, void __user *arg)
 {
        const struct fid_array __user *ufa = arg;
        struct inode *inode = file_inode(file);
index 1217f72..2089fe4 100644 (file)
@@ -4653,7 +4653,7 @@ out_state:
        }
 }
 
-loff_t ll_lseek(struct file *file, loff_t offset, int whence)
+static loff_t ll_lseek(struct file *file, loff_t offset, int whence)
 {
        struct inode *inode = file_inode(file);
        struct lu_env *env;
@@ -5626,8 +5626,8 @@ int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat)
 }
 #endif
 
-int cl_falloc(struct file *file, struct inode *inode, int mode, loff_t offset,
-             loff_t len)
+static int cl_falloc(struct file *file, struct inode *inode, int mode,
+                    loff_t offset, loff_t len)
 {
        loff_t size = i_size_read(inode);
        struct lu_env *env;
@@ -5691,7 +5691,7 @@ out:
        RETURN(rc);
 }
 
-long ll_fallocate(struct file *filp, int mode, loff_t offset, loff_t len)
+static long ll_fallocate(struct file *filp, int mode, loff_t offset, loff_t len)
 {
        struct inode *inode = file_inode(filp);
        int rc;
index b9ee7da..4830146 100644 (file)
@@ -797,23 +797,25 @@ failed:
 
 /* foreign fake-symlink version of ll_getattr() */
 #if defined(HAVE_USER_NAMESPACE_ARG)
-int ll_foreign_symlink_getattr(struct user_namespace *mnt_userns,
-                              const struct path *path, struct kstat *stat,
-                              u32 request_mask, unsigned int flags)
+static int ll_foreign_symlink_getattr(struct user_namespace *mnt_userns,
+                                     const struct path *path,
+                                     struct kstat *stat, u32 request_mask,
+                                     unsigned int flags)
 {
        return ll_getattr_dentry(path->dentry, stat, request_mask, flags,
                                 true);
 }
 #elif defined(HAVE_INODEOPS_ENHANCED_GETATTR)
-int ll_foreign_symlink_getattr(const struct path *path, struct kstat *stat,
-                              u32 request_mask, unsigned int flags)
+static int ll_foreign_symlink_getattr(const struct path *path,
+                                     struct kstat *stat, u32 request_mask,
+                                     unsigned int flags)
 {
        return ll_getattr_dentry(path->dentry, stat, request_mask, flags,
                                 true);
 }
 #else
-int ll_foreign_symlink_getattr(struct vfsmount *mnt, struct dentry *de,
-                              struct kstat *stat)
+static int ll_foreign_symlink_getattr(struct vfsmount *mnt, struct dentry *de,
+                                     struct kstat *stat)
 {
        return ll_getattr_dentry(de, stat, STATX_BASIC_STATS,
                                 AT_STATX_SYNC_AS_STAT, true);
index 361e156..55ff534 100644 (file)
@@ -2022,8 +2022,8 @@ static int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data)
  * \retval 0           on success
  * \retval negative    errno on failure
  */
-int ll_io_zero_page(struct inode *inode, pgoff_t index, pgoff_t offset,
-                   unsigned len)
+static int ll_io_zero_page(struct inode *inode, pgoff_t index, pgoff_t offset,
+                          unsigned int len)
 {
        struct ll_inode_info *lli = ll_i2info(inode);
        struct cl_object *clob = lli->lli_clob;
@@ -2860,7 +2860,7 @@ static inline bool ll_default_lmv_inherited(struct lmv_stripe_md *pdmv,
 /* if default LMV is implicitly inherited, subdir default LMV is maintained on
  * client side.
  */
-int ll_dir_default_lmv_inherit(struct inode *dir, struct inode *inode)
+static int ll_dir_default_lmv_inherit(struct inode *dir, struct inode *inode)
 {
        struct ll_inode_info *plli = ll_i2info(dir);
        struct ll_inode_info *lli = ll_i2info(inode);
index f4758fb..7ee3cbc 100644 (file)
@@ -398,7 +398,7 @@ static void ll_lock_cancel_bits(struct ldlm_lock *lock, __u64 to_cancel)
 
 /* Check if the given lock may be downgraded instead of canceling and
  * that convert is really needed. */
-int ll_md_need_convert(struct ldlm_lock *lock)
+static int ll_md_need_convert(struct ldlm_lock *lock)
 {
        struct ldlm_namespace *ns = ldlm_lock_to_ns(lock);
        struct inode *inode;
index eeda3a1..bbd8d02 100644 (file)
@@ -781,7 +781,7 @@ pcc_dataset_add(struct pcc_super *super, struct pcc_cmd *cmd)
        return rc;
 }
 
-struct pcc_dataset *
+static struct pcc_dataset *
 pcc_dataset_get(struct pcc_super *super, enum lu_pcc_type type, __u32 id)
 {
        struct pcc_dataset *dataset;
@@ -2273,8 +2273,8 @@ out:
  * Reset uid, gid or size for the PCC copy masked by @valid.
  * TODO: Set the project ID for PCC copy.
  */
-int pcc_inode_reset_iattr(struct dentry *dentry, unsigned int valid,
-                         kuid_t uid, kgid_t gid, loff_t size)
+static int pcc_inode_reset_iattr(struct dentry *dentry, unsigned int valid,
+                                kuid_t uid, kgid_t gid, loff_t size)
 {
        struct inode *inode = dentry->d_inode;
        struct iattr attr;
index ef921eb..91b5784 100644 (file)
@@ -152,7 +152,7 @@ void ll_ra_stats_inc(struct inode *inode, enum ra_stat which)
        ll_ra_stats_inc_sbi(sbi, which);
 }
 
-void ll_ra_stats_add(struct inode *inode, enum ra_stat which, long count)
+static void ll_ra_stats_add(struct inode *inode, enum ra_stat which, long count)
 {
        struct ll_sb_info *sbi = ll_i2sbi(inode);
 
index 4036afc..0217ce4 100644 (file)
 #include "vvp_internal.h"
 #include <linux/kallsyms.h>
 
-/*****************************************************************************
- *
+/*
  * Vvp device and device type functions.
  *
- */
-
-/*
  * vvp_ prefix stands for "Vfs Vm Posix". It corresponds to historical
  * "llite_" (var. "ll_") prefix.
  */
@@ -308,10 +304,8 @@ void vvp_global_fini(void)
        lu_kmem_fini(vvp_caches);
 }
 
-/*****************************************************************************
- *
+/*
  * mirror obd-devices into cl devices.
- *
  */
 
 int cl_sb_init(struct super_block *sb)
@@ -386,8 +380,9 @@ struct vvp_seq_private {
        loff_t                  vvp_prev_pos;
 };
 
-unsigned int ll_filemap_get_one_page_contig(struct address_space *mapping,
-                                            pgoff_t start, struct page **pg)
+static unsigned int
+ll_filemap_get_one_page_contig(struct address_space *mapping,
+                              pgoff_t start, struct page **pg)
 {
 #ifdef HAVE_FILEMAP_GET_FOLIOS_CONTIG
        struct folio_batch fbatch;
index 6c9f11c..acabea0 100644 (file)
@@ -1035,7 +1035,7 @@ static inline void ll_account_page_dirtied(struct page *page,
  * Backwards compat for 3.x, 5.x kernels relating to memcg handling
  * & rename of radix tree to xarray.
  */
-void vvp_set_pagevec_dirty(struct pagevec *pvec)
+static void vvp_set_pagevec_dirty(struct pagevec *pvec)
 {
        struct page *page = pvec->pages[0];
        int count = pagevec_count(pvec);