diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/include')
21 files changed, 124 insertions, 774 deletions
diff --git a/drivers/staging/lustre/lustre/include/dt_object.h b/drivers/staging/lustre/lustre/include/dt_object.h index be4c7d95e788..abae31b41e74 100644 --- a/drivers/staging/lustre/lustre/include/dt_object.h +++ b/drivers/staging/lustre/lustre/include/dt_object.h @@ -58,7 +58,6 @@ #include "../../include/linux/libcfs/libcfs.h" struct seq_file; -struct proc_dir_entry; struct lustre_cfg; struct thandle; @@ -1481,7 +1480,6 @@ static inline struct dt_thread_info *dt_info(const struct lu_env *env) int dt_global_init(void); void dt_global_fini(void); -#if defined (CONFIG_PROC_FS) int lprocfs_dt_rd_blksize(char *page, char **start, off_t off, int count, int *eof, void *data); int lprocfs_dt_rd_kbytestotal(char *page, char **start, off_t off, @@ -1494,6 +1492,5 @@ int lprocfs_dt_rd_filestotal(char *page, char **start, off_t off, int count, int *eof, void *data); int lprocfs_dt_rd_filesfree(char *page, char **start, off_t off, int count, int *eof, void *data); -#endif /* CONFIG_PROC_FS */ #endif /* __LUSTRE_DT_OBJECT_H */ diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h b/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h index 3925db160650..513c81f43d6e 100644 --- a/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h +++ b/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h @@ -189,22 +189,7 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount) #endif - -/* - * After 3.1, kernel's nameidata.intent.open.flags is different - * with lustre's lookup_intent.it_flags, as lustre's it_flags' - * lower bits equal to FMODE_xxx while kernel doesn't transliterate - * lower bits of nameidata.intent.open.flags to FMODE_xxx. - * */ #include <linux/version.h> -static inline int ll_namei_to_lookup_intent_flag(int flag) -{ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) - flag = (flag & ~O_ACCMODE) | OPEN_FMODE(flag); -#endif - return flag; -} - #include <linux/fs.h> # define ll_umode_t umode_t diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_lite.h b/drivers/staging/lustre/lustre/include/linux/lustre_lite.h index a7658a99a08d..45651caf42cc 100644 --- a/drivers/staging/lustre/lustre/include/linux/lustre_lite.h +++ b/drivers/staging/lustre/lustre/include/linux/lustre_lite.h @@ -44,7 +44,6 @@ #include <linux/fs.h> #include <linux/dcache.h> -#include <linux/proc_fs.h> #include "../obd_class.h" #include "../lustre_net.h" diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_patchless_compat.h b/drivers/staging/lustre/lustre/include/linux/lustre_patchless_compat.h index d72605864b0a..14562788e4e0 100644 --- a/drivers/staging/lustre/lustre/include/linux/lustre_patchless_compat.h +++ b/drivers/staging/lustre/lustre/include/linux/lustre_patchless_compat.h @@ -55,9 +55,7 @@ truncate_complete_page(struct address_space *mapping, struct page *page) if (PagePrivate(page)) page->mapping->a_ops->invalidatepage(page, 0, PAGE_CACHE_SIZE); - if (TestClearPageDirty(page)) - account_page_cleaned(page, mapping); - + cancel_dirty_page(page); ClearPageMappedToDisk(page); ll_delete_from_page_cache(page); } diff --git a/drivers/staging/lustre/lustre/include/linux/obd.h b/drivers/staging/lustre/lustre/include/linux/obd.h index 9cd8683573ce..2817e88e014a 100644 --- a/drivers/staging/lustre/lustre/include/linux/obd.h +++ b/drivers/staging/lustre/lustre/include/linux/obd.h @@ -43,11 +43,11 @@ #include "../obd_support.h" -# include <linux/fs.h> -# include <linux/list.h> -# include <linux/sched.h> /* for struct task_struct, for current.h */ -# include <linux/proc_fs.h> -# include <linux/mount.h> +#include <linux/fs.h> +#include <linux/list.h> +#include <linux/sched.h> /* for struct task_struct, for current.h */ +#include <linux/mount.h> + #include "../lustre_intent.h" struct ll_iattr { diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index d030847e51ba..8ede2a00ca4f 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -42,7 +42,7 @@ #ifndef _LPROCFS_SNMP_H #define _LPROCFS_SNMP_H -#include <linux/proc_fs.h> +#include <linux/debugfs.h> #include <linux/seq_file.h> #include <linux/spinlock.h> #include <linux/types.h> @@ -60,8 +60,8 @@ struct lprocfs_vars { }; struct lprocfs_static_vars { - struct lprocfs_vars *module_vars; struct lprocfs_vars *obd_vars; + struct attribute_group *sysfs_vars; }; /* if we find more consumers this could be generalized */ @@ -348,7 +348,8 @@ enum { #define EXTRA_FIRST_OPC LDLM_GLIMPSE_ENQUEUE /* class_obd.c */ -extern struct proc_dir_entry *proc_lustre_root; +extern struct dentry *debugfs_lustre_root; +extern struct kobject *lustre_kobj; struct obd_device; struct obd_histogram; @@ -378,8 +379,6 @@ extern int lprocfs_write_frac_helper(const char __user *buffer, unsigned long count, int *val, int mult); extern int lprocfs_read_frac_helper(char *buffer, unsigned long count, long val, int mult); -#if defined (CONFIG_PROC_FS) - extern int lprocfs_stats_alloc_one(struct lprocfs_stats *stats, unsigned int cpuid); /* @@ -422,9 +421,8 @@ static inline int lprocfs_stats_lock(struct lprocfs_stats *stats, int opc, else spin_lock(&stats->ls_lock); return 1; - } else { - return stats->ls_biggest_alloc_num; } + return stats->ls_biggest_alloc_num; } } @@ -556,53 +554,45 @@ extern void lprocfs_counter_init(struct lprocfs_stats *stats, int index, extern void lprocfs_free_obd_stats(struct obd_device *obddev); extern void lprocfs_free_md_stats(struct obd_device *obddev); struct obd_export; -struct nid_stat; -extern int lprocfs_add_clear_entry(struct obd_device *obd, - struct proc_dir_entry *entry); -extern int lprocfs_exp_setup(struct obd_export *exp, - lnet_nid_t *peer_nid, int *newnid); extern int lprocfs_exp_cleanup(struct obd_export *exp); -extern struct proc_dir_entry *lprocfs_add_simple(struct proc_dir_entry *root, - char *name, - void *data, - struct file_operations *fops); -extern struct proc_dir_entry * -lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent, +extern struct dentry *ldebugfs_add_simple(struct dentry *root, + char *name, + void *data, + struct file_operations *fops); +extern struct dentry * +ldebugfs_add_symlink(const char *name, struct dentry *parent, const char *format, ...); -extern void lprocfs_free_per_client_stats(struct obd_device *obd); -extern int -lprocfs_nid_stats_clear_write(struct file *file, const char *buffer, - unsigned long count, void *data); -extern int lprocfs_nid_stats_clear_read(struct seq_file *m, void *data); -extern int lprocfs_register_stats(struct proc_dir_entry *root, const char *name, - struct lprocfs_stats *stats); +extern int ldebugfs_register_stats(struct dentry *parent, + const char *name, + struct lprocfs_stats *stats); /* lprocfs_status.c */ -extern int lprocfs_add_vars(struct proc_dir_entry *root, - struct lprocfs_vars *var, - void *data); +extern int ldebugfs_add_vars(struct dentry *parent, + struct lprocfs_vars *var, + void *data); -extern struct proc_dir_entry *lprocfs_register(const char *name, - struct proc_dir_entry *parent, - struct lprocfs_vars *list, - void *data); +extern struct dentry *ldebugfs_register(const char *name, + struct dentry *parent, + struct lprocfs_vars *list, + void *data); -extern void lprocfs_remove(struct proc_dir_entry **root); -extern void lprocfs_remove_proc_entry(const char *name, - struct proc_dir_entry *parent); +extern void ldebugfs_remove(struct dentry **entryp); -extern int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list); +extern int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list, + struct attribute_group *attrs); extern int lprocfs_obd_cleanup(struct obd_device *obd); -extern int lprocfs_seq_create(struct proc_dir_entry *parent, const char *name, - umode_t mode, - const struct file_operations *seq_fops, - void *data); -extern int lprocfs_obd_seq_create(struct obd_device *dev, const char *name, - umode_t mode, - const struct file_operations *seq_fops, - void *data); +extern int ldebugfs_seq_create(struct dentry *parent, + const char *name, + umode_t mode, + const struct file_operations *seq_fops, + void *data); +extern int ldebugfs_obd_seq_create(struct obd_device *dev, + const char *name, + umode_t mode, + const struct file_operations *seq_fops, + void *data); /* Generic callbacks */ @@ -613,15 +603,12 @@ extern int lprocfs_wr_atomic(struct file *file, const char __user *buffer, extern int lprocfs_rd_uint(struct seq_file *m, void *data); extern int lprocfs_wr_uint(struct file *file, const char __user *buffer, unsigned long count, void *data); -extern int lprocfs_rd_uuid(struct seq_file *m, void *data); extern int lprocfs_rd_name(struct seq_file *m, void *data); extern int lprocfs_rd_server_uuid(struct seq_file *m, void *data); extern int lprocfs_rd_conn_uuid(struct seq_file *m, void *data); extern int lprocfs_rd_import(struct seq_file *m, void *data); extern int lprocfs_rd_state(struct seq_file *m, void *data); extern int lprocfs_rd_connect_flags(struct seq_file *m, void *data); -extern int lprocfs_rd_num_exports(struct seq_file *m, void *data); -extern int lprocfs_rd_numrefs(struct seq_file *m, void *data); struct adaptive_timeout; extern int lprocfs_at_hist_helper(struct seq_file *m, @@ -640,12 +627,6 @@ extern int lprocfs_wr_pinger_recov(struct file *file, const char __user *buffer, size_t count, loff_t *off); /* Statfs helpers */ -extern int lprocfs_rd_blksize(struct seq_file *m, void *data); -extern int lprocfs_rd_kbytestotal(struct seq_file *m, void *data); -extern int lprocfs_rd_kbytesfree(struct seq_file *m, void *data); -extern int lprocfs_rd_kbytesavail(struct seq_file *m, void *data); -extern int lprocfs_rd_filestotal(struct seq_file *m, void *data); -extern int lprocfs_rd_filesfree(struct seq_file *m, void *data); extern int lprocfs_write_helper(const char __user *buffer, unsigned long count, int *val); @@ -685,11 +666,11 @@ extern int lprocfs_seq_release(struct inode *, struct file *); /* write the name##_seq_show function, call LPROC_SEQ_FOPS_RO for read-only proc entries; otherwise, you will define name##_seq_write function also for a read-write proc entry, and then call LPROC_SEQ_SEQ instead. Finally, - call lprocfs_obd_seq_create(obd, filename, 0444, &name#_fops, data); */ + call ldebugfs_obd_seq_create(obd, filename, 0444, &name#_fops, data); */ #define __LPROC_SEQ_FOPS(name, custom_seq_write) \ static int name##_single_open(struct inode *inode, struct file *file) \ { \ - return single_open(file, name##_seq_show, PDE_DATA(inode)); \ + return single_open(file, name##_seq_show, inode->i_private); \ } \ static struct file_operations name##_fops = { \ .owner = THIS_MODULE, \ @@ -734,7 +715,7 @@ static struct file_operations name##_fops = { \ } \ static int name##_##type##_open(struct inode *inode, struct file *file) \ { \ - return single_open(file, NULL, PDE_DATA(inode)); \ + return single_open(file, NULL, inode->i_private); \ } \ static struct file_operations name##_##type##_fops = { \ .open = name##_##type##_open, \ @@ -742,6 +723,27 @@ static struct file_operations name##_fops = { \ .release = lprocfs_single_release, \ } +struct lustre_attr { + struct attribute attr; + ssize_t (*show)(struct kobject *kobj, struct attribute *attr, + char *buf); + ssize_t (*store)(struct kobject *kobj, struct attribute *attr, + const char *buf, size_t len); +}; + +#define LUSTRE_ATTR(name, mode, show, store) \ +static struct lustre_attr lustre_attr_##name = __ATTR(name, mode, show, store) + +#define LUSTRE_RO_ATTR(name) LUSTRE_ATTR(name, 0444, name##_show, NULL) +#define LUSTRE_RW_ATTR(name) LUSTRE_ATTR(name, 0644, name##_show, name##_store) + +ssize_t lustre_attr_show(struct kobject *kobj, struct attribute *attr, + char *buf); +ssize_t lustre_attr_store(struct kobject *kobj, struct attribute *attr, + const char *buf, size_t len); + +extern const struct sysfs_ops lustre_sysfs_ops; + /* lproc_ptlrpc.c */ struct ptlrpc_request; extern void target_print_req(void *seq_file, struct ptlrpc_request *req); @@ -810,206 +812,4 @@ extern int lprocfs_quota_rd_qs_factor(char *page, char **start, loff_t off, extern int lprocfs_quota_wr_qs_factor(struct file *file, const char *buffer, unsigned long count, void *data); -#else -/* CONFIG_PROC_FS is not defined */ - -#define proc_lustre_root NULL - -static inline void lprocfs_counter_add(struct lprocfs_stats *stats, - int index, long amount) -{ return; } -static inline void lprocfs_counter_incr(struct lprocfs_stats *stats, - int index) -{ return; } -static inline void lprocfs_counter_sub(struct lprocfs_stats *stats, - int index, long amount) -{ return; } -static inline void lprocfs_counter_decr(struct lprocfs_stats *stats, - int index) -{ return; } -static inline void lprocfs_counter_init(struct lprocfs_stats *stats, - int index, unsigned conf, - const char *name, const char *units) -{ return; } - -static inline __u64 lc_read_helper(struct lprocfs_counter *lc, - enum lprocfs_fields_flags field) -{ return 0; } - -/* NB: we return !NULL to satisfy error checker */ -static inline struct lprocfs_stats * -lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags) -{ return (struct lprocfs_stats *)1; } -static inline void lprocfs_clear_stats(struct lprocfs_stats *stats) -{ return; } -static inline void lprocfs_free_stats(struct lprocfs_stats **stats) -{ return; } -static inline int lprocfs_register_stats(struct proc_dir_entry *root, - const char *name, - struct lprocfs_stats *stats) -{ return 0; } -static inline void lprocfs_init_ops_stats(int num_private_stats, - struct lprocfs_stats *stats) -{ return; } -static inline void lprocfs_init_mps_stats(int num_private_stats, - struct lprocfs_stats *stats) -{ return; } -static inline void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats) -{ return; } -static inline int lprocfs_alloc_obd_stats(struct obd_device *obddev, - unsigned int num_private_stats) -{ return 0; } -static inline int lprocfs_alloc_md_stats(struct obd_device *obddev, - unsigned int num_private_stats) -{ return 0; } -static inline void lprocfs_free_obd_stats(struct obd_device *obddev) -{ return; } -static inline void lprocfs_free_md_stats(struct obd_device *obddev) -{ return; } - -struct obd_export; -static inline int lprocfs_add_clear_entry(struct obd_export *exp) -{ return 0; } -static inline int lprocfs_exp_setup(struct obd_export *exp, - lnet_nid_t *peer_nid, - int *newnid) -{ return 0; } -static inline int lprocfs_exp_cleanup(struct obd_export *exp) -{ return 0; } -static inline struct proc_dir_entry * -lprocfs_add_simple(struct proc_dir_entry *root, char *name, - void *data, struct file_operations *fops) -{return 0; } -static inline struct proc_dir_entry * -lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent, - const char *format, ...) -{return NULL; } -static inline void lprocfs_free_per_client_stats(struct obd_device *obd) -{ return; } -static inline -int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer, - unsigned long count, void *data) -{return count;} -static inline -int lprocfs_nid_stats_clear_read(struct seq_file *m, void *data) -{ return 0; } - -static inline struct proc_dir_entry * -lprocfs_register(const char *name, struct proc_dir_entry *parent, - struct lprocfs_vars *list, void *data) -{ return NULL; } -static inline int lprocfs_add_vars(struct proc_dir_entry *root, - struct lprocfs_vars *var, - void *data) -{ return 0; } -static inline void lprocfs_remove(struct proc_dir_entry **root) -{ return; } -static inline void lprocfs_remove_proc_entry(const char *name, - struct proc_dir_entry *parent) -{ return; } -static inline int lprocfs_obd_setup(struct obd_device *dev, - struct lprocfs_vars *list) -{ return 0; } -static inline int lprocfs_obd_cleanup(struct obd_device *dev) -{ return 0; } -static inline int lprocfs_rd_u64(struct seq_file *m, void *data) -{ return 0; } -static inline int lprocfs_rd_uuid(struct seq_file *m, void *data) -{ return 0; } -static inline int lprocfs_rd_name(struct seq_file *m, void *data) -{ return 0; } -static inline int lprocfs_rd_server_uuid(struct seq_file *m, void *data) -{ return 0; } -static inline int lprocfs_rd_conn_uuid(struct seq_file *m, void *data) -{ return 0; } -static inline int lprocfs_rd_import(struct seq_file *m, void *data) -{ return 0; } -static inline int lprocfs_rd_pinger_recov(struct seq_file *m, void *n) -{ return 0; } -static inline int lprocfs_rd_state(struct seq_file *m, void *data) -{ return 0; } -static inline int lprocfs_rd_connect_flags(struct seq_file *m, void *data) -{ return 0; } -static inline int lprocfs_rd_num_exports(struct seq_file *m, void *data) -{ return 0; } -extern inline int lprocfs_rd_numrefs(struct seq_file *m, void *data) -{ return 0; } -struct adaptive_timeout; -static inline int lprocfs_at_hist_helper(struct seq_file *m, - struct adaptive_timeout *at) -{ return 0; } -static inline int lprocfs_rd_timeouts(struct seq_file *m, void *data) -{ return 0; } -static inline int lprocfs_wr_timeouts(struct file *file, - const char __user *buffer, - unsigned long count, void *data) -{ return 0; } -static inline int lprocfs_wr_evict_client(struct file *file, - const char __user *buffer, - size_t count, loff_t *off) -{ return 0; } -static inline int lprocfs_wr_ping(struct file *file, - const char __user *buffer, - size_t count, loff_t *off) -{ return 0; } -static inline int lprocfs_wr_import(struct file *file, - const char __user *buffer, - size_t count, loff_t *off) -{ return 0; } -static inline int lprocfs_wr_pinger_recov(struct file *file, - const char __user *buffer, - size_t count, loff_t *off) -{ return 0; } - -/* Statfs helpers */ -static inline -int lprocfs_rd_blksize(struct seq_file *m, void *data) -{ return 0; } -static inline -int lprocfs_rd_kbytestotal(struct seq_file *m, void *data) -{ return 0; } -static inline -int lprocfs_rd_kbytesfree(struct seq_file *m, void *data) -{ return 0; } -static inline -int lprocfs_rd_kbytesavail(struct seq_file *m, void *data) -{ return 0; } -static inline -int lprocfs_rd_filestotal(struct seq_file *m, void *data) -{ return 0; } -static inline -int lprocfs_rd_filesfree(struct seq_file *m, void *data) -{ return 0; } -static inline -void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value) -{ return; } -static inline -void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value) -{ return; } -static inline -void lprocfs_oh_clear(struct obd_histogram *oh) -{ return; } -static inline -unsigned long lprocfs_oh_sum(struct obd_histogram *oh) -{ return 0; } -static inline -void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx, - struct lprocfs_counter *cnt) -{ return; } -static inline -__u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx, - enum lprocfs_fields_flags field) -{ return (__u64)0; } - -#define LPROC_SEQ_FOPS_RO(name) -#define LPROC_SEQ_FOPS(name) -#define LPROC_SEQ_FOPS_RO_TYPE(name, type) -#define LPROC_SEQ_FOPS_RW_TYPE(name, type) -#define LPROC_SEQ_FOPS_WR_ONLY(name, type) - -/* lproc_ptlrpc.c */ -#define target_print_req NULL - -#endif /* CONFIG_PROC_FS */ - #endif /* LPROCFS_SNMP_H */ diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/drivers/staging/lustre/lustre/include/lu_object.h index c8cc48f00026..e1d72a7a5c2d 100644 --- a/drivers/staging/lustre/lustre/include/lu_object.h +++ b/drivers/staging/lustre/lustre/include/lu_object.h @@ -43,7 +43,6 @@ #include "lu_ref.h" struct seq_file; -struct proc_dir_entry; struct lustre_cfg; struct lprocfs_stats; @@ -277,7 +276,6 @@ struct lu_device { * Stack this device belongs to. */ struct lu_site *ld_site; - struct proc_dir_entry *ld_proc_entry; /** \todo XXX: temporary back pointer into obd. */ struct obd_device *ld_obd; diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index 305ecbee9b78..4d72d6ed26b0 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -92,6 +92,7 @@ #define _LUSTRE_IDL_H_ #include "../../../include/linux/libcfs/libcfs.h" +#include "../../../include/linux/lnet/types.h" /* Defn's shared with user-space. */ #include "lustre_user.h" diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h index 89794fdfec9d..e095ada40ed2 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h @@ -243,7 +243,6 @@ struct ost_id { #define LL_IOC_LMV_SETSTRIPE _IOWR('f', 240, struct lmv_user_md) #define LL_IOC_LMV_GETSTRIPE _IOWR('f', 241, struct lmv_user_md) -#define LL_IOC_REMOVE_ENTRY _IOWR('f', 242, __u64) #define LL_IOC_SET_LEASE _IOWR('f', 243, long) #define LL_IOC_GET_LEASE _IO('f', 244) #define LL_IOC_HSM_IMPORT _IOWR('f', 245, struct hsm_user_import) diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index bac9902b56bb..f6f4c037fb30 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -60,11 +60,13 @@ struct obd_ops; struct obd_device; +extern struct kset *ldlm_ns_kset; +extern struct kset *ldlm_svc_kset; + #define OBD_LDLM_DEVICENAME "ldlm" #define LDLM_DEFAULT_LRU_SIZE (100 * num_online_cpus()) #define LDLM_DEFAULT_MAX_ALIVE (cfs_time_seconds(36000)) -#define LDLM_CTIME_AGE_LIMIT (10) #define LDLM_DEFAULT_PARALLEL_AST_LIMIT 1024 /** @@ -232,8 +234,8 @@ struct ldlm_pool_ops { * This feature is commonly referred to as lru_resize. */ struct ldlm_pool { - /** Pool proc directory. */ - struct proc_dir_entry *pl_proc_dir; + /** Pool debugfs directory. */ + struct dentry *pl_debugfs_entry; /** Pool name, must be long enough to hold compound proc entry name. */ char pl_name[100]; /** Lock for protecting SLV/CLV updates. */ @@ -263,6 +265,10 @@ struct ldlm_pool { int pl_grant_plan; /** Pool statistics. */ struct lprocfs_stats *pl_stats; + + /* sysfs object */ + struct kobject pl_kobj; + struct completion pl_kobj_unregister; }; typedef int (*ldlm_res_policy)(struct ldlm_namespace *, struct ldlm_lock **, @@ -302,14 +308,6 @@ typedef enum { LDLM_NAMESPACE_MODEST = 1 << 1 } ldlm_appetite_t; -/** - * Default values for the "max_nolock_size", "contention_time" and - * "contended_locks" namespace tunables. - */ -#define NS_DEFAULT_MAX_NOLOCK_BYTES 0 -#define NS_DEFAULT_CONTENTION_SECONDS 2 -#define NS_DEFAULT_CONTENDED_LOCKS 32 - struct ldlm_ns_bucket { /** back pointer to namespace */ struct ldlm_namespace *nsb_namespace; @@ -390,8 +388,8 @@ struct ldlm_namespace { /** Client side original connect flags supported by server. */ __u64 ns_orig_connect_flags; - /* namespace proc dir entry */ - struct proc_dir_entry *ns_proc_dir_entry; + /* namespace debugfs dir entry */ + struct dentry *ns_debugfs_entry; /** * Position in global namespace list linking all namespaces on @@ -421,18 +419,6 @@ struct ldlm_namespace { unsigned int ns_max_unused; /** Maximum allowed age (last used time) for locks in the LRU */ unsigned int ns_max_age; - /** - * Server only: number of times we evicted clients due to lack of reply - * to ASTs. - */ - unsigned int ns_timeouts; - /** - * Number of seconds since the file change time after which the - * MDT will return an UPDATE lock along with a LOOKUP lock. - * This allows the client to start caching negative dentries - * for a directory and may save an RPC for a later stat. - */ - unsigned int ns_ctime_age_limit; /** * Used to rate-limit ldlm_namespace_dump calls. @@ -466,27 +452,6 @@ struct ldlm_namespace { /** Definition of how eagerly unused locks will be released from LRU */ ldlm_appetite_t ns_appetite; - /** - * If more than \a ns_contended_locks are found, the resource is - * considered to be contended. Lock enqueues might specify that no - * contended locks should be granted - */ - unsigned ns_contended_locks; - - /** - * The resources in this namespace remember contended state during - * \a ns_contention_time, in seconds. - */ - unsigned ns_contention_time; - - /** - * Limit size of contended extent locks, in bytes. - * If extended lock is requested for more then this many bytes and - * caller instructs us not to grant contended locks, we would disregard - * such a request. - */ - unsigned ns_max_nolock_size; - /** Limit of parallel AST RPC count. */ unsigned ns_max_parallel_ast; @@ -501,6 +466,9 @@ struct ldlm_namespace { * recalculation of LDLM pool statistics should be skipped. */ unsigned ns_stopping:1; + + struct kobject ns_kobj; /* sysfs object */ + struct completion ns_kobj_unregister; }; /** @@ -1283,13 +1251,8 @@ void ldlm_namespace_register(struct ldlm_namespace *ns, ldlm_side_t client); void ldlm_namespace_unregister(struct ldlm_namespace *ns, ldlm_side_t client); void ldlm_namespace_get(struct ldlm_namespace *ns); void ldlm_namespace_put(struct ldlm_namespace *ns); -#if defined (CONFIG_PROC_FS) -int ldlm_proc_setup(void); -void ldlm_proc_cleanup(void); -#else -static inline int ldlm_proc_setup(void) { return 0; } -static inline void ldlm_proc_cleanup(void) {} -#endif +int ldlm_debugfs_setup(void); +void ldlm_debugfs_cleanup(void); /* resource.c - internal */ struct ldlm_resource *ldlm_resource_get(struct ldlm_namespace *ns, diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm_flags.h b/drivers/staging/lustre/lustre/include/lustre_dlm_flags.h index 16dcdbfae689..d4cc09635271 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm_flags.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm_flags.h @@ -1,17 +1,10 @@ /* -*- buffer-read-only: t -*- vi: set ro: * - * DO NOT EDIT THIS FILE (lustre_dlm_flags.h) + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. * - * It has been AutoGen-ed - * From the definitions lustre_dlm_flags.def - * and the template file lustre_dlm_flags.tpl - * - * lustre is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * lustre is distributed in the hope that it will be useful, but + * Lustre is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. @@ -22,8 +15,6 @@ /** * \file lustre_dlm_flags.h * The flags and collections of flags (masks) for \see struct ldlm_lock. - * This file is derived from flag definitions in lustre_dlm_flags.def. - * The format is defined in the lustre_dlm_flags.tpl template file. * * \addtogroup LDLM Lustre Distributed Lock Manager * @{ diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h b/drivers/staging/lustre/lustre/include/lustre_export.h index 9c06a49f12a4..3b992b42fd91 100644 --- a/drivers/staging/lustre/lustre/include/lustre_export.h +++ b/drivers/staging/lustre/lustre/include/lustre_export.h @@ -106,34 +106,6 @@ struct mgs_export_data { spinlock_t med_lock; /* protect med_clients */ }; -/** - * per-NID statistics structure. - * It tracks access patterns to this export on a per-client-NID basis - */ -struct nid_stat { - lnet_nid_t nid; - struct hlist_node nid_hash; - struct list_head nid_list; - struct obd_device *nid_obd; - struct proc_dir_entry *nid_proc; - struct lprocfs_stats *nid_stats; - struct lprocfs_stats *nid_ldlm_stats; - atomic_t nid_exp_ref_count; /* for obd_nid_stats_hash - exp_nid_stats */ -}; - -#define nidstat_getref(nidstat) \ -do { \ - atomic_inc(&(nidstat)->nid_exp_ref_count); \ -} while (0) - -#define nidstat_putref(nidstat) \ -do { \ - atomic_dec(&(nidstat)->nid_exp_ref_count); \ - LASSERTF(atomic_read(&(nidstat)->nid_exp_ref_count) >= 0, \ - "stat %p nid_exp_ref_count < 0\n", nidstat); \ -} while (0) - enum obd_option { OBD_OPT_FORCE = 0x0001, OBD_OPT_FAILOVER = 0x0002, @@ -190,7 +162,6 @@ struct obd_export { * exp_lock protect its change */ struct obd_import *exp_imp_reverse; - struct nid_stat *exp_nid_stats; struct lprocfs_stats *exp_md_stats; /** Active connection */ struct ptlrpc_connection *exp_connection; diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h index 0a0929fd9023..c7c8fe4cdbcc 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fid.h +++ b/drivers/staging/lustre/lustre/include/lustre_fid.h @@ -346,7 +346,7 @@ struct lu_client_seq { struct lu_seq_range lcs_space; /* Seq related proc */ - struct proc_dir_entry *lcs_proc_dir; + struct dentry *lcs_debugfs_entry; /* This holds last allocated fid in last obtained seq */ struct lu_fid lcs_fid; @@ -392,9 +392,6 @@ struct lu_server_seq { /* /seq file object device */ struct dt_object *lss_obj; - /* Seq related proc */ - struct proc_dir_entry *lss_proc_dir; - /* LUSTRE_SEQ_SERVER or LUSTRE_SEQ_CONTROLLER */ enum lu_mgr_type lss_type; diff --git a/drivers/staging/lustre/lustre/include/lustre_fld.h b/drivers/staging/lustre/lustre/include/lustre_fld.h index 5ee4b1ed0995..c1f08dee3bd6 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fld.h +++ b/drivers/staging/lustre/lustre/include/lustre_fld.h @@ -71,10 +71,6 @@ struct lu_fld_target { struct lu_server_fld { /** - * Fld dir proc entry. */ - struct proc_dir_entry *lsf_proc_dir; - - /** * /fld file object device */ struct dt_object *lsf_obj; @@ -99,8 +95,8 @@ struct lu_server_fld { struct lu_client_fld { /** - * Client side proc entry. */ - struct proc_dir_entry *lcf_proc_dir; + * Client side debugfs entry. */ + struct dentry *lcf_debugfs_entry; /** * List of exports client FLD knows about. */ @@ -123,10 +119,10 @@ struct lu_client_fld { struct fld_cache *lcf_cache; /** - * Client fld proc entry name. */ - char lcf_name[LUSTRE_MDT_MAXNAMELEN]; + * Client fld debugfs entry name. */ + char lcf_name[LUSTRE_MDT_MAXNAMELEN]; - int lcf_flags; + int lcf_flags; }; /* Client methods */ @@ -153,7 +149,7 @@ int fld_client_add_target(struct lu_client_fld *fld, int fld_client_del_target(struct lu_client_fld *fld, __u64 idx); -void fld_client_proc_fini(struct lu_client_fld *fld); +void fld_client_debugfs_fini(struct lu_client_fld *fld); /** @} fld */ diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre/lustre/include/lustre_lib.h index bf135630c39a..43ee9f0eb4d4 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lib.h +++ b/drivers/staging/lustre/lustre/include/lustre_lib.h @@ -549,19 +549,13 @@ do { \ __blocked = cfs_block_sigsinv(0); \ \ for (;;) { \ - unsigned __wstate; \ - \ - __wstate = info->lwi_on_signal != NULL && \ - (__timeout == 0 || __allow_intr) ? \ - TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE; \ - \ - set_current_state(TASK_INTERRUPTIBLE); \ - \ if (condition) \ break; \ \ + set_current_state(TASK_INTERRUPTIBLE); \ + \ if (__timeout == 0) { \ - schedule(); \ + schedule(); \ } else { \ long interval = info->lwi_interval? \ min_t(long, \ @@ -582,6 +576,8 @@ do { \ } \ } \ \ + set_current_state(TASK_RUNNING); \ + \ if (condition) \ break; \ if (cfs_signal_pending()) { \ @@ -605,7 +601,6 @@ do { \ \ cfs_restore_sigs(__blocked); \ \ - set_current_state(TASK_RUNNING); \ remove_wait_queue(&wq, &__wait); \ } while (0) diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index e2805bd1acf1..77a7de98fc8e 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -56,8 +56,8 @@ */ #include "../../include/linux/libcfs/libcfs.h" -// #include <obd.h> -#include "../../include/linux/lnet/lnet.h" +#include "../../include/linux/lnet/nidstr.h" +#include "../../include/linux/lnet/api.h" #include "lustre/lustre_idl.h" #include "lustre_ha.h" #include "lustre_sec.h" @@ -1978,8 +1978,8 @@ struct ptlrpc_service { int srv_nthrs_cpt_init; /** limit of threads number for each partition */ int srv_nthrs_cpt_limit; - /** Root of /proc dir tree for this service */ - struct proc_dir_entry *srv_procroot; + /** Root of debugfs dir tree for this service */ + struct dentry *srv_debugfs_entry; /** Pointer to statistic data for this service */ struct lprocfs_stats *srv_stats; /** # hp per lp reqs to handle */ @@ -2016,6 +2016,10 @@ struct ptlrpc_service { int srv_cpt_bits; /** CPT table this service is running over */ struct cfs_cpt_table *srv_cptable; + + /* sysfs object */ + struct kobject srv_kobj; + struct completion srv_kobj_unregister; /** * partition data for ptlrpc service */ @@ -2525,7 +2529,8 @@ void ptlrpc_schedule_difficult_reply(struct ptlrpc_reply_state *rs); int ptlrpc_hpreq_handler(struct ptlrpc_request *req); struct ptlrpc_service *ptlrpc_register_service( struct ptlrpc_service_conf *conf, - struct proc_dir_entry *proc_entry); + struct kset *parent, + struct dentry *debugfs_entry); void ptlrpc_stop_all_threads(struct ptlrpc_service *svc); int ptlrpc_start_threads(struct ptlrpc_service *svc); @@ -2947,15 +2952,9 @@ void ptlrpcd_decref(void); * @{ */ const char *ll_opcode2str(__u32 opcode); -#if defined (CONFIG_PROC_FS) void ptlrpc_lprocfs_register_obd(struct obd_device *obd); void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd); void ptlrpc_lprocfs_brw(struct ptlrpc_request *req, int bytes); -#else -static inline void ptlrpc_lprocfs_register_obd(struct obd_device *obd) {} -static inline void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd) {} -static inline void ptlrpc_lprocfs_brw(struct ptlrpc_request *req, int bytes) {} -#endif /** @} */ /* ptlrpc/llog_client.c */ diff --git a/drivers/staging/lustre/lustre/include/lustre_quota.h b/drivers/staging/lustre/lustre/include/lustre_quota.h deleted file mode 100644 index 2643f28070a2..000000000000 --- a/drivers/staging/lustre/lustre/include/lustre_quota.h +++ /dev/null @@ -1,241 +0,0 @@ -/* - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 021110-1307, USA - * - * GPL HEADER END - */ -/* - * Copyright (c) 2011, 2012, Intel Corporation. - * Use is subject to license terms. - */ - -#ifndef _LUSTRE_QUOTA_H -#define _LUSTRE_QUOTA_H - -/** \defgroup quota quota - * - */ - -#include <linux/fs.h> -#include <linux/quota.h> -#include <linux/quotaops.h> - -#include "dt_object.h" -#include "lustre_fid.h" -#include "lustre_dlm.h" - -#ifndef MAX_IQ_TIME -#define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */ -#endif - -#ifndef MAX_DQ_TIME -#define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */ -#endif - -struct lquota_id_info; -struct lquota_trans; - -/* Gather all quota record type in an union that can be used to read any records - * from disk. All fields of these records must be 64-bit aligned, otherwise the - * OSD layer may swab them incorrectly. */ -union lquota_rec { - struct lquota_glb_rec lqr_glb_rec; - struct lquota_slv_rec lqr_slv_rec; - struct lquota_acct_rec lqr_acct_rec; -}; - -/* Index features supported by the global index objects - * Only used for migration purpose and should be removed once on-disk migration - * is no longer needed */ -extern struct dt_index_features dt_quota_iusr_features; -extern struct dt_index_features dt_quota_busr_features; -extern struct dt_index_features dt_quota_igrp_features; -extern struct dt_index_features dt_quota_bgrp_features; - -/* Name used in the configuration logs to identify the default metadata pool - * (composed of all the MDTs, with pool ID 0) and the default data pool (all - * the OSTs, with pool ID 0 too). */ -#define QUOTA_METAPOOL_NAME "mdt=" -#define QUOTA_DATAPOOL_NAME "ost=" - -/* - * Quota Master Target support - */ - -/* Request handlers for quota master operations. - * This is used by the MDT to pass quota/lock requests to the quota master - * target. This won't be needed any more once the QMT is a real target and - * does not rely any more on the MDT service threads and namespace. */ -struct qmt_handlers { - /* Handle quotactl request from client. */ - int (*qmth_quotactl)(const struct lu_env *, struct lu_device *, - struct obd_quotactl *); - - /* Handle dqacq/dqrel request from slave. */ - int (*qmth_dqacq)(const struct lu_env *, struct lu_device *, - struct ptlrpc_request *); - - /* LDLM intent policy associated with quota locks */ - int (*qmth_intent_policy)(const struct lu_env *, struct lu_device *, - struct ptlrpc_request *, struct ldlm_lock **, - int); - - /* Initialize LVB of ldlm resource associated with quota objects */ - int (*qmth_lvbo_init)(struct lu_device *, struct ldlm_resource *); - - /* Update LVB of ldlm resource associated with quota objects */ - int (*qmth_lvbo_update)(struct lu_device *, struct ldlm_resource *, - struct ptlrpc_request *, int); - - /* Return size of LVB to be packed in ldlm message */ - int (*qmth_lvbo_size)(struct lu_device *, struct ldlm_lock *); - - /* Fill request buffer with lvb */ - int (*qmth_lvbo_fill)(struct lu_device *, struct ldlm_lock *, void *, - int); - - /* Free lvb associated with ldlm resource */ - int (*qmth_lvbo_free)(struct lu_device *, struct ldlm_resource *); -}; - -/* actual handlers are defined in lustre/quota/qmt_handler.c */ -extern struct qmt_handlers qmt_hdls; - -/* - * Quota enforcement support on slaves - */ - -struct qsd_instance; - -/* The quota slave feature is implemented under the form of a library. - * The API is the following: - * - * - qsd_init(): the user (mostly the OSD layer) should first allocate a qsd - * instance via qsd_init(). This creates all required structures - * to manage quota enforcement for this target and performs all - * low-level initialization which does not involve any lustre - * object. qsd_init() should typically be called when the OSD - * is being set up. - * - * - qsd_prepare(): This sets up on-disk objects associated with the quota slave - * feature and initiates the quota reintegration procedure if - * needed. qsd_prepare() should typically be called when - * ->ldo_prepare is invoked. - * - * - qsd_start(): a qsd instance should be started once recovery is completed - * (i.e. when ->ldo_recovery_complete is called). This is used - * to notify the qsd layer that quota should now be enforced - * again via the qsd_op_begin/end functions. The last step of the - * reintegration procedure (namely usage reconciliation) will be - * completed during start. - * - * - qsd_fini(): is used to release a qsd_instance structure allocated with - * qsd_init(). This releases all quota slave objects and frees the - * structures associated with the qsd_instance. - * - * - qsd_op_begin(): is used to enforce quota, it must be called in the - * declaration of each operation. qsd_op_end() should then be - * invoked later once all operations have been completed in - * order to release/adjust the quota space. - * Running qsd_op_begin() before qsd_start() isn't fatal and - * will return success. - * Once qsd_start() has been run, qsd_op_begin() will block - * until the reintegration procedure is completed. - * - * - qsd_op_end(): performs the post operation quota processing. This must be - * called after the operation transaction stopped. - * While qsd_op_begin() must be invoked each time a new - * operation is declared, qsd_op_end() should be called only - * once for the whole transaction. - * - * - qsd_op_adjust(): triggers pre-acquire/release if necessary. - * - * Below are the function prototypes to be used by OSD layer to manage quota - * enforcement. Arguments are documented where each function is defined. */ - -struct qsd_instance *qsd_init(const struct lu_env *, char *, struct dt_device *, - struct proc_dir_entry *); -int qsd_prepare(const struct lu_env *, struct qsd_instance *); -int qsd_start(const struct lu_env *, struct qsd_instance *); -void qsd_fini(const struct lu_env *, struct qsd_instance *); -int qsd_op_begin(const struct lu_env *, struct qsd_instance *, - struct lquota_trans *, struct lquota_id_info *, int *); -void qsd_op_end(const struct lu_env *, struct qsd_instance *, - struct lquota_trans *); -void qsd_op_adjust(const struct lu_env *, struct qsd_instance *, - union lquota_id *, int); -/* This is exported for the ldiskfs quota migration only, - * see convert_quota_file() */ -int lquota_disk_write_glb(const struct lu_env *, struct dt_object *, - __u64, struct lquota_glb_rec *); - -/* - * Quota information attached to a transaction - */ - -struct lquota_entry; - -struct lquota_id_info { - /* quota identifier */ - union lquota_id lqi_id; - - /* USRQUOTA or GRPQUOTA for now, could be expanded for - * directory quota or other types later. */ - int lqi_type; - - /* inodes or kbytes to be consumed or released, it could - * be negative when releasing space. */ - long long lqi_space; - - /* quota slave entry structure associated with this ID */ - struct lquota_entry *lqi_qentry; - - /* whether we are reporting blocks or inodes */ - bool lqi_is_blk; -}; - -/* Since we enforce only inode quota in meta pool (MDTs), and block quota in - * data pool (OSTs), there are at most 4 quota ids being enforced in a single - * transaction, which is chown transaction: - * original uid and gid, new uid and gid. - * - * This value might need to be revised when directory quota is added. */ -#define QUOTA_MAX_TRANSIDS 4 - -/* all qids involved in a single transaction */ -struct lquota_trans { - unsigned short lqt_id_cnt; - struct lquota_id_info lqt_ids[QUOTA_MAX_TRANSIDS]; -}; - -/* flags for quota local enforcement */ -#define QUOTA_FL_OVER_USRQUOTA 0x01 -#define QUOTA_FL_OVER_GRPQUOTA 0x02 -#define QUOTA_FL_SYNC 0x04 - -#define IS_LQUOTA_RES(res) \ - (res->lr_name.name[LUSTRE_RES_ID_SEQ_OFF] == FID_SEQ_QUOTA || \ - res->lr_name.name[LUSTRE_RES_ID_SEQ_OFF] == FID_SEQ_QUOTA_GLB) - -/* helper function used by MDT & OFD to retrieve quota accounting information - * on slave */ -int lquotactl_slv(const struct lu_env *, struct dt_device *, - struct obd_quotactl *); -/** @} quota */ -#endif /* _LUSTRE_QUOTA_H */ diff --git a/drivers/staging/lustre/lustre/include/lustre_sec.h b/drivers/staging/lustre/lustre/include/lustre_sec.h index dff70a5b9bc4..707ff69717c6 100644 --- a/drivers/staging/lustre/lustre/include/lustre_sec.h +++ b/drivers/staging/lustre/lustre/include/lustre_sec.h @@ -1061,15 +1061,7 @@ const char *sec2target_str(struct ptlrpc_sec *sec); /* * lprocfs */ -#if defined (CONFIG_PROC_FS) -struct proc_dir_entry; -extern struct proc_dir_entry *sptlrpc_proc_root; int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev); -#else -#define sptlrpc_proc_root NULL -static inline int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev) -{ return 0; } -#endif /* * server side diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index 2a88b806fca5..55452e562bd4 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -244,11 +244,12 @@ struct obd_type { struct list_head typ_chain; struct obd_ops *typ_dt_ops; struct md_ops *typ_md_ops; - struct proc_dir_entry *typ_procroot; + struct dentry *typ_debugfs_entry; char *typ_name; int typ_refcnt; struct lu_device_type *typ_lu; spinlock_t obd_type_lock; + struct kobject *typ_kobj; }; struct brw_page { @@ -544,7 +545,7 @@ struct pool_desc { struct lov_qos_rr pool_rr; /* round robin qos */ struct hlist_node pool_hash; /* access by poolname */ struct list_head pool_list; /* serial access */ - struct proc_dir_entry *pool_proc_entry; /* file in /proc */ + struct dentry *pool_debugfs_entry; /* file in /proc */ struct obd_device *pool_lobd; /* obd of the lov/lod to which * this pool belongs */ }; @@ -565,13 +566,15 @@ struct lov_obd { int lov_pool_count; struct cfs_hash *lov_pools_hash_body; /* used for key access */ struct list_head lov_pool_list; /* used for sequential access */ - struct proc_dir_entry *lov_pool_proc_entry; + struct dentry *lov_pool_debugfs_entry; enum lustre_sec_part lov_sp_me; /* Cached LRU pages from upper layer */ void *lov_cache; struct rw_semaphore lov_notify_lock; + + struct kobject *lov_tgts_kobj; }; struct lmv_tgt_desc { @@ -610,6 +613,7 @@ struct lmv_obd { struct lmv_tgt_desc **tgts; struct obd_connect_data conn_data; + struct kobject *lmv_tgts_kobj; }; struct niobuf_local { @@ -841,9 +845,6 @@ struct obd_device { struct cfs_hash *obd_uuid_hash; /* nid-export hash body */ struct cfs_hash *obd_nid_hash; - /* nid stats body */ - struct cfs_hash *obd_nid_stats_hash; - struct list_head obd_nid_stats; atomic_t obd_refcount; wait_queue_head_t obd_refcount_waitq; struct list_head obd_exports; @@ -913,10 +914,8 @@ struct obd_device { unsigned int md_cntr_base; struct lprocfs_stats *md_stats; - struct proc_dir_entry *obd_proc_entry; - void *obd_proc_private; /* type private PDEs */ - struct proc_dir_entry *obd_proc_exports_entry; - struct proc_dir_entry *obd_svc_procroot; + struct dentry *obd_debugfs_entry; + struct dentry *obd_svc_debugfs_entry; struct lprocfs_stats *obd_svc_stats; atomic_t obd_evict_inprogress; wait_queue_head_t obd_evict_inprogress_waitq; @@ -936,6 +935,9 @@ struct obd_device { struct lu_ref obd_reference; int obd_conn_inprogress; + + struct kobject obd_kobj; /* sysfs object */ + struct completion obd_kobj_unregister; }; #define OBD_LLOG_FL_SENDNOW 0x0001 diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 34b5fa3f081c..36ed78127830 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -75,8 +75,7 @@ struct lu_device_type; extern struct list_head obd_types; struct obd_export *class_conn2export(struct lustre_handle *); int class_register_type(struct obd_ops *, struct md_ops *, - struct lprocfs_vars *, const char *nm, - struct lu_device_type *ldt); + const char *nm, struct lu_device_type *ldt); int class_unregister_type(const char *nm); struct obd_device *class_newdev(const char *type_name, const char *name); @@ -140,14 +139,7 @@ int class_add_conn(struct obd_device *obd, struct lustre_cfg *lcfg); int class_add_uuid(const char *uuid, __u64 nid); /*obdecho*/ -#if defined (CONFIG_PROC_FS) extern void lprocfs_echo_init_vars(struct lprocfs_static_vars *lvars); -#else -static inline void lprocfs_echo_init_vars(struct lprocfs_static_vars *lvars) -{ - memset(lvars, 0, sizeof(*lvars)); -} -#endif #define CFG_F_START 0x01 /* Set when we start updating from a log */ #define CFG_F_MARKER 0x02 /* We are within a maker */ @@ -357,7 +349,6 @@ static inline int obd_check_dev_active(struct obd_device *obd) return rc; } -#if defined (CONFIG_PROC_FS) #define OBD_COUNTER_OFFSET(op) \ ((offsetof(struct obd_ops, o_ ## op) - \ offsetof(struct obd_ops, o_iocontrol)) \ @@ -379,10 +370,6 @@ static inline int obd_check_dev_active(struct obd_device *obd) OBD_COUNTER_OFFSET(op); \ LASSERT(coffset < (export)->exp_obd->obd_stats->ls_num); \ lprocfs_counter_incr((export)->exp_obd->obd_stats, coffset); \ - if ((export)->exp_nid_stats != NULL && \ - (export)->exp_nid_stats->nid_stats != NULL) \ - lprocfs_counter_incr( \ - (export)->exp_nid_stats->nid_stats, coffset);\ } #define MD_COUNTER_OFFSET(op) \ @@ -411,27 +398,6 @@ static inline int obd_check_dev_active(struct obd_device *obd) (export)->exp_md_stats, coffset); \ } -#else -#define OBD_COUNTER_OFFSET(op) -#define OBD_COUNTER_INCREMENT(obd, op) -#define EXP_COUNTER_INCREMENT(exp, op) -#define MD_COUNTER_INCREMENT(obd, op) -#define EXP_MD_COUNTER_INCREMENT(exp, op) -#endif - -static inline int lprocfs_nid_ldlm_stats_init(struct nid_stat *tmp) -{ - /* Always add in ldlm_stats */ - tmp->nid_ldlm_stats = lprocfs_alloc_stats(LDLM_LAST_OPC - LDLM_FIRST_OPC - ,LPROCFS_STATS_FLAG_NOPERCPU); - if (tmp->nid_ldlm_stats == NULL) - return -ENOMEM; - - lprocfs_init_ldlm_stats(tmp->nid_ldlm_stats); - - return lprocfs_register_stats(tmp->nid_proc, "ldlm_stats", - tmp->nid_ldlm_stats); -} #define OBD_CHECK_MD_OP(obd, op, err) \ do { \ diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h index 2991d2ee780b..73e2d4880b9b 100644 --- a/drivers/staging/lustre/lustre/include/obd_support.h +++ b/drivers/staging/lustre/lustre/include/obd_support.h @@ -509,7 +509,6 @@ extern atomic_t libcfs_kmemory; extern void obd_update_maxusage(void); -#if defined (CONFIG_PROC_FS) #define obd_memory_add(size) \ lprocfs_counter_add(obd_memory, OBD_MEMORY_STAT, (long)(size)) #define obd_memory_sub(size) \ @@ -530,46 +529,6 @@ extern void obd_update_maxusage(void); extern __u64 obd_memory_max(void); extern __u64 obd_pages_max(void); -#else - -extern __u64 obd_alloc; -extern __u64 obd_pages; - -extern __u64 obd_max_alloc; -extern __u64 obd_max_pages; - -static inline void obd_memory_add(long size) -{ - obd_alloc += size; - if (obd_alloc > obd_max_alloc) - obd_max_alloc = obd_alloc; -} - -static inline void obd_memory_sub(long size) -{ - obd_alloc -= size; -} - -static inline void obd_pages_add(int order) -{ - obd_pages += 1<< order; - if (obd_pages > obd_max_pages) - obd_max_pages = obd_pages; -} - -static inline void obd_pages_sub(int order) -{ - obd_pages -= 1<< order; -} - -#define obd_memory_sum() (obd_alloc) -#define obd_pages_sum() (obd_pages) - -#define obd_memory_max() (obd_max_alloc) -#define obd_pages_max() (obd_max_pages) - -#endif - #define OBD_DEBUG_MEMUSAGE (1) #if OBD_DEBUG_MEMUSAGE @@ -676,37 +635,20 @@ do { \ __OBD_VMALLOC_VEROBSE(ptr, cptab, cpt, size) -/* Allocations above this size are considered too big and could not be done - * atomically. - * - * Be very careful when changing this value, especially when decreasing it, - * since vmalloc in Linux doesn't perform well on multi-cores system, calling - * vmalloc in critical path would hurt performance badly. See LU-66. - */ -#define OBD_ALLOC_BIG (4 * PAGE_CACHE_SIZE) - #define OBD_ALLOC_LARGE(ptr, size) \ do { \ - if (size > OBD_ALLOC_BIG) \ - OBD_VMALLOC(ptr, size); \ - else \ - OBD_ALLOC(ptr, size); \ + ptr = libcfs_kvzalloc(size, GFP_NOFS); \ } while (0) #define OBD_CPT_ALLOC_LARGE(ptr, cptab, cpt, size) \ do { \ - if (size > OBD_ALLOC_BIG) \ - OBD_CPT_VMALLOC(ptr, cptab, cpt, size); \ - else \ - OBD_CPT_ALLOC(ptr, cptab, cpt, size); \ + ptr = libcfs_kvzalloc_cpt(cptab, cpt, size, GFP_NOFS); \ } while (0) #define OBD_FREE_LARGE(ptr, size) \ do { \ - if (size > OBD_ALLOC_BIG) \ - OBD_VFREE(ptr, size); \ - else \ - OBD_FREE(ptr, size); \ + (void)(size); \ + kvfree(ptr); \ } while (0) |