int lu_buf_check_and_grow(struct lu_buf *buf, size_t len);
struct lu_buf *lu_buf_check_and_alloc(struct lu_buf *buf, size_t len);
+extern __u32 lu_context_tags_default;
+extern __u32 lu_session_tags_default;
+
/** @} lu */
#endif /* __LUSTRE_LU_OBJECT_H */
struct obd_export *lustre_find_lwp_by_index(const char *dev, __u32 idx);
int tgt_name2lwp_name(const char *tgt_name, char *lwp_name, int len, __u32 idx);
#endif /* HAVE_SERVER_SUPPORT */
+int lustre_register_fs(void);
+int lustre_unregister_fs(void);
+int lustre_check_exclusion(struct super_block *sb, char *svname);
/* sysctl.c */
extern void obd_sysctl_init (void);
int server_name2index(const char *svname, __u32 *idx, const char **endptr);
+/* linux-module.c */
+extern struct miscdevice obd_psdev;
+int class_procfs_init(void);
+int class_procfs_clean(void);
+
#endif /* __LINUX_OBD_CLASS_H */
*/
LU_KEY_INIT_FINI(lu_capainfo, struct lu_capainfo);
-struct lu_context_key lu_capainfo_key = {
+static struct lu_context_key lu_capainfo_key = {
.lct_tags = LCT_SERVER_SESSION,
.lct_init = lu_capainfo_key_init,
.lct_fini = lu_capainfo_key_fini
};
struct cl_thread_info *cl_env_info(const struct lu_env *env);
+void cl_page_disown0(const struct lu_env *env,
+ struct cl_io *io, struct cl_page *pg);
+
#endif /* _CL_INTERNAL_H */
}
EXPORT_SYMBOL(cl_page_list_splice);
-void cl_page_disown0(const struct lu_env *env,
- struct cl_io *io, struct cl_page *pg);
-
/**
* Disowns pages in a queue.
*/
#include <libcfs/list.h>
#include <libcfs/libcfs_hash.h> /* for cfs_hash stuff */
#include <cl_object.h>
+#include <lu_object.h>
#include "cl_internal.h"
static struct kmem_cache *cl_env_kmem;
/** Lock class of cl_object_header::coh_attr_guard */
static struct lock_class_key cl_attr_guard_class;
-extern __u32 lu_context_tags_default;
-extern __u32 lu_session_tags_default;
/**
* Initialize cl_object_header.
*/
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;
struct list_head obd_types;
DEFINE_RWLOCK(obd_dev_lock);
-__u64 obd_max_pages = 0;
-__u64 obd_max_alloc = 0;
+#ifdef LPROCFS
+static __u64 obd_max_pages;
+static __u64 obd_max_alloc;
+#else
+__u64 obd_max_pages;
+__u64 obd_max_alloc;
+#endif
static DEFINE_SPINLOCK(obd_updatemax_lock);
RETURN(err);
} /* class_handle_ioctl */
-extern struct miscdevice obd_psdev;
-
#define OBD_INIT_CHECK
#ifdef OBD_INIT_CHECK
static int obd_init_checks(void)
#define obd_init_checks() do {} while(0)
#endif
-extern int class_procfs_init(void);
-extern int class_procfs_clean(void);
-
static int __init init_obdclass(void)
{
int i, err;
- int lustre_register_fs(void);
for (i = CAPA_SITE_CLIENT; i < CAPA_SITE_MAX; i++)
INIT_LIST_HEAD(&capa_list[i]);
* ifdef to the end of the file to cover module and versioning goo.*/
static void cleanup_obdclass(void)
{
- int lustre_unregister_fs(void);
__u64 memory_leaked, pages_leaked;
__u64 memory_max, pages_max;
ENTRY;
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;
+
+static struct list_head obd_zombie_imports;
+static struct list_head obd_zombie_exports;
+static spinlock_t obd_zombie_impexp_lock;
-struct list_head obd_zombie_imports;
-struct list_head obd_zombie_exports;
-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);
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)
{
ENTRY;
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;
struct proc_dir_entry *proc_lustre_root = NULL;
EXPORT_SYMBOL(proc_lustre_root);
-struct lprocfs_seq_vars lprocfs_base[] = {
+static struct lprocfs_seq_vars lprocfs_base[] = {
{ .name = "version",
.fops = &obd_proc_version_fops },
{ .name = "pinger",
atomic_read(&obd->obd_refcount));
}
-struct seq_operations obd_device_list_sops = {
+static const 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,
return 0;
}
-struct file_operations obd_device_list_fops = {
+static const struct file_operations obd_device_list_fops = {
.owner = THIS_MODULE,
.open = obd_device_list_open,
.read = seq_read,
#include <obd_support.h>
#include <lprocfs_status.h>
+#include <obd_class.h>
#ifdef CONFIG_SYSCTL
-struct ctl_table_header *obd_table_header = NULL;
+static struct ctl_table_header *obd_table_header;
#endif
static int
}
#ifdef RANDOM_FAIL_ALLOC
-int proc_alloc_fail_rate(struct ctl_table *table, int write,
- void __user *buffer, size_t *lenp, loff_t *ppos)
+static int proc_alloc_fail_rate(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp, loff_t *ppos)
{
int rc = 0;
* Allocate a new log or catalog handle
* Used inside llog_open().
*/
-struct llog_handle *llog_alloc_handle(void)
+static struct llog_handle *llog_alloc_handle(void)
{
struct llog_handle *loghandle;
/*
* Free llog handle and header data if exists. Used in llog_close() only
*/
-void llog_free_handle(struct llog_handle *loghandle)
+static void llog_free_handle(struct llog_handle *loghandle)
{
LASSERT(loghandle != NULL);
}
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;
}
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;
return rc;
}
-int cat_cancel_cb(const struct lu_env *env, struct llog_handle *cathandle,
- struct llog_rec_hdr *rec, void *data)
+static int cat_cancel_cb(const struct lu_env *env,
+ struct llog_handle *cathandle,
+ struct llog_rec_hdr *rec, void *data)
{
struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
struct llog_handle *loghandle;
RETURN(0);
}
EXPORT_SYMBOL(llog_cat_init_and_process);
-
* \retval dt_object of llog directory
* \retval ERR_PTR of negative value on error
*/
-struct dt_object *llog_osd_dir_get(const struct lu_env *env,
- struct llog_ctxt *ctxt)
+static struct dt_object *llog_osd_dir_get(const struct lu_env *env,
+ struct llog_ctxt *ctxt)
{
struct dt_device *dt;
struct dt_thread_info *dti = dt_info(env);
OBD_FREE_PTR(obj);
}
-struct lu_object_operations ls_lu_obj_ops = {
+static struct lu_object_operations ls_lu_obj_ops = {
.loo_object_init = ls_object_init,
.loo_object_free = ls_object_free,
};
-struct lu_object *ls_object_alloc(const struct lu_env *env,
- const struct lu_object_header *_h,
- struct lu_device *d)
+static struct lu_object *ls_object_alloc(const struct lu_env *env,
+ const struct lu_object_header *_h,
+ struct lu_device *d)
{
struct lu_object_header *h;
struct ls_object *o;
/*
* Create local named object (file, directory or index) in parent directory.
*/
-struct dt_object *__local_file_create(const struct lu_env *env,
- const struct lu_fid *fid,
- struct local_oid_storage *los,
- struct ls_device *ls,
- struct dt_object *parent,
- const char *name, struct lu_attr *attr,
- struct dt_object_format *dof)
+static struct dt_object *__local_file_create(const struct lu_env *env,
+ const struct lu_fid *fid,
+ struct local_oid_storage *los,
+ struct ls_device *ls,
+ struct dt_object *parent,
+ const char *name,
+ struct lu_attr *attr,
+ struct dt_object_format *dof)
{
struct dt_thread_info *dti = dt_info(env);
struct lu_object_conf *conf = &dti->dti_conf;
/* after Lustre 2.3 release there may be old file to store last generated FID
* If such file exists then we have to read its content
*/
-int lastid_compat_check(const struct lu_env *env, struct dt_device *dev,
- __u64 lastid_seq, __u32 *first_oid, struct ls_device *ls)
+static int lastid_compat_check(const struct lu_env *env, struct dt_device *dev,
+ __u64 lastid_seq, __u32 *first_oid,
+ struct ls_device *ls)
{
struct dt_thread_info *dti = dt_info(env);
struct dt_object *root = NULL;
return 0;
}
-struct seq_operations lprocfs_jobstats_seq_sops = {
+static const struct seq_operations lprocfs_jobstats_seq_sops = {
start: lprocfs_jobstats_seq_start,
stop: lprocfs_jobstats_seq_stop,
next: lprocfs_jobstats_seq_next,
return len;
}
-struct file_operations lprocfs_jobstats_seq_fops = {
+static const struct file_operations lprocfs_jobstats_seq_fops = {
.owner = THIS_MODULE,
.open = lprocfs_jobstats_seq_open,
.read = seq_read,
EXPORT_SYMBOL(lprocfs_seq_add_vars);
#ifndef HAVE_ONLY_PROCFS_SEQ
-void lprocfs_remove_nolock(struct proc_dir_entry **proot)
+static void lprocfs_remove_nolock(struct proc_dir_entry **proot)
{
struct proc_dir_entry *root = *proot;
struct proc_dir_entry *temp = root;
return (rc < 0) ? rc : 0;
}
-struct seq_operations lprocfs_stats_seq_sops = {
+static const struct seq_operations lprocfs_stats_seq_sops = {
.start = lprocfs_stats_seq_start,
.stop = lprocfs_stats_seq_stop,
.next = lprocfs_stats_seq_next,
return 0;
}
-struct file_operations lprocfs_stats_seq_fops = {
+static const struct file_operations lprocfs_stats_seq_fops = {
.owner = THIS_MODULE,
.open = lprocfs_stats_seq_open,
.read = seq_read,
return seq_printf(m, "%s\n", obd_export_nid2str(exp));
}
-int lprocfs_exp_print_uuid_seq(cfs_hash_t *hs, cfs_hash_bd_t *bd,
- struct hlist_node *hnode, void *cb_data)
+static int lprocfs_exp_print_uuid_seq(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+ struct hlist_node *hnode, void *cb_data)
{
struct obd_export *exp = cfs_hash_object(hs, hnode);
return 0;
}
-int lprocfs_exp_nodemap_seq_show(struct seq_file *m, void *data)
+static int lprocfs_exp_nodemap_seq_show(struct seq_file *m, void *data)
{
struct obd_export *exp = m->private;
if (exp->exp_target_data.ted_nodemap)
}
LPROC_SEQ_FOPS_RO(lprocfs_exp_nodemap);
-int lprocfs_exp_uuid_seq_show(struct seq_file *m, void *data)
+static int lprocfs_exp_uuid_seq_show(struct seq_file *m, void *data)
{
struct nid_stat *stats = m->private;
struct obd_device *obd = stats->nid_obd;
}
LPROC_SEQ_FOPS_RO(lprocfs_exp_uuid);
-int lprocfs_exp_print_hash_seq(cfs_hash_t *hs, cfs_hash_bd_t *bd,
- struct hlist_node *hnode, void *cb_data)
+static int lprocfs_exp_print_hash_seq(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+ struct hlist_node *hnode, void *cb_data)
{
struct seq_file *m = cb_data;
return 0;
}
-int lprocfs_exp_hash_seq_show(struct seq_file *m, void *data)
+static int lprocfs_exp_hash_seq_show(struct seq_file *m, void *data)
{
struct nid_stat *stats = m->private;
struct obd_device *obd = stats->nid_obd;
* 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,
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,
/**
* 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, ...)
+ void *unused, const char *format, ...)
{
va_list args;
return 0;
}
EXPORT_SYMBOL(lu_buf_check_and_grow);
-
/** 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;
RETURN(rc);
}
-struct list_head lustre_profile_list =
+static struct list_head lustre_profile_list =
LIST_HEAD_INIT(lustre_profile_list);
struct lustre_profile *class_get_profile(const char * prof)
* 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;
}
EXPORT_SYMBOL(class_process_proc_param);
-extern int lustre_check_exclusion(struct super_block *sb, char *svname);
-
/*
* Supplemental functions for config logs, it allocates lustre_cfg
* buffers plus initialized llog record header at the beginning.
}
EXPORT_SYMBOL(class_config_parse_llog);
-struct lcfg_type_data {
+static struct lcfg_type_data {
__u32 ltd_type;
char *ltd_name;
char *ltd_bufs[4];
* This is separated from class_config_dump_handler() to use
* for ioctl needs as well
*/
-int class_config_parse_rec(struct llog_rec_hdr *rec, char *buf, int size)
+static int class_config_parse_rec(struct llog_rec_hdr *rec, char *buf, int size)
{
struct lustre_cfg *lcfg = (struct lustre_cfg *)(rec + 1);
char *ptr = buf;
return rc;
}
-DEFINE_MUTEX(mgc_start_lock);
+static DEFINE_MUTEX(mgc_start_lock);
/** Set up a mgc obd to process startup logs
*
/***************** 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;
ENTRY;
* 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;
/***************** FS registration ******************/
#ifdef HAVE_FSTYPE_MOUNT
-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 = { data, NULL };
return mount_nodev(fs_type, flags, &lmd2, lustre_fill_super);
}
#else
-int lustre_get_sb(struct file_system_type *fs_type, int flags,
- const char *devname, void * data, struct vfsmount *mnt)
+static int lustre_get_sb(struct file_system_type *fs_type, int flags,
+ const char *devname, void *data, struct vfsmount *mnt)
{
struct lustre_mount_data2 lmd2 = { data, mnt };
}
#endif
-void lustre_kill_super(struct super_block *sb)
+static void lustre_kill_super(struct super_block *sb)
{
struct lustre_sb_info *lsi = s2lsi(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",
#ifdef HAVE_FSTYPE_MOUNT
/*********** mount lookup *********/
-DEFINE_MUTEX(lustre_mount_info_lock);
+static DEFINE_MUTEX(lustre_mount_info_lock);
static struct list_head server_mount_info_list =
LIST_HEAD_INIT(server_mount_info_list);
static struct list_head lwp_register_list =
LIST_HEAD_INIT(lwp_register_list);
-DEFINE_MUTEX(lwp_register_list_lock);
+static DEFINE_MUTEX(lwp_register_list_lock);
int lustre_register_lwp_item(const char *lwpname, struct obd_export **exp,
register_lwp_cb cb_func, void *cb_data)
return rc;
}
-DEFINE_MUTEX(server_start_lock);
+static DEFINE_MUTEX(server_start_lock);
/* Stop MDS/OSS if nobody is using them */
static int server_stop_servers(int lsiflags)
return -EOPNOTSUPP;
}
-const struct inode_operations server_inode_operations = {
+static const struct inode_operations server_inode_operations = {
.setxattr = lustre_setxattr,
.getxattr = lustre_getxattr,
.listxattr = lustre_listxattr,
.o_disconnect = echo_client_disconnect
};
-int echo_client_init(void)
+static int echo_client_init(void)
{
int rc;
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);