Whamcloud - gitweb
LU-5396 llite: make some functions static 11/12211/5
authorFrank Zago <fzago@cray.com>
Mon, 8 Sep 2014 00:24:35 +0000 (19:24 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 9 Dec 2014 08:11:19 +0000 (08:11 +0000)
Some functions and variables are only used in their C file, so reduce
their scope. This reduces the code size, and fixes sparse warnings
such as:

  warning: symbol 'proc_lnet_routes' was not declared.
      Should it be static?
  warning: symbol 'proc_lnet_routers' was not declared.
      Should it be static?

Some prototypes were removed from C files and added to the proper
header.

Signed-off-by: Frank Zago <fzago@cray.com>
Change-Id: Id6b13d2b5ceb30de02b60ed6be24d4a496454b70
Reviewed-on: http://review.whamcloud.com/12211
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lprocfs_status.h
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/lproc_llite.c
lustre/llite/range_lock.c

index 4e992e6..5b62f8f 100644 (file)
@@ -776,7 +776,7 @@ static int name##_single_open(struct inode *inode, struct file *file)       \
        LPROCFS_ENTRY_CHECK(PDE(inode));                                \
        return single_open(file, name##_seq_show, PDE_DATA(inode));     \
 }                                                                      \
-struct file_operations name##_fops = {                                 \
+static const struct file_operations name##_fops = {                    \
        .owner   = THIS_MODULE,                                         \
        .open    = name##_single_open,                                  \
        .read    = seq_read,                                            \
index eb1a85a..28cb292 100644 (file)
@@ -1669,7 +1669,8 @@ ll_get_grouplock(struct inode *inode, struct file *file, unsigned long arg)
        RETURN(0);
 }
 
-int ll_put_grouplock(struct inode *inode, struct file *file, unsigned long arg)
+static int ll_put_grouplock(struct inode *inode, struct file *file,
+                           unsigned long arg)
 {
        struct ll_inode_info   *lli = ll_i2info(inode);
        struct ll_file_data    *fd = LUSTRE_FPRIVATE(file);
@@ -4035,4 +4036,3 @@ int ll_layout_restore(struct inode *inode, loff_t offset, __u64 length)
        OBD_FREE(hur, len);
        RETURN(rc);
 }
-
index b71ab58..25b92b8 100644 (file)
@@ -1081,9 +1081,10 @@ struct vvp_thread_info {
         struct ll_cl_context vti_io_ctx;
 };
 
+extern struct lu_context_key vvp_key;
+
 static inline struct vvp_thread_info *vvp_env_info(const struct lu_env *env)
 {
-        extern struct lu_context_key vvp_key;
         struct vvp_thread_info      *info;
 
         info = lu_context_key_get(&env->le_ctx, &vvp_key);
@@ -1105,9 +1106,10 @@ struct vvp_session {
         struct vvp_io         vs_ios;
 };
 
+extern struct lu_context_key vvp_session_key;
+
 static inline struct vvp_session *vvp_env_session(const struct lu_env *env)
 {
-        extern struct lu_context_key vvp_session_key;
         struct vvp_session *ses;
 
         ses = lu_context_key_get(env->le_ses, &vvp_session_key);
index b1dec67..91993d7 100644 (file)
@@ -1477,8 +1477,8 @@ void ll_clear_inode(struct inode *inode)
        EXIT;
 }
 
-int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
-                  struct md_open_data **mod)
+static int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
+                        struct md_open_data **mod)
 {
         struct lustre_md md;
         struct inode *inode = dentry->d_inode;
index a4d374e..a622863 100644 (file)
@@ -47,9 +47,9 @@ struct proc_dir_entry *proc_lustre_fs_root;
 
 #ifdef LPROCFS
 /* /proc/lustre/llite mount point registration */
-struct file_operations ll_rw_extents_stats_fops;
-struct file_operations ll_rw_extents_stats_pp_fops;
-struct file_operations ll_rw_offset_stats_fops;
+static const struct file_operations ll_rw_extents_stats_fops;
+static const struct file_operations ll_rw_extents_stats_pp_fops;
+static const struct file_operations ll_rw_offset_stats_fops;
 
 static int ll_blksize_seq_show(struct seq_file *m, void *v)
 {
index 4685144..27fbbef 100644 (file)
@@ -90,7 +90,7 @@ static inline struct range_lock *next_lock(struct range_lock *lock)
  *                             overlapping range node
  * \retval INTERVAL_ITER_STOP  indicate to stop the search
  */
-enum interval_iter range_unlock_cb(struct interval_node *node, void *arg)
+static enum interval_iter range_unlock_cb(struct interval_node *node, void *arg)
 {
        struct range_lock *lock = arg;
        struct range_lock *overlap = node2rangelock(node);
@@ -171,7 +171,7 @@ void range_unlock(struct range_lock_tree *tree, struct range_lock *lock)
  *                             overlapping range node
  * \retval INTERVAL_ITER_STOP  indicate to stop the search
  */
-enum interval_iter range_lock_cb(struct interval_node *node, void *arg)
+static enum interval_iter range_lock_cb(struct interval_node *node, void *arg)
 {
        struct range_lock *lock = (struct range_lock *)arg;
        struct range_lock *overlap = node2rangelock(node);