Whamcloud - gitweb
LU-8191 llite: convert functions to static
authorTimothy Day <timday@amazon.com>
Thu, 28 Mar 2024 22:35:16 +0000 (15:35 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 30 Mar 2024 07:23:43 +0000 (07:23 +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.

Lustre-change: https://review.whamcloud.com/51441
Lustre-commit: a586a2bbc37879dc22382793d1704e7708b80887

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Iafa3bb84de158e31b27b7784243bc15e78187f10
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54613
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/llite/namei.c
lustre/llite/pcc.c
lustre/llite/rw.c
lustre/llite/vvp_dev.c

index 3ea4dbd..e58712f 100644 (file)
@@ -1334,7 +1334,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 ad77952..4b4ef4c 100644 (file)
@@ -4829,7 +4829,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;
@@ -5792,8 +5792,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;
@@ -5857,7 +5857,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 df92ffc..115ea83 100644 (file)
@@ -1893,8 +1893,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;
index f1f1207..9978dec 100644 (file)
@@ -395,7 +395,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 ec3a0ae..6c51c67 100644 (file)
@@ -3608,9 +3608,10 @@ out:
 /*
  * Reset uid, gid or size for the PCC copy masked by @valid.
  */
-int pcc_inode_reset_iattr(struct inode *lustre_inode, struct dentry *dentry,
-                         unsigned int valid, kuid_t uid, kgid_t gid,
-                         loff_t size)
+static int pcc_inode_reset_iattr(struct inode *lustre_inode,
+                                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 070493c..2d55b8f 100644 (file)
@@ -153,7 +153,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 9a51dd6..d304d03 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.
  */
@@ -309,10 +305,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)
@@ -387,8 +381,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;