staging: lustre: Fix sparse warnings for static declarations
PATCH v2 1/1 staging: lustre: Fix sparse warnings for static declarations
All the changes are against variables/functions that are only accessed from within the same file. If the scope needs to change later on, the static keyword can be removed.
Build tested.
Signed-off-by Adrian Nicoara <[email protected]>
--- drivers/staging/lustre/lnet/lnet/module.c | 2 +- drivers/staging/lustre/lnet/lnet/router.c | 18 ++--- drivers/staging/lustre/lustre/fld/fld_cache.c | 6 +- drivers/staging/lustre/lustre/fld/fld_request.c | 2 +- drivers/staging/lustre/lustre/fld/lproc_fld.c | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 3 +- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 16 ++-- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 14 ++-- .../lustre/lustre/libcfs/linux/linux-curproc.c | 4 +- .../lustre/lustre/libcfs/linux/linux-proc.c | 22 +++--- .../lustre/lustre/libcfs/linux/linux-tcpip.c | 2 +- drivers/staging/lustre/lustre/libcfs/module.c | 4 +- drivers/staging/lustre/lustre/libcfs/nidstrings.c | 20 ++--- drivers/staging/lustre/lustre/libcfs/tracefile.c | 2 +- drivers/staging/lustre/lustre/llite/dir.c | 4 +- drivers/staging/lustre/lustre/llite/file.c | 3 +- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 85 ++++++++++----------- drivers/staging/lustre/lustre/lmv/lproc_lmv.c | 4 +- drivers/staging/lustre/lustre/lov/lov_dev.c | 2 +- drivers/staging/lustre/lustre/lov/lov_ea.c | 8 +- drivers/staging/lustre/lustre/lov/lov_obd.c | 24 +++--- drivers/staging/lustre/lustre/lov/lov_object.c | 2 +- drivers/staging/lustre/lustre/lov/lov_pool.c | 2 +- drivers/staging/lustre/lustre/lov/lproc_lov.c | 4 +- drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 88 +++++++++++----------- drivers/staging/lustre/lustre/mgc/mgc_request.c | 15 ++-- drivers/staging/lustre/lustre/obdclass/cl_object.c | 3 +- drivers/staging/lustre/lustre/obdclass/class_obd.c | 6 +- drivers/staging/lustre/lustre/obdclass/genops.c | 14 ++-- .../lustre/lustre/obdclass/linux/linux-module.c | 12 +-- drivers/staging/lustre/lustre/obdclass/llog_cat.c | 7 +- .../lustre/lustre/obdclass/lprocfs_status.c | 10 +-- drivers/staging/lustre/lustre/obdclass/lu_object.c | 10 +-- .../staging/lustre/lustre/obdclass/obd_config.c | 8 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 14 ++-- .../staging/lustre/lustre/obdecho/echo_client.c | 4 +- drivers/staging/lustre/lustre/osc/osc_cache.c | 10 +-- drivers/staging/lustre/lustre/osc/osc_object.c | 4 +- drivers/staging/lustre/lustre/osc/osc_page.c | 4 +- drivers/staging/lustre/lustre/osc/osc_request.c | 4 +- drivers/staging/lustre/lustre/ptlrpc/client.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/events.c | 4 +- drivers/staging/lustre/lustre/ptlrpc/layout.c | 2 +- .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 15 ++-- .../staging/lustre/lustre/ptlrpc/pack_generic.c | 8 +- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 13 ++-- .../staging/lustre/lustre/ptlrpc/ptlrpc_module.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 8 +- 49 files changed, 269 insertions(+), 255 deletions(-)
drivers/staging/lustre/lnet/lnet/module.c +1 -1
@@ -108,7 +108,7 @@ lnet_ioctl(unsigned int cmd, struct libcfs_ioctl_data *data) } } -DECLARE_IOCTL_HANDLER (lnet_ioctl_handler, lnet_ioctl); +static DECLARE_IOCTL_HANDLER(lnet_ioctl_handler, lnet_ioctl);static int __init init_lnet (void )
drivers/staging/lustre/lnet/lnet/router.c +9 -9
@@ -752,7 +752,7 @@ lnet_router_checker_event(lnet_event_t *event)lnet_net_unlock (lp->lp_cpt); } -void +static void lnet_wait_known_routerstate (void ) {lnet_peer_t *rtr;
@@ -784,7 +784,7 @@ lnet_wait_known_routerstate(void) } } -void +static void lnet_update_ni_status_locked (void ) {lnet_ni_t *ni;
@@ -824,7 +824,7 @@ lnet_update_ni_status_locked(void) } } -void +static void lnet_destroy_rc_data (lnet_rc_data_t *rcd) {LASSERT (list_empty (&rcd->rcd_list));
@@ -845,7 +845,7 @@ lnet_destroy_rc_data(lnet_rc_data_t *rcd)LIBCFS_FREE (rcd,sizeof (*rcd)); } -lnet_rc_data_t * +static lnet_rc_data_t *lnet_create_rc_data_locked (lnet_peer_t *gateway) {lnet_rc_data_t *rcd =NULL ;
@@ -1224,7 +1224,7 @@ rescan:return 0 ; } -void +static void lnet_destroy_rtrbuf (lnet_rtrbuf_t *rb,int npages) { int sz = offsetof(lnet_rtrbuf_t, rb_kiov[npages]);
@@ -1235,7 +1235,7 @@ lnet_destroy_rtrbuf(lnet_rtrbuf_t *rb, int npages)LIBCFS_FREE (rb, sz); } -lnet_rtrbuf_t * +static lnet_rtrbuf_t *lnet_new_rtrbuf (lnet_rtrbufpool_t *rbp,int cpt) {int npages = rbp->rbp_npages;
@@ -1270,7 +1270,7 @@ lnet_new_rtrbuf(lnet_rtrbufpool_t *rbp, int cpt)return rb; } -void +static void lnet_rtrpool_free_bufs (lnet_rtrbufpool_t *rbp) {int npages = rbp->rbp_npages;
@@ -1299,7 +1299,7 @@ lnet_rtrpool_free_bufs(lnet_rtrbufpool_t *rbp) rbp->rbp_nbuffers = rbp->rbp_credits =0 ; } -int +static int lnet_rtrpool_alloc_bufs (lnet_rtrbufpool_t *rbp,int nbufs,int cpt) {lnet_rtrbuf_t *rb;
@@ -1333,7 +1333,7 @@ lnet_rtrpool_alloc_bufs(lnet_rtrbufpool_t *rbp, int nbufs, int cpt)return 0 ; } -void +static void lnet_rtrpool_init (lnet_rtrbufpool_t *rbp,int npages) {INIT_LIST_HEAD (&rbp->rbp_msgs);
drivers/staging/lustre/lustre/fld/fld_cache.c +3 -3
@@ -257,9 +257,9 @@ void fld_cache_flush(struct fld_cache *cache)* entry accordingly. */ -void fld_cache_punch_hole (struct fld_cache *cache, -struct fld_cache_entry *f_curr, -struct fld_cache_entry *f_new) +static void fld_cache_punch_hole (struct fld_cache *cache, +struct fld_cache_entry *f_curr, +struct fld_cache_entry *f_new) {const struct lu_seq_range *range = &f_new->fce_range;const u64 new_start = range->lsr_start;
drivers/staging/lustre/lustre/fld/fld_request.c +1 -1
@@ -269,7 +269,7 @@ int fld_client_del_target(struct lu_client_fld *fld, __u64 idx) }EXPORT_SYMBOL (fld_client_del_target); -struct proc_dir_entry *fld_type_proc_dir =NULL ; +static struct proc_dir_entry *fld_type_proc_dir;#if defined (CONFIG_PROC_FS )static int fld_client_proc_init (struct lu_client_fld *fld)
drivers/staging/lustre/lustre/fld/lproc_fld.c +1 -1
@@ -146,7 +146,7 @@ static int fld_proc_cache_flush_release(struct inode *inode, struct file *file)return 0 ; } -struct file_operations fld_proc_cache_flush_fops = { +static struct file_operations fld_proc_cache_flush_fops = { .owner =THIS_MODULE , .open = fld_proc_cache_flush_open, .write = fld_proc_cache_flush_write,
drivers/staging/lustre/lustre/ldlm/ldlm_lib.c +2 -1
@@ -656,7 +656,8 @@ int target_pack_pool_reply(struct ptlrpc_request *req) }EXPORT_SYMBOL (target_pack_pool_reply); -int target_send_reply_msg (struct ptlrpc_request *req,int rc,int fail_id) +static int target_send_reply_msg (struct ptlrpc_request *req,int rc, +int fail_id) {if (OBD_FAIL_CHECK_ORSET (fail_id & ~OBD_FAIL_ONCE ,OBD_FAIL_ONCE )) {DEBUG_REQ (D_ERROR , req,"dropping reply" );
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +9 -7
@@ -327,7 +327,7 @@ void ldlm_lock_touch_in_lru(struct ldlm_lock *lock)* ldlm_lock_destroy, you can never drop your final references on this lock. * Because it's not in the hash table anymore. -phil */ -int ldlm_lock_destroy_internal (struct ldlm_lock *lock) +static int ldlm_lock_destroy_internal (struct ldlm_lock *lock) {if (lock->l_readers || lock->l_writers) {LDLM_ERROR (lock,"lock still has references" );
@@ -416,7 +416,7 @@ static void lock_handle_free(void *lock, int size)OBD_SLAB_FREE (lock, ldlm_lock_slab, size); } -struct portals_handle_ops lock_handle_ops = { +static struct portals_handle_ops lock_handle_ops = { .hop_addref = lock_handle_addref, .hop_free = lock_handle_free, };
@@ -627,8 +627,8 @@ EXPORT_SYMBOL(ldlm_lock2desc);* * Only add if we have not sent a blocking AST to the lock yet. */ -void ldlm_add_bl_work_item (struct ldlm_lock *lock,struct ldlm_lock *new, -struct list_head *work_list) +static void ldlm_add_bl_work_item (struct ldlm_lock *lock,struct ldlm_lock *new, +struct list_head *work_list) {if ((lock->l_flags &LDLM_FL_AST_SENT ) ==0 ) {LDLM_DEBUG (lock,"lock incompatible; sending blocking AST." );
@@ -648,7 +648,8 @@ void ldlm_add_bl_work_item(struct ldlm_lock *lock, struct ldlm_lock *new,/** * Add a lock to list of just granted locks to send completion AST to. */ -void ldlm_add_cp_work_item (struct ldlm_lock *lock,struct list_head *work_list) +static void ldlm_add_cp_work_item (struct ldlm_lock *lock, +struct list_head *work_list) {if ((lock->l_flags &LDLM_FL_CP_REQD ) ==0 ) { lock->l_flags |=LDLM_FL_CP_REQD ;
@@ -2016,8 +2017,9 @@ struct export_cl_data {* Iterator function for ldlm_cancel_locks_for_export. * Cancels passed locks. */ -int ldlm_cancel_locks_for_export_cb (struct cfs_hash *hs,struct cfs_hash_bd *bd, -struct hlist_node *hnode,void *data) +static int ldlm_cancel_locks_for_export_cb (struct cfs_hash *hs, +struct cfs_hash_bd *bd, +struct hlist_node *hnode,void *data) {struct export_cl_data *ecl = (struct export_cl_data *)data;
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +7 -7
@@ -69,7 +69,7 @@ extern unsigned int ldlm_cancel_unused_locks_before_replay;/* during debug dump certain amount of granted locks for one resource to avoid * DDOS. */ -unsigned int ldlm_dump_granted_max =256 ; +static unsigned int ldlm_dump_granted_max =256 ;#if defined (CONFIG_PROC_FS ) static ssize_t lprocfs_wr_dump_ns(struct file *file, const char *buffer,
@@ -306,7 +306,7 @@ static ssize_t lprocfs_elc_seq_write(struct file *file, const char *buffer, }LPROC_SEQ_FOPS (lprocfs_elc); -void ldlm_namespace_proc_unregister (struct ldlm_namespace *ns) +static void ldlm_namespace_proc_unregister (struct ldlm_namespace *ns) {if (ns->ns_proc_dir_entry ==NULL ) CERROR("dlm namespace %s has no procfs dir?\n",
@@ -326,7 +326,7 @@ void ldlm_namespace_proc_unregister(struct ldlm_namespace *ns)lprocfs_add_vars (ns_pde, lock_vars,NULL ); \ }while (0 ) -int ldlm_namespace_proc_register(struct ldlm_namespace *ns) +static int ldlm_namespace_proc_register(struct ldlm_namespace *ns) {struct lprocfs_vars lock_vars[2 ];char lock_name[MAX_STRING_SIZE +1 ];
@@ -479,7 +479,7 @@ static void ldlm_res_hop_put(struct cfs_hash *hs, struct hlist_node *hnode)ldlm_resource_putref (res); } -cfs_hash_ops_t ldlm_ns_hash_ops = { +static cfs_hash_ops_t ldlm_ns_hash_ops = { .hs_hash = ldlm_res_hop_hash, .hs_key = ldlm_res_hop_key, .hs_keycmp = ldlm_res_hop_keycmp,
@@ -490,7 +490,7 @@ cfs_hash_ops_t ldlm_ns_hash_ops = { .hs_put = ldlm_res_hop_put }; -cfs_hash_ops_t ldlm_ns_fid_hash_ops = { +static cfs_hash_ops_t ldlm_ns_fid_hash_ops = { .hs_hash = ldlm_res_hop_fid_hash, .hs_key = ldlm_res_hop_key, .hs_keycmp = ldlm_res_hop_keycmp,
@@ -511,7 +511,7 @@ struct ldlm_ns_hash_def {cfs_hash_ops_t *nsd_hops; }; -struct ldlm_ns_hash_def ldlm_ns_hash_defs[] = { +static struct ldlm_ns_hash_def ldlm_ns_hash_defs[] = { { .nsd_type =LDLM_NS_TYPE_MDC , .nsd_bkt_bits =11 ,
@@ -941,7 +941,7 @@ void ldlm_namespace_get(struct ldlm_namespace *ns)EXPORT_SYMBOL (ldlm_namespace_get);/* This is only for callers that care about refcount */ -int ldlm_namespace_get_return (struct ldlm_namespace *ns) +static int ldlm_namespace_get_return (struct ldlm_namespace *ns) {return atomic_inc_return (&ns->ns_bref); }
drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c +2 -2
@@ -82,13 +82,13 @@ int cfs_cap_raised(cfs_cap_t cap)return cap_raised (current_cap (), cap); } -void cfs_kernel_cap_pack (kernel_cap_t kcap,cfs_cap_t *cap) +static void cfs_kernel_cap_pack (kernel_cap_t kcap,cfs_cap_t *cap) {/* XXX lost high byte */ *cap = kcap.cap[0 ]; } -void cfs_kernel_cap_unpack (kernel_cap_t *kcap,cfs_cap_t cap) +static void cfs_kernel_cap_unpack (kernel_cap_t *kcap,cfs_cap_t cap) { kcap->cap[0 ] = cap; }
drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c +12 -10
@@ -232,8 +232,9 @@ static int proc_debug_mb(struct ctl_table *table, int write, __proc_debug_mb); } -int proc_console_max_delay_cs (struct ctl_table *table,int write, -void __user *buffer,size_t *lenp,loff_t *ppos) +static int proc_console_max_delay_cs (struct ctl_table *table,int write, +void __user *buffer,size_t *lenp, +loff_t *ppos) {int rc, max_delay_cs;struct ctl_table dummy = *table;
@@ -264,8 +265,9 @@ int proc_console_max_delay_cs(struct ctl_table *table, int write,return rc; } -int proc_console_min_delay_cs (struct ctl_table *table,int write, -void __user *buffer,size_t *lenp,loff_t *ppos) +static int proc_console_min_delay_cs (struct ctl_table *table,int write, +void __user *buffer,size_t *lenp, +loff_t *ppos) {int rc, min_delay_cs;struct ctl_table dummy = *table;
@@ -296,8 +298,8 @@ int proc_console_min_delay_cs(struct ctl_table *table, int write,return rc; } -int proc_console_backoff (struct ctl_table *table,int write, -void __user *buffer,size_t *lenp,loff_t *ppos) +static int proc_console_backoff (struct ctl_table *table,int write, +void __user *buffer,size_t *lenp,loff_t *ppos) {int rc, backoff;struct ctl_table dummy = *table;
@@ -324,16 +326,16 @@ int proc_console_backoff(struct ctl_table *table, int write,return rc; } -int libcfs_force_lbug (struct ctl_table *table,int write,void __user *buffer, -size_t *lenp,loff_t *ppos) +static int libcfs_force_lbug (struct ctl_table *table,int write, +void __user *buffer,size_t *lenp,loff_t *ppos) {if (write)LBUG ();return 0 ; } -int proc_fail_loc (struct ctl_table *table,int write,void __user *buffer, -size_t *lenp,loff_t *ppos) +static int proc_fail_loc (struct ctl_table *table,int write, +void __user *buffer,size_t *lenp,loff_t *ppos) {int rc;long old_fail_loc = cfs_fail_loc;
drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c +1 -1
@@ -43,7 +43,7 @@/* For sys_open & sys_close */ #include <linux/syscalls.h> -int +static int libcfs_sock_ioctl (int cmd,unsigned long arg) {mm_segment_t oldmm =get_fs ();
drivers/staging/lustre/lustre/libcfs/module.c +2 -2
@@ -42,7 +42,7 @@#include "../../include/linux/lnet/lnet.h" #include "tracefile.h" -void +static void kportal_memhog_free (struct libcfs_device_userstate *ldu) {struct page **level0p = &ldu->ldu_memhog_root_page;
@@ -86,7 +86,7 @@ kportal_memhog_free (struct libcfs_device_userstate *ldu)LASSERT (ldu->ldu_memhog_pages ==0 ); } -int +static int kportal_memhog_alloc (struct libcfs_device_userstate *ldu,int npages,gfp_t flags) {
drivers/staging/lustre/lustre/libcfs/nidstrings.c +10 -10
@@ -197,16 +197,16 @@ static struct netstrfns libcfs_netstrfns[] = { {/* .nf_type */ -1}, }; -const int libcfs_nnetstrfns =ARRAY_SIZE (libcfs_netstrfns); +static const int libcfs_nnetstrfns =ARRAY_SIZE (libcfs_netstrfns); -int +static int libcfs_lo_str2addr (const char *str,int nob,__u32 *addr) { *addr =0 ;return 1 ; } -void +static void libcfs_ip_addr2str (__u32 addr,char *str) {#if 0 /* never lookup */
@@ -223,7 +223,7 @@ libcfs_ip_addr2str(__u32 addr, char *str)* fine, if it doesn't, then the scan ended at the end of the string, which is * fine too :) */ -int +static int libcfs_ip_str2addr (const char *str,int nob,__u32 *addr) {unsigned int a;
@@ -244,19 +244,19 @@ libcfs_ip_str2addr(const char *str, int nob, __u32 *addr)return 0 ; } -void +static void libcfs_decnum_addr2str (__u32 addr,char *str) {snprintf (str,LNET_NIDSTR_SIZE ,"%u" , addr); } -void +static void libcfs_hexnum_addr2str (__u32 addr,char *str) {snprintf (str,LNET_NIDSTR_SIZE ,"0x%x" , addr); } -int +static int libcfs_num_str2addr (const char *str,int nob,__u32 *addr) {int n;
@@ -276,7 +276,7 @@ libcfs_num_str2addr(const char *str, int nob, __u32 *addr)return 0 ; } -struct netstrfns * +static struct netstrfns *libcfs_lnd2netstrfns (int lnd) {int i;
@@ -289,7 +289,7 @@ libcfs_lnd2netstrfns(int lnd)return NULL ; } -struct netstrfns * +static struct netstrfns *libcfs_namenum2netstrfns (const char *name) {struct netstrfns *nf;
@@ -304,7 +304,7 @@ libcfs_namenum2netstrfns(const char *name)return NULL ; } -struct netstrfns * +static struct netstrfns *libcfs_name2netstrfns (const char *name) {int i;
drivers/staging/lustre/lustre/libcfs/tracefile.c +1 -1
@@ -55,7 +55,7 @@ static struct tracefiled_ctl trace_tctl;struct mutex cfs_trace_thread_mutex;static int thread_running =0 ; -atomic_t cfs_tage_allocated =ATOMIC_INIT (0 ); +static atomic_t cfs_tage_allocated =ATOMIC_INIT (0 );static void put_pages_on_tcd_daemon_list (struct page_collection *pc,struct cfs_trace_cpu_data *tcd);
drivers/staging/lustre/lustre/llite/dir.c +2 -2
@@ -652,8 +652,8 @@ static int ll_send_mgc_param(struct obd_export *mgc, char *string)return rc; } -int ll_dir_setdirstripe (struct inode *dir,struct lmv_user_md *lump, -char *filename) +static int ll_dir_setdirstripe (struct inode *dir,struct lmv_user_md *lump, +char *filename) {struct ptlrpc_request *request =NULL ;struct md_op_data *op_data;
drivers/staging/lustre/lustre/llite/file.c +2 -1
@@ -1588,7 +1588,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);
drivers/staging/lustre/lustre/lmv/lmv_obd.c +43 -42
205 lines not on this page · raw message
drivers/staging/lustre/lustre/lmv/lproc_lmv.c +2 -2
@@ -175,7 +175,7 @@ static int lmv_tgt_seq_show(struct seq_file *p, void *v) tgt->ltd_uuid.uuid, tgt->ltd_active ? "" : "IN"); } -struct seq_operations lmv_tgt_sops = { +static struct seq_operations lmv_tgt_sops = { .start = lmv_tgt_seq_start, .stop = lmv_tgt_seq_stop, .next = lmv_tgt_seq_next,
@@ -199,7 +199,7 @@ static int lmv_target_seq_open(struct inode *inode, struct file *file)LPROC_SEQ_FOPS_RO_TYPE (lmv, uuid); -struct lprocfs_vars lprocfs_lmv_obd_vars[] = { +static struct lprocfs_vars lprocfs_lmv_obd_vars[] = { {"numobd" , &lmv_numobd_fops,NULL ,0 }, {"placement" , &lmv_placement_fops,NULL ,0 }, {"activeobd" , &lmv_activeobd_fops,NULL ,0 },
drivers/staging/lustre/lustre/lov/lov_dev.c +1 -1
@@ -60,7 +60,7 @@ struct kmem_cache *lovsub_req_kmem;struct kmem_cache *lov_lock_link_kmem;/** Lock class of lov_device::ld_mutex. */ -struct lock_class_key cl_lov_device_mutex_class; +static struct lock_class_key cl_lov_device_mutex_class;struct lu_kmem_descr lov_caches[] = { {
drivers/staging/lustre/lustre/lov/lov_ea.c +4 -4
@@ -209,8 +209,8 @@ static int lsm_lmm_verify_v1(struct lov_mds_md_v1 *lmm, int lmm_bytes,return lsm_lmm_verify_common (lmm, lmm_bytes, *stripe_count); } -int lsm_unpackmd_v1 (struct lov_obd *lov,struct lov_stripe_md *lsm, -struct lov_mds_md_v1 *lmm) +static int lsm_unpackmd_v1 (struct lov_obd *lov,struct lov_stripe_md *lsm, +struct lov_mds_md_v1 *lmm) {struct lov_oinfo *loi;int i;
@@ -287,8 +287,8 @@ static int lsm_lmm_verify_v3(struct lov_mds_md *lmmv1, int lmm_bytes, *stripe_count); } -int lsm_unpackmd_v3 (struct lov_obd *lov,struct lov_stripe_md *lsm, -struct lov_mds_md *lmmv1) +static int lsm_unpackmd_v3 (struct lov_obd *lov,struct lov_stripe_md *lsm, +struct lov_mds_md *lmmv1) {struct lov_mds_md_v3 *lmm;struct lov_oinfo *loi;
drivers/staging/lustre/lustre/lov/lov_obd.c +12 -12
@@ -1605,9 +1605,9 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,* \param fm_end logical end of mapping * \param start_stripe starting stripe will be returned in this */ -u64 fiemap_calc_fm_end_offset (struct ll_user_fiemap *fiemap, -struct lov_stripe_md *lsm,u64 fm_start, -u64 fm_end,int *start_stripe) +static u64 fiemap_calc_fm_end_offset (struct ll_user_fiemap *fiemap, +struct lov_stripe_md *lsm,u64 fm_start, +u64 fm_end,int *start_stripe) {u64 local_end = fiemap->fm_extents[0 ].fe_logical;u64 lun_start, lun_end;
@@ -1662,9 +1662,9 @@ u64 fiemap_calc_fm_end_offset(struct ll_user_fiemap *fiemap,* * \retval last_stripe return the last stripe of the mapping */ -int fiemap_calc_last_stripe (struct lov_stripe_md *lsm,u64 fm_start, -u64 fm_end,int start_stripe, -int *stripe_count) +static int fiemap_calc_last_stripe (struct lov_stripe_md *lsm,u64 fm_start, +u64 fm_end,int start_stripe, +int *stripe_count) {int last_stripe;u64 obd_start, obd_end;
@@ -1698,10 +1698,10 @@ int fiemap_calc_last_stripe(struct lov_stripe_md *lsm, u64 fm_start,* \param ext_count number of extents to be copied * \param current_extent where to start copying in main extent array */ -void fiemap_prepare_and_copy_exts (struct ll_user_fiemap *fiemap, -struct ll_fiemap_extent *lcl_fm_ext, -int ost_index,unsigned int ext_count, -int current_extent) +static void fiemap_prepare_and_copy_exts (struct ll_user_fiemap *fiemap, +struct ll_fiemap_extent *lcl_fm_ext, +int ost_index,unsigned int ext_count, +int current_extent) {char *to;int ext;
@@ -2294,7 +2294,7 @@ out:return rc; } -struct obd_ops lov_obd_ops = { +static struct obd_ops lov_obd_ops = { .o_owner =THIS_MODULE , .o_setup = lov_setup, .o_precleanup = lov_precleanup,
@@ -2328,7 +2328,7 @@ struct obd_ops lov_obd_ops = {struct kmem_cache *lov_oinfo_slab; -int __init lov_init (void ) +static int __init lov_init (void ) {struct lprocfs_static_vars lvars = {NULL };int rc;
drivers/staging/lustre/lustre/lov/lov_object.c +1 -1
@@ -563,7 +563,7 @@ static const struct lov_layout_operations lov_dispatch[] = {/** * Return lov_layout_type associated with a given lsm */ -enum lov_layout_type lov_type (struct lov_stripe_md *lsm) +static enum lov_layout_type lov_type (struct lov_stripe_md *lsm) {if (lsm ==NULL )return LLT_EMPTY ;
drivers/staging/lustre/lustre/lov/lov_pool.c +1 -1
@@ -71,7 +71,7 @@ void lov_pool_putref(struct pool_desc *pool) } } -void lov_pool_putref_locked (struct pool_desc *pool) +static void lov_pool_putref_locked (struct pool_desc *pool) {CDEBUG (D_INFO ,"pool %p\n" , pool);LASSERT (atomic_read (&pool->pool_refcount) >1 );
drivers/staging/lustre/lustre/lov/lproc_lov.c +2 -2
@@ -229,7 +229,7 @@ static int lov_tgt_seq_show(struct seq_file *p, void *v) tgt->ltd_active ? "" : "IN"); } -struct seq_operations lov_tgt_sops = { +static struct seq_operations lov_tgt_sops = { .start = lov_tgt_seq_start, .stop = lov_tgt_seq_stop, .next = lov_tgt_seq_next,
@@ -258,7 +258,7 @@ LPROC_SEQ_FOPS_RO_TYPE(lov, kbytestotal);LPROC_SEQ_FOPS_RO_TYPE (lov, kbytesfree);LPROC_SEQ_FOPS_RO_TYPE (lov, kbytesavail); -struct lprocfs_vars lprocfs_lov_obd_vars[] = { +static struct lprocfs_vars lprocfs_lov_obd_vars[] = { {"uuid" , &lov_uuid_fops,NULL ,0 }, {"stripesize" , &lov_stripesize_fops,NULL }, {"stripeoffset" , &lov_stripeoffset_fops,NULL },
drivers/staging/lustre/lustre/mdc/lproc_mdc.c +1 -1
@@ -143,7 +143,7 @@ static ssize_t mdc_kuc_write(struct file *file, const char *buffer,return count; } -struct file_operations mdc_kuc_fops = { +static struct file_operations mdc_kuc_fops = { .open = mdc_kuc_open, .write = mdc_kuc_write, .release = single_release,
drivers/staging/lustre/lustre/mdc/mdc_request.c +45 -43
202 lines not on this page · raw message
drivers/staging/lustre/lustre/mgc/mgc_request.c +8 -7
@@ -95,7 +95,8 @@ int mgc_fsname2resid(char *fsname, struct ldlm_res_id *res_id, int type) }EXPORT_SYMBOL (mgc_fsname2resid); -int mgc_logname2resid (char *logname,struct ldlm_res_id *res_id,int type) +static int mgc_logname2resid (char *logname,struct ldlm_res_id *res_id, +int type) {char *name_end;int len;
@@ -377,7 +378,7 @@ out_err:return rc; } -DEFINE_MUTEX (llog_process_lock); +static DEFINE_MUTEX (llog_process_lock);/** Stop watching for updates on this log. */
@@ -952,9 +953,9 @@ static int mgc_target_register(struct obd_export *exp,return rc; } -int mgc_set_info_async (const struct lu_env *env,struct obd_export *exp, -u32 keylen,void *key,u32 vallen, -void *val,struct ptlrpc_request_set *set) +static int mgc_set_info_async (const struct lu_env *env,struct obd_export *exp, +u32 keylen,void *key,u32 vallen, +void *val,struct ptlrpc_request_set *set) {int rc = -EINVAL ;
@@ -1712,7 +1713,7 @@ out:return rc; } -struct obd_ops mgc_obd_ops = { +static struct obd_ops mgc_obd_ops = { .o_owner =THIS_MODULE , .o_setup = mgc_setup, .o_precleanup = mgc_precleanup,
@@ -1729,7 +1730,7 @@ struct obd_ops mgc_obd_ops = { .o_process_config = mgc_process_config, }; -int __init mgc_init (void ) +static int __init mgc_init (void ) {return class_register_type (&mgc_obd_ops,NULL ,NULL ,LUSTRE_MGC_NAME ,NULL );
drivers/staging/lustre/lustre/obdclass/cl_object.c +2 -1
@@ -386,7 +386,8 @@ void cache_stats_init(struct cache_stats *cs, const char *name)atomic_set (&cs->cs_stats[i],0 ); } -int cache_stats_print (const struct cache_stats *cs,struct seq_file *m,int h) +static int cache_stats_print (const struct cache_stats *cs,struct seq_file *m, +int h) {int i;/*
drivers/staging/lustre/lustre/obdclass/class_obd.c +3 -3
@@ -61,7 +61,7 @@ __u64 obd_alloc;EXPORT_SYMBOL (obd_alloc);__u64 obd_pages;EXPORT_SYMBOL (obd_pages); -DEFINE_SPINLOCK (obd_updatemax_lock); +static DEFINE_SPINLOCK (obd_updatemax_lock);/* The following are visible and mutable through /proc/sys/lustre/. */ unsigned int obd_alloc_fail_rate =0 ;
@@ -170,7 +170,7 @@ static inline void obd_conn2data(struct obd_ioctl_data *data, data->ioc_cookie = conn->cookie; } -int class_resolve_dev_name (__u32 len,const char *name) +static int class_resolve_dev_name (__u32 len,const char *name) {int rc;int dev;
@@ -442,7 +442,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)extern struct miscdevice obd_psdev;#define OBD_INIT_CHECK -int obd_init_checks (void ) +static int obd_init_checks (void ) {__u64 u64val, div64val;char buf[64 ];
drivers/staging/lustre/lustre/obdclass/genops.c +7 -7
@@ -46,14 +46,14 @@extern struct list_head obd_types;spinlock_t obd_types_lock; -struct kmem_cache *obd_device_cachep; +static struct kmem_cache *obd_device_cachep;struct kmem_cache *obdo_cachep;EXPORT_SYMBOL (obdo_cachep); -struct kmem_cache *import_cachep; +static struct kmem_cache *import_cachep; -struct list_head obd_zombie_imports; -struct list_head obd_zombie_exports; -spinlock_t obd_zombie_impexp_lock; +static struct list_head obd_zombie_imports; +static struct list_head obd_zombie_exports; +static spinlock_t obd_zombie_impexp_lock;static void obd_zombie_impexp_notify (void );static void obd_zombie_export_add (struct obd_export *exp);static void obd_zombie_import_add (struct obd_import *imp);
@@ -930,7 +930,7 @@ void class_unlink_export(struct obd_export *exp)EXPORT_SYMBOL (class_unlink_export);/* Import management functions */ -void class_import_destroy (struct obd_import *imp) +static void class_import_destroy (struct obd_import *imp) {CDEBUG (D_IOCTL ,"destroying import %p for %s\n" , imp, imp->imp_obd->obd_name);
@@ -1128,7 +1128,7 @@ int class_connect(struct lustre_handle *conn, struct obd_device *obd,EXPORT_SYMBOL (class_connect);/* if export is involved in recovery then clean up related things */ -void class_export_recovery_cleanup (struct obd_export *exp) +static void class_export_recovery_cleanup (struct obd_export *exp) {struct obd_device *obd = exp->exp_obd;
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +6 -6
@@ -73,7 +73,7 @@#include "../../include/lustre_ver.h" #include "../../include/lustre/lustre_build_version.h" -int proc_version; +static int proc_version;/* buffer MUST be at least the size of obd_ioctl_hdr */ int obd_ioctl_getdata (char **buf,int *len,void *arg)
@@ -213,7 +213,7 @@ struct miscdevice obd_psdev = {#if defined (CONFIG_PROC_FS ) -int obd_proc_version_seq_show (struct seq_file *m,void *v) +static int obd_proc_version_seq_show (struct seq_file *m,void *v) { return seq_printf(m, "lustre: %s\nkernel: %s\nbuild: %s\n", LUSTRE_VERSION_STRING, "patchless_client",
@@ -221,7 +221,7 @@ int obd_proc_version_seq_show(struct seq_file *m, void *v) }LPROC_SEQ_FOPS_RO (obd_proc_version); -int obd_proc_pinger_seq_show (struct seq_file *m,void *v) +static int obd_proc_pinger_seq_show (struct seq_file *m,void *v) {return seq_printf (m,"%s\n" ,"on" ); }
@@ -321,7 +321,7 @@ LPROC_SEQ_FOPS(obd_proc_jobid_name);struct proc_dir_entry *proc_lustre_root =NULL ;EXPORT_SYMBOL (proc_lustre_root); -struct lprocfs_vars lprocfs_base[] = { +static struct lprocfs_vars lprocfs_base[] = { {"version" , &obd_proc_version_fops }, {"pinger" , &obd_proc_pinger_fops }, {"health_check" , &obd_proc_health_fops },
@@ -379,7 +379,7 @@ static int obd_device_list_seq_show(struct seq_file *p, void *v) atomic_read(&obd->obd_refcount)); } -struct seq_operations obd_device_list_sops = { +static struct seq_operations obd_device_list_sops = { .start = obd_device_list_seq_start, .stop = obd_device_list_seq_stop, .next = obd_device_list_seq_next,
@@ -400,7 +400,7 @@ static int obd_device_list_open(struct inode *inode, struct file *file)return 0 ; } -struct file_operations obd_device_list_fops = { +static struct file_operations obd_device_list_fops = { .owner =THIS_MODULE , .open = obd_device_list_open, .read = seq_read,
drivers/staging/lustre/lustre/obdclass/llog_cat.c +4 -3
@@ -527,8 +527,9 @@ int llog_cat_cancel_records(const struct lu_env *env, }EXPORT_SYMBOL (llog_cat_cancel_records); -int llog_cat_process_cb (const struct lu_env *env,struct llog_handle *cat_llh, -struct llog_rec_hdr *rec,void *data) +static int llog_cat_process_cb (const struct lu_env *env, +struct llog_handle *cat_llh, +struct llog_rec_hdr *rec,void *data) {struct llog_process_data *d = data;struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
@@ -692,7 +693,7 @@ int llog_cat_reverse_process(const struct lu_env *env, }EXPORT_SYMBOL (llog_cat_reverse_process); -int llog_cat_set_first_idx (struct llog_handle *cathandle,int index) +static int llog_cat_set_first_idx (struct llog_handle *cathandle,int index) {struct llog_log_hdr *llh = cathandle->lgh_hdr;int i, bitmap_size, idx;
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +5 -5
@@ -1256,7 +1256,7 @@ static int lprocfs_stats_seq_open(struct inode *inode, struct file *file)return 0 ; } -struct file_operations lprocfs_stats_seq_fops = { +static struct file_operations lprocfs_stats_seq_fops = { .owner =THIS_MODULE , .open = lprocfs_stats_seq_open, .read = seq_read,
@@ -1538,8 +1538,8 @@ void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats) }EXPORT_SYMBOL (lprocfs_init_ldlm_stats); -int lprocfs_exp_print_uuid (struct cfs_hash *hs,struct cfs_hash_bd *bd, -struct hlist_node *hnode,void *data) +static int lprocfs_exp_print_uuid (struct cfs_hash *hs,struct cfs_hash_bd *bd, +struct hlist_node *hnode,void *data) {struct obd_export *exp =cfs_hash_object (hs, hnode);
@@ -1569,8 +1569,8 @@ struct exp_hash_cb_data {bool first; }; -int lprocfs_exp_print_hash (struct cfs_hash *hs,struct cfs_hash_bd *bd, -struct hlist_node *hnode,void *cb_data) +static int lprocfs_exp_print_hash (struct cfs_hash *hs,struct cfs_hash_bd *bd, +struct hlist_node *hnode,void *cb_data) {struct exp_hash_cb_data *data = (struct exp_hash_cb_data *)cb_data;
drivers/staging/lustre/lustre/obdclass/lu_object.c +5 -5
@@ -427,7 +427,7 @@ LU_KEY_INIT_FINI(lu_global, struct lu_cdebug_data);* Key, holding temporary buffer. This key is registered very early by * lu_global_init(). */ -struct lu_context_key lu_global_key = { +static struct lu_context_key lu_global_key = { .lct_tags =LCT_MD_THREAD |LCT_DT_THREAD |LCT_MG_THREAD |LCT_CL_THREAD |LCT_LOCAL , .lct_init = lu_global_key_init,
@@ -942,7 +942,7 @@ static void lu_obj_hop_put_locked(struct cfs_hash *hs, struct hlist_node *hnode)LBUG ();/* we should never called it */ } -cfs_hash_ops_t lu_site_hash_ops = { +static cfs_hash_ops_t lu_site_hash_ops = { .hs_hash = lu_obj_hop_hash, .hs_key = lu_obj_hop_key, .hs_keycmp = lu_obj_hop_keycmp,
@@ -1912,13 +1912,13 @@ static unsigned long lu_cache_shrink_scan(struct shrinker *sk,/** * Environment to be used in debugger, contains all tags. */ -struct lu_env lu_debugging_env; +static struct lu_env lu_debugging_env;/** * Debugging printer function using printk(). */ -int lu_printk_printer (const struct lu_env *env, -void *unused,const char *format, ...) +static int lu_printk_printer (const struct lu_env *env, +void *unused,const char *format, ...) {va_list args;
drivers/staging/lustre/lustre/obdclass/obd_config.c +4 -4
@@ -804,7 +804,7 @@ EXPORT_SYMBOL(class_add_conn);/** Remove a failover nid location. */ -int class_del_conn (struct obd_device *obd,struct lustre_cfg *lcfg) +static int class_del_conn (struct obd_device *obd,struct lustre_cfg *lcfg) {struct obd_import *imp;struct obd_uuid uuid;
@@ -833,7 +833,7 @@ int class_del_conn(struct obd_device *obd, struct lustre_cfg *lcfg)return rc; } -LIST_HEAD (lustre_profile_list); +static LIST_HEAD (lustre_profile_list);struct lustre_profile *class_get_profile (const char *prof) {
@@ -852,8 +852,8 @@ EXPORT_SYMBOL(class_get_profile);* This defines the mdc and osc names to use for a client. * This also is used to define the lov to be used by a mdt. */ -int class_add_profile (int proflen,char *prof,int osclen,char *osc, -int mdclen,char *mdc) +static int class_add_profile (int proflen,char *prof,int osclen,char *osc, +int mdclen,char *mdc) {struct lustre_profile *lprof;int err =0 ;
drivers/staging/lustre/lustre/obdclass/obd_mount.c +7 -7
@@ -200,7 +200,7 @@ int lustre_start_simple(char *obdname, char *type, char *uuid,return rc; } -DEFINE_MUTEX (mgc_start_lock); +static DEFINE_MUTEX (mgc_start_lock);/** Set up a mgc obd to process startup logs *
@@ -553,7 +553,7 @@ out:/***************** lustre superblock **************/ -struct lustre_sb_info *lustre_init_lsi (struct super_block *sb) +static struct lustre_sb_info *lustre_init_lsi (struct super_block *sb) {struct lustre_sb_info *lsi;
@@ -1195,7 +1195,7 @@ struct lustre_mount_data2 {* and this is where we start setting things up. * @param data Mount options (e.g. -o flock,abort_recov) */ -int lustre_fill_super (struct super_block *sb,void *data,int silent) +static int lustre_fill_super (struct super_block *sb,void *data,int silent) {struct lustre_mount_data *lmd;struct lustre_mount_data2 *lmd2 = data;
@@ -1286,8 +1286,8 @@ void lustre_register_kill_super_cb(void (*cfs)(struct super_block *sb))EXPORT_SYMBOL (lustre_register_kill_super_cb);/***************** FS registration ******************/ -struct dentry *lustre_mount (struct file_system_type *fs_type,int flags, -const char *devname,void *data) +static struct dentry *lustre_mount (struct file_system_type *fs_type,int flags, +const char *devname,void *data) {struct lustre_mount_data2 lmd2 = { .lmd2_data = data,
@@ -1297,7 +1297,7 @@ struct dentry *lustre_mount(struct file_system_type *fs_type, int flags,return mount_nodev (fs_type, flags, &lmd2, lustre_fill_super); } -void lustre_kill_super (struct super_block *sb) +static void lustre_kill_super (struct super_block *sb) {struct lustre_sb_info *lsi =s2lsi (sb);
@@ -1309,7 +1309,7 @@ void lustre_kill_super(struct super_block *sb)/** Register the "lustre" fs type */ -struct file_system_type lustre_fs_type = { +static struct file_system_type lustre_fs_type = { .owner =THIS_MODULE , .name ="lustre" , .mount = lustre_mount,
drivers/staging/lustre/lustre/obdecho/echo_client.c +2 -2
@@ -2131,7 +2131,7 @@ static struct obd_ops echo_client_obd_ops = { .o_disconnect = echo_client_disconnect }; -int echo_client_init (void ) +static int echo_client_init (void ) {struct lprocfs_static_vars lvars = {NULL };int rc;
@@ -2150,7 +2150,7 @@ int echo_client_init(void)return rc; } -void echo_client_exit (void ) +static void echo_client_exit (void ) {class_unregister_type (LUSTRE_ECHO_CLIENT_NAME );lu_kmem_fini (echo_caches);
drivers/staging/lustre/lustre/osc/osc_cache.c +5 -5
@@ -581,9 +581,9 @@ static inline int overlapped(struct osc_extent *ex1, struct osc_extent *ex2)* Find or create an extent which includes @index, core function to manage * extent tree. */ -struct osc_extent *osc_extent_find (const struct lu_env *env, -struct osc_object *obj,pgoff_t index, -int *grants) +static struct osc_extent *osc_extent_find (const struct lu_env *env, +struct osc_object *obj,pgoff_t index, +int *grants) {struct client_obd *cli =osc_cli (obj);
@@ -1374,8 +1374,8 @@ static void __osc_unreserve_grant(struct client_obd *cli, } } -void osc_unreserve_grant (struct client_obd *cli, -unsigned int reserved,unsigned int unused) +static void osc_unreserve_grant (struct client_obd *cli, +unsigned int reserved,unsigned int unused) {client_obd_list_lock (&cli->cl_loi_list_lock);__osc_unreserve_grant (cli, reserved, unused);
drivers/staging/lustre/lustre/osc/osc_object.c +2 -2
@@ -160,8 +160,8 @@ static int osc_attr_get(const struct lu_env *env, struct cl_object *obj,return 0 ; } -int osc_attr_set (const struct lu_env *env,struct cl_object *obj, -const struct cl_attr *attr,unsigned valid) +static int osc_attr_set (const struct lu_env *env,struct cl_object *obj, +const struct cl_attr *attr,unsigned valid) {struct lov_oinfo *oinfo =cl2osc (obj)->oo_oinfo;struct ost_lvb *lvb = &oinfo->loi_lvb;
drivers/staging/lustre/lustre/osc/osc_page.c +2 -2
@@ -439,8 +439,8 @@ static void osc_page_delete(const struct lu_env *env,osc_lru_del (osc_cli (obj), opg, true); } -void osc_page_clip (const struct lu_env *env,const struct cl_page_slice *slice, -int from,int to) +static void osc_page_clip (const struct lu_env *env, +const struct cl_page_slice *slice,int from,int to) {struct osc_page *opg =cl2osc_page (slice);struct osc_async_page *oap = &opg->ops_oap;
drivers/staging/lustre/lustre/osc/osc_request.c +2 -2
@@ -3303,7 +3303,7 @@ static int osc_process_config(struct obd_device *obd, u32 len, void *buf)return osc_process_config_base (obd, buf); } -struct obd_ops osc_obd_ops = { +static struct obd_ops osc_obd_ops = { .o_owner =THIS_MODULE , .o_setup = osc_setup, .o_precleanup = osc_precleanup,
@@ -3337,7 +3337,7 @@ extern struct lu_kmem_descr osc_caches[];extern spinlock_t osc_ast_guard;extern struct lock_class_key osc_ast_guard_class; -int __init osc_init (void ) +static int __init osc_init (void ) {struct lprocfs_static_vars lvars = {NULL };int rc;
drivers/staging/lustre/lustre/ptlrpc/client.c +1 -1
@@ -379,7 +379,7 @@ static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req)return rc; } -struct kmem_cache *request_cache; +static struct kmem_cache *request_cache;int ptlrpc_request_cache_init (void ) {
drivers/staging/lustre/lustre/ptlrpc/events.c +2 -2
@@ -486,7 +486,7 @@ int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,return rc; } -void ptlrpc_ni_fini (void ) +static void ptlrpc_ni_fini (void ) {wait_queue_head_t waitq;struct l_wait_info lwi;
@@ -530,7 +530,7 @@ lnet_pid_t ptl_get_pid(void)return pid; } -int ptlrpc_ni_init (void ) +static int ptlrpc_ni_init (void ) {int rc;lnet_pid_t pid;
drivers/staging/lustre/lustre/ptlrpc/layout.c +1 -1
@@ -2002,7 +2002,7 @@ static void *__req_capsule_get(struct req_capsule *pill,/** * Dump a request and/or reply */ -void __req_capsule_dump (struct req_capsule *pill,enum req_location loc) +static void __req_capsule_dump (struct req_capsule *pill,enum req_location loc) {const struct req_format *fmt;const struct req_msg_field *field;
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +8 -7
@@ -45,7 +45,7 @@#include "ptlrpc_internal.h" -struct ll_rpc_opcode { +static struct ll_rpc_opcode {__u32 opcode;const char *opname; } ll_rpc_opcode_table[LUSTRE_MAX_OPCODES ] = {
@@ -136,7 +136,7 @@ struct ll_rpc_opcode { { UPDATE_OBJ, "update_obj" }, }; -struct ll_eopcode { +static struct ll_eopcode {__u32 opcode;const char *opname; } ll_eopcode_table[EXTRA_LAST_OPC] = {
@@ -175,15 +175,16 @@ const char *ll_opcode2str(__u32 opcode)return ll_rpc_opcode_table[offset].opname; } -const char *ll_eopcode2str (__u32 opcode) +static const char *ll_eopcode2str (__u32 opcode) {LASSERT (ll_eopcode_table[opcode].opcode == opcode);return ll_eopcode_table[opcode].opname; }#if defined (CONFIG_PROC_FS ) -void ptlrpc_lprocfs_register (struct proc_dir_entry *root,char *dir, -char *name,struct proc_dir_entry **procroot_ret, -struct lprocfs_stats **stats_ret) +static void ptlrpc_lprocfs_register (struct proc_dir_entry *root,char *dir, +char *name, +struct proc_dir_entry **procroot_ret, +struct lprocfs_stats **stats_ret) {struct proc_dir_entry *svc_procroot;struct lprocfs_stats *svc_stats;
@@ -723,7 +724,7 @@ struct ptlrpc_srh_iterator {struct ptlrpc_request *srhi_req; }; -int +static int ptlrpc_lprocfs_svc_req_history_seek (struct ptlrpc_service_part *svcpt,struct ptlrpc_srh_iterator *srhi,__u64 seq)
drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +4 -4
@@ -437,8 +437,8 @@ void *lustre_msg_buf(struct lustre_msg *m, int n, int min_size) }EXPORT_SYMBOL (lustre_msg_buf); -int lustre_shrink_msg_v2 (struct lustre_msg_v2 *msg,int segment, -unsigned int newlen,int move_data) +static int lustre_shrink_msg_v2 (struct lustre_msg_v2 *msg,int segment, +unsigned int newlen,int move_data) {char *tail =NULL , *newpos;int tail_len =0 , n;
@@ -1979,7 +1979,7 @@ void lustre_swab_fid2path(struct getinfo_fid2path *gf) }EXPORT_SYMBOL (lustre_swab_fid2path); -void lustre_swab_fiemap_extent (struct ll_fiemap_extent *fm_extent) +static void lustre_swab_fiemap_extent (struct ll_fiemap_extent *fm_extent) {__swab64s (&fm_extent->fe_logical);__swab64s (&fm_extent->fe_physical);
@@ -2458,7 +2458,7 @@ void lustre_swab_hsm_state_set(struct hsm_state_set *hss) }EXPORT_SYMBOL (lustre_swab_hsm_state_set); -void lustre_swab_hsm_extent (struct hsm_extent *extent) +static void lustre_swab_hsm_extent (struct hsm_extent *extent) {__swab64s (&extent->offset);__swab64s (&extent->length);
drivers/staging/lustre/lustre/ptlrpc/pinger.c +7 -6
@@ -91,7 +91,7 @@ int ptlrpc_obd_ping(struct obd_device *obd) }EXPORT_SYMBOL (ptlrpc_obd_ping); -int ptlrpc_ping (struct obd_import *imp) +static int ptlrpc_ping (struct obd_import *imp) {struct ptlrpc_request *req;
@@ -110,7 +110,7 @@ int ptlrpc_ping(struct obd_import *imp)return 0 ; } -void ptlrpc_update_next_ping (struct obd_import *imp,int soon) +static void ptlrpc_update_next_ping (struct obd_import *imp,int soon) {int time = soon ?PING_INTERVAL_SHORT :PING_INTERVAL ;if (imp->imp_state ==LUSTRE_IMP_DISCON ) {
@@ -141,7 +141,7 @@ static inline int ptlrpc_next_reconnect(struct obd_import *imp)return cfs_time_shift (obd_timeout); } -long pinger_check_timeout (unsigned long time) +static long pinger_check_timeout (unsigned long time) {struct timeout_item *item;unsigned long timeout =PING_INTERVAL ;
@@ -428,8 +428,9 @@ EXPORT_SYMBOL(ptlrpc_pinger_del_import);* Register a timeout callback to the pinger list, and the callback will * be called when timeout happens. */ -struct timeout_item *ptlrpc_new_timeout (int time,enum timeout_event event, -timeout_cb_t cb,void *data) +static struct timeout_item *ptlrpc_new_timeout (int time, +enum timeout_event event, +timeout_cb_t cb,void *data) {struct timeout_item *ti;
@@ -554,7 +555,7 @@ void ptlrpc_pinger_wake_up(void)static int pet_refcount =0 ;static int pet_state;static wait_queue_head_t pet_waitq; -LIST_HEAD (pet_list); +static LIST_HEAD (pet_list);static DEFINE_SPINLOCK (pet_lock);int ping_evictor_wake (struct obd_export *exp)
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c +1 -1
@@ -51,7 +51,7 @@ extern spinlock_t ptlrpc_rs_debug_lock;extern struct mutex pinger_mutex;extern struct mutex ptlrpcd_mutex; -__init int ptlrpc_init (void ) +static __init int ptlrpc_init (void ) {int rc, cleanup_phase =0 ;
drivers/staging/lustre/lustre/ptlrpc/service.c +4 -4
@@ -69,7 +69,7 @@ LIST_HEAD(ptlrpc_all_services);/** Used to protect the \e ptlrpc_all_services list */ struct mutex ptlrpc_all_services_mutex; -struct ptlrpc_request_buffer_desc * +static struct ptlrpc_request_buffer_desc *ptlrpc_alloc_rqbd (struct ptlrpc_service_part *svcpt) {struct ptlrpc_service *svc = svcpt->scp_service;
@@ -99,7 +99,7 @@ ptlrpc_alloc_rqbd(struct ptlrpc_service_part *svcpt)return rqbd; } -void +static void ptlrpc_free_rqbd (struct ptlrpc_request_buffer_desc *rqbd) {struct ptlrpc_service_part *svcpt = rqbd->rqbd_svcpt;
@@ -116,7 +116,7 @@ ptlrpc_free_rqbd(struct ptlrpc_request_buffer_desc *rqbd)OBD_FREE_PTR (rqbd); } -int +static int ptlrpc_grow_req_bufs (struct ptlrpc_service_part *svcpt,int post) {struct ptlrpc_service *svc = svcpt->scp_service;
@@ -3067,7 +3067,7 @@ EXPORT_SYMBOL(ptlrpc_unregister_service);* Right now, it just checks to make sure that requests aren't languishing * in the queue. We'll use this health check to govern whether a node needs * to be shot, so it's intentionally non-aggressive. */ -int ptlrpc_svcpt_health_check (struct ptlrpc_service_part *svcpt) +static int ptlrpc_svcpt_health_check (struct ptlrpc_service_part *svcpt) {struct ptlrpc_request *request =NULL ;struct timeval right_now;
--
2.1.2
Greg KH
maintainerQuoted 7 lines · Adrian Nicoara
All the changes are against variables/functions that are only accessed from within the same file. If the scope needs to change later on, the static keyword can be removed.
Build tested.
Signed-off-by Adrian Nicoara <[email protected]>
Adds a few build warnings, so I can't take this patch, sorry :(
ALWAYS test your patches.