Skip to contentSkip to conversation

Final part of lustre procfs removal series

PATCH New [email protected] 1 participant 7 messages May 31, 2015 Staging

lore
Share & tools
lore
#0 lore raw

cover Final part of lustre procfs removal series

From: Oleg Drokin <[email protected]>

Due to a patch naming error this remainder of patches did not merge. Fixed the commit message to resolve this.
lustresysctl code still stays in place and would be removed in a separate patch series.

Additionally resolved a merge conflict with some other patch that touched lprocfs_exp_setup and made the lprocfs_exp_setup removal patch unmergeable.

Dmitry Eremin (2):
staging/lustre/obd: remove unused proc_lustre_root staging/lustre/obd: final removal of procfs stuff

Oleg Drokin (4):
staging/lustre/llite: Move all remaining procfs entries to debugfs staging/lustre/obd: Rename lprocfs_add_symlink to ldebugfs_add_symlink staging/lustre/obd: remove unused lprocfs_exp_setup() and related
functions
staging/lustre/obd: Remove nid_stats tracking

 .../lustre/include/linux/libcfs/linux/libcfs.h     |   1 -
 drivers/staging/lustre/lustre/fid/Makefile         |   3 +-
 drivers/staging/lustre/lustre/fld/Makefile         |   3 +-
 drivers/staging/lustre/lustre/include/dt_object.h  |   3 -
 .../lustre/lustre/include/linux/lustre_lite.h      |   1 -
 drivers/staging/lustre/lustre/include/linux/obd.h  |  10 +-
 .../staging/lustre/lustre/include/lprocfs_status.h | 257 +-----------
 drivers/staging/lustre/lustre/include/lu_object.h  |   2 -
 .../staging/lustre/lustre/include/lustre_export.h  |  29 --
 drivers/staging/lustre/lustre/include/lustre_fid.h |   3 -
 drivers/staging/lustre/lustre/include/lustre_fld.h |   4 -
 drivers/staging/lustre/lustre/include/lustre_net.h |   6 -
 .../staging/lustre/lustre/include/lustre_quota.h   | 241 -----------
 drivers/staging/lustre/lustre/include/obd.h        |   4 -
 drivers/staging/lustre/lustre/include/obd_class.h  |  33 --
 .../staging/lustre/lustre/include/obd_support.h    |  41 --
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |   2 +-
 drivers/staging/lustre/lustre/libcfs/module.c      |   1 -
 drivers/staging/lustre/lustre/llite/Makefile       |   3 +-
 .../staging/lustre/lustre/llite/llite_internal.h   |  26 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c    |  13 +-
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |  48 ++-
 drivers/staging/lustre/lustre/llite/super25.c      |  20 +-
 drivers/staging/lustre/lustre/llite/vvp_dev.c      |  21 +-
 drivers/staging/lustre/lustre/lmv/Makefile         |   3 +-
 drivers/staging/lustre/lustre/lmv/lmv_internal.h   |   8 +-
 drivers/staging/lustre/lustre/lov/Makefile         |   3 +-
 drivers/staging/lustre/lustre/lov/lov_internal.h   |   7 -
 drivers/staging/lustre/lustre/lov/lov_pool.c       |   2 -
 drivers/staging/lustre/lustre/mdc/Makefile         |   3 +-
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c      |   2 +-
 drivers/staging/lustre/lustre/mdc/mdc_internal.h   |   7 -
 drivers/staging/lustre/lustre/mgc/Makefile         |   3 +-
 drivers/staging/lustre/lustre/mgc/mgc_internal.h   |  11 -
 drivers/staging/lustre/lustre/mgc/mgc_request.c    |   2 -
 drivers/staging/lustre/lustre/obdclass/Makefile    |   4 +-
 drivers/staging/lustre/lustre/obdclass/class_obd.c |  37 +-
 drivers/staging/lustre/lustre/obdclass/dt_object.c |   6 -
 .../lustre/lustre/obdclass/linux/linux-module.c    |  19 -
 .../lustre/lustre/obdclass/linux/linux-sysctl.c    |   1 -
 .../lustre/lustre/obdclass/lprocfs_status.c        | 447 +--------------------
 drivers/staging/lustre/lustre/obdclass/lu_object.c |   4 -
 .../staging/lustre/lustre/obdclass/obd_config.c    |  80 ----
 drivers/staging/lustre/lustre/osc/Makefile         |   3 +-
 drivers/staging/lustre/lustre/osc/lproc_osc.c      |   4 +-
 drivers/staging/lustre/lustre/osc/osc_internal.h   |   8 -
 drivers/staging/lustre/lustre/ptlrpc/Makefile      |   3 +-
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c    |   5 +-
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |  12 -
 drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c   |   8 +-
 50 files changed, 121 insertions(+), 1346 deletions(-)
 delete mode 100644 drivers/staging/lustre/lustre/include/lustre_quota.h
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/6 staging/lustre/llite: Move all remaining procfs entries to debugfs

From: Oleg Drokin <[email protected]>

This moves all remaining procfs handling in llite layer to debugfs.

---
 .../staging/lustre/lustre/llite/llite_internal.h   | 27 +++++++-----
 drivers/staging/lustre/lustre/llite/llite_lib.c    | 13 +++---
 drivers/staging/lustre/lustre/llite/lproc_llite.c  | 48 ++++++++++++----------
 drivers/staging/lustre/lustre/llite/super25.c      | 20 ++++-----
 drivers/staging/lustre/lustre/llite/vvp_dev.c      | 21 +++++-----
 5 files changed, 68 insertions(+), 61 deletions(-)
drivers/staging/lustre/lustre/llite/llite_internal.h +16 -11
index e180912..b30eb85 100644
@@ -465,7 +465,7 @@ struct ll_sb_info {
 	struct obd_uuid	   ll_sb_uuid;
 	struct obd_export	*ll_md_exp;
 	struct obd_export	*ll_dt_exp;
-	struct proc_dir_entry*    ll_proc_root;
+	struct dentry		*ll_debugfs_entry;
 	struct lu_fid	     ll_root_fid; /* root object fid */
 
 	int		       ll_flags;
@@ -636,7 +636,7 @@ struct lov_stripe_md;
 
 extern spinlock_t inode_lock;
 
-extern struct proc_dir_entry *proc_lustre_fs_root;
+extern struct dentry *llite_root;
 extern struct kset *llite_kset;
 
 static inline struct inode *ll_info2i(struct ll_inode_info *lli)
@@ -664,20 +664,25 @@ struct ll_ra_read *ll_ra_read_get(struct file *f);
 
 /* llite/lproc_llite.c */
 #if defined (CONFIG_PROC_FS)
-int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
-				struct super_block *sb, char *osc, char *mdc);
-void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi);
+int ldebugfs_register_mountpoint(struct dentry *parent,
+				 struct super_block *sb, char *osc, char *mdc);
+void ldebugfs_unregister_mountpoint(struct ll_sb_info *sbi);
 void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count);
 void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars);
 void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
 		       struct ll_file_data *file, loff_t pos,
 		       size_t count, int rw);
-#else
-static inline int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
-			struct super_block *sb, char *osc, char *mdc){return 0;}
-static inline void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi) {}
+#else /* CONFIG_PROC_FS */
+static inline
+int ldebugfs_register_mountpoint(struct dentry *parent,
+				 struct super_block *sb, char *osc, char *mdc)
+{ return 0; }
 static inline
-void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count) {}
+void ldebugfs_unregister_mountpoint(struct ll_sb_info *sbi)
+{}
+static inline
+void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count)
+{}
 static inline void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars)
 {
 	memset(lvars, 0, sizeof(*lvars));
@@ -685,7 +690,7 @@ static inline void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars)
 static inline void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
 				     struct ll_file_data *file, loff_t pos,
 				     size_t count, int rw) {}
-#endif
+#endif /* CONFIG_PROC_FS */
 
 
 /* llite/dir.c */
drivers/staging/lustre/lustre/llite/llite_lib.c +6 -7
index 4c9fd4a..2513988 100644
@@ -57,7 +57,7 @@
 #include "llite_internal.h"
 
 struct kmem_cache *ll_file_data_slab;
-struct proc_dir_entry *proc_lustre_fs_root;
+struct dentry *llite_root;
 struct kset *llite_kset;
 
 static LIST_HEAD(ll_super_blocks);
@@ -184,11 +184,10 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
 		return -ENOMEM;
 	}
 
-	if (proc_lustre_fs_root) {
-		err = lprocfs_register_mountpoint(proc_lustre_fs_root, sb,
-						  dt, md);
+	if (llite_root != NULL) {
+		err = ldebugfs_register_mountpoint(llite_root, sb, dt, md);
 		if (err < 0)
-			CERROR("could not register mount in /proc/fs/lustre\n");
+			CERROR("could not register mount in <debugfs>/lustre/llite\n");
 	}
 
 	/* indicate the features supported by this client */
@@ -601,7 +600,7 @@ out_md:
 out:
 	kfree(data);
 	kfree(osfs);
-	lprocfs_unregister_mountpoint(sbi);
+	ldebugfs_unregister_mountpoint(sbi);
 	return err;
 }
 
@@ -682,7 +681,7 @@ static void client_common_put_super(struct super_block *sb)
 	 * see LU-2543. */
 	obd_zombie_barrier();
 
-	lprocfs_unregister_mountpoint(sbi);
+	ldebugfs_unregister_mountpoint(sbi);
 
 	obd_fid_fini(sbi->ll_md_exp->exp_obd);
 	obd_disconnect(sbi->ll_md_exp);
drivers/staging/lustre/lustre/llite/lproc_llite.c +27 -21

106 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/super25.c +8 -12
index 8753560..e4020ce 100644
@@ -89,7 +89,6 @@ void lustre_register_client_process_config(int (*cpc)(struct lustre_cfg *lcfg));
 
 static int __init init_lustre_lite(void)
 {
-	struct proc_dir_entry *entry;
 	lnet_process_id_t lnet_id;
 	struct timeval tv;
 	int i, rc, seed[2];
@@ -128,20 +127,17 @@ static int __init init_lustre_lite(void)
 	if (ll_rmtperm_hash_cachep == NULL)
 		goto out_cache;
 
-	entry = lprocfs_register("llite", proc_lustre_root, NULL, NULL);
-	if (IS_ERR(entry)) {
-		rc = PTR_ERR(entry);
-		CERROR("cannot register '/proc/fs/lustre/llite': rc = %d\n",
-		       rc);
+	llite_root = debugfs_create_dir("llite", debugfs_lustre_root);
+	if (IS_ERR_OR_NULL(llite_root)) {
+		rc = llite_root ? PTR_ERR(llite_root) : -ENOMEM;
+		llite_root = NULL;
 		goto out_cache;
 	}
 
-	proc_lustre_fs_root = entry;
-
 	llite_kset = kset_create_and_add("llite", NULL, lustre_kobj);
 	if (!llite_kset) {
 		rc = -ENOMEM;
-		goto out_proc;
+		goto out_debugfs;
 	}
 
 	cfs_get_random_bytes(seed, sizeof(seed));
@@ -184,8 +180,8 @@ out_capa:
 	ll_capa_thread_stop();
 out_sysfs:
 	kset_unregister(llite_kset);
-out_proc:
-	lprocfs_remove(&proc_lustre_fs_root);
+out_debugfs:
+	debugfs_remove(llite_root);
 out_cache:
 	if (ll_inode_cachep != NULL)
 		kmem_cache_destroy(ll_inode_cachep);
@@ -208,7 +204,7 @@ static void __exit exit_lustre_lite(void)
 	lustre_register_kill_super_cb(NULL);
 	lustre_register_client_process_config(NULL);
 
-	lprocfs_remove(&proc_lustre_fs_root);
+	debugfs_remove(llite_root);
 	kset_unregister(llite_kset);
 
 	ll_xattr_fini();
drivers/staging/lustre/lustre/llite/vvp_dev.c +11 -10
index fde41d7..6d9622a 100644
@@ -253,7 +253,7 @@ int cl_sb_fini(struct super_block *sb)
 
 /****************************************************************************
  *
- * /proc/fs/lustre/llite/$MNT/dump_page_cache
+ * debugfs/lustre/llite/$MNT/dump_page_cache
  *
  ****************************************************************************/
 
@@ -526,16 +526,17 @@ static struct seq_operations vvp_pgcache_ops = {
 
 static int vvp_dump_pgcache_seq_open(struct inode *inode, struct file *filp)
 {
-	struct ll_sb_info     *sbi = PDE_DATA(inode);
-	struct seq_file       *seq;
-	int		    result;
+	struct seq_file *seq;
+	int rc;
 
-	result = seq_open(filp, &vvp_pgcache_ops);
-	if (result == 0) {
-		seq = filp->private_data;
-		seq->private = sbi;
-	}
-	return result;
+	rc = seq_open(filp, &vvp_pgcache_ops);
+	if (rc)
+		return rc;
+
+	seq = filp->private_data;
+	seq->private = inode->i_private ?: PDE_DATA(inode);
+
+	return 0;
 }
 
 const struct file_operations vvp_dump_pgcache_file_ops = {
Signature · 1 line
2.1.0
#2 lore raw

PATCH 2/6 staging/lustre/obd: remove unused proc_lustre_root

In reply to [email protected]

From: Dmitry Eremin <[email protected]>

---
 drivers/staging/lustre/lustre/include/lprocfs_status.h |  3 ---
 .../lustre/lustre/obdclass/linux/linux-module.c        | 18 ------------------
 2 files changed, 21 deletions(-)
drivers/staging/lustre/lustre/include/lprocfs_status.h +0 -3
index 721efd6..19ab9e8 100644
@@ -349,7 +349,6 @@ 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;
 
@@ -851,8 +850,6 @@ extern int lprocfs_quota_wr_qs_factor(struct file *file,
 #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; }
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +0 -18
index 03a982a..50c3d1d 100644
@@ -322,11 +322,6 @@ static ssize_t jobid_name_store(struct kobject *kobj, struct attribute *attr,
 struct dentry *debugfs_lustre_root;
 EXPORT_SYMBOL_GPL(debugfs_lustre_root);
 
-#if defined(CONFIG_PROC_FS)
-/* Root for /proc/fs/lustre */
-struct proc_dir_entry *proc_lustre_root = NULL;
-EXPORT_SYMBOL(proc_lustre_root);
-
 LUSTRE_RO_ATTR(version);
 LUSTRE_RO_ATTR(pinger);
 LUSTRE_RO_ATTR(health);
@@ -459,14 +454,6 @@ int class_procfs_init(void)
 		kobject_put(lustre_kobj);
 		goto out;
 	}
-
-	proc_lustre_root = lprocfs_register("fs/lustre", NULL, NULL, NULL);
-	if (IS_ERR(proc_lustre_root)) {
-		rc = PTR_ERR(proc_lustre_root);
-		proc_lustre_root = NULL;
-		kobject_put(lustre_kobj);
-		goto out;
-	}
 out:
 	return rc;
 }
@@ -478,12 +465,7 @@ int class_procfs_clean(void)
 
 	debugfs_lustre_root = NULL;
 
-	if (proc_lustre_root) {
-		lprocfs_remove(&proc_lustre_root);
-	}
-
 	kobject_put(lustre_kobj);
 
 	return 0;
 }
-#endif /* CONFIG_PROC_FS */
Signature · 1 line
2.1.0
#3 lore raw

PATCH 3/6 staging/lustre/obd: Rename lprocfs_add_symlink to ldebugfs_add_symlink

In reply to [email protected]

From: Oleg Drokin <[email protected]>

---
 drivers/staging/lustre/lustre/include/lprocfs_status.h  | 12 ++----------
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 16 +++++++++-------
 2 files changed, 11 insertions(+), 17 deletions(-)
drivers/staging/lustre/lustre/include/lprocfs_status.h +2 -10
index 19ab9e8..328cd07 100644
@@ -572,8 +572,8 @@ 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_symlink(const char *name, struct dentry *parent,
 		    const char *format, ...);
 extern void lprocfs_free_per_client_stats(struct obd_device *obd);
 extern int
@@ -905,20 +905,12 @@ static inline void lprocfs_free_md_stats(struct obd_device *obddev)
 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
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +9 -7
index 51865dd..79ff72c 100644
@@ -289,10 +289,10 @@ struct proc_dir_entry *lprocfs_add_simple(struct proc_dir_entry *root,
 }
 EXPORT_SYMBOL(lprocfs_add_simple);
 
-struct proc_dir_entry *lprocfs_add_symlink(const char *name,
-			struct proc_dir_entry *parent, const char *format, ...)
+struct dentry *ldebugfs_add_symlink(const char *name, struct dentry *parent,
+				    const char *format, ...)
 {
-	struct proc_dir_entry *entry;
+	struct dentry *entry;
 	char *dest;
 	va_list ap;
 
@@ -307,15 +307,17 @@ struct proc_dir_entry *lprocfs_add_symlink(const char *name,
 	vsnprintf(dest, MAX_STRING_SIZE, format, ap);
 	va_end(ap);
 
-	entry = proc_symlink(name, parent, dest);
-	if (entry == NULL)
-		CERROR("LprocFS: Could not create symbolic link from %s to %s",
+	entry = debugfs_create_symlink(name, parent, dest);
+	if (IS_ERR_OR_NULL(entry)) {
+		CERROR("LdebugFS: Could not create symbolic link from %s to %s",
 			name, dest);
+		entry = NULL;
+	}
 
 	kfree(dest);
 	return entry;
 }
-EXPORT_SYMBOL(lprocfs_add_symlink);
+EXPORT_SYMBOL(ldebugfs_add_symlink);
 
 static struct file_operations lprocfs_generic_fops = { };
 
Signature · 1 line
2.1.0
#4 lore raw

PATCH 4/6 staging/lustre/obd: remove unused lprocfs_exp_setup() and related functions

In reply to [email protected]

From: Oleg Drokin <[email protected]>

This code only made sense on servers.

---
 .../staging/lustre/lustre/include/lprocfs_status.h |   2 -
 drivers/staging/lustre/lustre/include/obd.h        |   1 -
 .../lustre/lustre/obdclass/lprocfs_status.c        | 182 ---------------------
 3 files changed, 185 deletions(-)
drivers/staging/lustre/lustre/include/lprocfs_status.h +0 -2
index 328cd07..4b8c265 100644
@@ -561,8 +561,6 @@ 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 dentry *ldebugfs_add_simple(struct dentry *root,
 					  char *name,
drivers/staging/lustre/lustre/include/obd.h +0 -1
index d3df9eb..5268ae5 100644
@@ -918,7 +918,6 @@ struct obd_device {
 	struct lprocfs_stats  *md_stats;
 
 	struct dentry		*obd_debugfs_entry;
-	struct proc_dir_entry  *obd_proc_exports_entry;
 	struct dentry		*obd_svc_debugfs_entry;
 	struct lprocfs_stats  *obd_svc_stats;
 	atomic_t	   obd_evict_inprogress;
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +0 -182

200 lines not on this page · raw message

Signature · 1 line
2.1.0
#5 lore raw

PATCH 5/6 staging/lustre/obd: Remove nid_stats tracking

In reply to [email protected]

From: Oleg Drokin <[email protected]>

This nid_stats tracking only makes sense on the server side, on the client there are no other clients to keep track of anyway.

---
 drivers/staging/lustre/lustre/include/dt_object.h  |  1 -
 .../staging/lustre/lustre/include/lprocfs_status.h | 15 ----
 drivers/staging/lustre/lustre/include/lu_object.h  |  2 -
 .../staging/lustre/lustre/include/lustre_export.h  | 29 -------
 drivers/staging/lustre/lustre/include/obd.h        |  3 -
 drivers/staging/lustre/lustre/include/obd_class.h  | 18 ----
 .../lustre/lustre/obdclass/lprocfs_status.c        | 96 ----------------------
 .../staging/lustre/lustre/obdclass/obd_config.c    | 80 ------------------
 8 files changed, 244 deletions(-)
drivers/staging/lustre/lustre/include/dt_object.h +0 -1
index be4c7d9..866d04b 100644
@@ -58,7 +58,6 @@
 #include "../../include/linux/libcfs/libcfs.h"
 
 struct seq_file;
-struct proc_dir_entry;
 struct lustre_cfg;
 
 struct thandle;
drivers/staging/lustre/lustre/include/lprocfs_status.h +0 -15
index 4b8c265..6a77ea8 100644
@@ -558,7 +558,6 @@ 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_cleanup(struct obd_export *exp);
@@ -573,11 +572,6 @@ extern struct proc_dir_entry *lprocfs_add_simple(struct proc_dir_entry *root,
 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 ldebugfs_register_stats(struct dentry *parent,
 				   const char *name,
@@ -909,15 +903,6 @@ 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 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,
drivers/staging/lustre/lustre/include/lu_object.h +0 -2
index c8cc48f..e1d72a7 100644
@@ -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;
drivers/staging/lustre/lustre/include/lustre_export.h +0 -29
index 9c06a49..3b992b4 100644
@@ -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;
drivers/staging/lustre/lustre/include/obd.h +0 -3
index 5268ae5..7067693 100644
@@ -845,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;
drivers/staging/lustre/lustre/include/obd_class.h +0 -18
index 98b397e..63f5224 100644
@@ -378,10 +378,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)				   \
@@ -418,20 +414,6 @@ static inline int obd_check_dev_active(struct obd_device *obd)
 #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 {							    \
 	if (!OBT(obd) || !MDP((obd), op)) {		     \
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +0 -96

110 lines not on this page · raw message

drivers/staging/lustre/lustre/obdclass/obd_config.c +0 -80

119 lines not on this page · raw message

Signature · 1 line
2.1.0
#6 lore raw

PATCH 6/6 staging/lustre/obd: final removal of procfs stuff

In reply to [email protected]

From: Dmitry Eremin <[email protected]>

---
 .../lustre/include/linux/libcfs/linux/libcfs.h     |   1 -
 drivers/staging/lustre/lustre/fid/Makefile         |   3 +-
 drivers/staging/lustre/lustre/fld/Makefile         |   3 +-
 drivers/staging/lustre/lustre/include/dt_object.h  |   2 -
 .../lustre/lustre/include/linux/lustre_lite.h      |   1 -
 drivers/staging/lustre/lustre/include/linux/obd.h  |  10 +-
 .../staging/lustre/lustre/include/lprocfs_status.h | 225 +------------------
 drivers/staging/lustre/lustre/include/lustre_fid.h |   3 -
 drivers/staging/lustre/lustre/include/lustre_fld.h |   4 -
 drivers/staging/lustre/lustre/include/lustre_net.h |   6 -
 .../staging/lustre/lustre/include/lustre_quota.h   | 241 ---------------------
 drivers/staging/lustre/lustre/include/obd_class.h  |  15 --
 .../staging/lustre/lustre/include/obd_support.h    |  41 ----
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |   2 +-
 drivers/staging/lustre/lustre/libcfs/module.c      |   1 -
 drivers/staging/lustre/lustre/llite/Makefile       |   3 +-
 .../staging/lustre/lustre/llite/llite_internal.h   |  21 --
 drivers/staging/lustre/lustre/llite/vvp_dev.c      |   2 +-
 drivers/staging/lustre/lustre/lmv/Makefile         |   3 +-
 drivers/staging/lustre/lustre/lmv/lmv_internal.h   |   8 +-
 drivers/staging/lustre/lustre/lov/Makefile         |   3 +-
 drivers/staging/lustre/lustre/lov/lov_internal.h   |   7 -
 drivers/staging/lustre/lustre/lov/lov_pool.c       |   2 -
 drivers/staging/lustre/lustre/mdc/Makefile         |   3 +-
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c      |   2 +-
 drivers/staging/lustre/lustre/mdc/mdc_internal.h   |   7 -
 drivers/staging/lustre/lustre/mgc/Makefile         |   3 +-
 drivers/staging/lustre/lustre/mgc/mgc_internal.h   |  11 -
 drivers/staging/lustre/lustre/mgc/mgc_request.c    |   2 -
 drivers/staging/lustre/lustre/obdclass/Makefile    |   4 +-
 drivers/staging/lustre/lustre/obdclass/class_obd.c |  37 ++--
 drivers/staging/lustre/lustre/obdclass/dt_object.c |   6 -
 .../lustre/lustre/obdclass/linux/linux-module.c    |   1 -
 .../lustre/lustre/obdclass/linux/linux-sysctl.c    |   1 -
 .../lustre/lustre/obdclass/lprocfs_status.c        | 153 +------------
 drivers/staging/lustre/lustre/obdclass/lu_object.c |   4 -
 drivers/staging/lustre/lustre/osc/Makefile         |   3 +-
 drivers/staging/lustre/lustre/osc/lproc_osc.c      |   4 +-
 drivers/staging/lustre/lustre/osc/osc_internal.h   |   8 -
 drivers/staging/lustre/lustre/ptlrpc/Makefile      |   3 +-
 .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c    |   5 +-
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |  12 -
 drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c   |   8 +-
 43 files changed, 54 insertions(+), 830 deletions(-)
 delete mode 100644 drivers/staging/lustre/lustre/include/lustre_quota.h
drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h +0 -1
index 4fe50841..3e2502a 100644
@@ -61,7 +61,6 @@
 #include <linux/moduleparam.h>
 #include <linux/mutex.h>
 #include <linux/notifier.h>
-#include <linux/proc_fs.h>
 #include <linux/random.h>
 #include <linux/rbtree.h>
 #include <linux/rwsem.h>
drivers/staging/lustre/lustre/fid/Makefile +1 -2
index 5513ce4..b7ef314 100644
@@ -1,3 +1,2 @@
 obj-$(CONFIG_LUSTRE_FS) += fid.o
-fid-y := fid_request.o fid_lib.o
-fid-$(CONFIG_PROC_FS) += lproc_fid.o
+fid-y := fid_request.o fid_lib.o lproc_fid.o
drivers/staging/lustre/lustre/fld/Makefile +1 -2
index 2bbf084..646e315 100644
@@ -1,3 +1,2 @@
 obj-$(CONFIG_LUSTRE_FS) += fld.o
-fld-y := fld_request.o fld_cache.o
-fld-$(CONFIG_PROC_FS) += lproc_fld.o
+fld-y := fld_request.o fld_cache.o lproc_fld.o
drivers/staging/lustre/lustre/include/dt_object.h +0 -2
index 866d04b..abae31b 100644
@@ -1480,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,
@@ -1493,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 */
drivers/staging/lustre/lustre/include/linux/lustre_lite.h +0 -1
index a7658a9..45651ca 100644
@@ -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"
drivers/staging/lustre/lustre/include/linux/obd.h +5 -5
index 9cd8683..2817e88 100644
@@ -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 {
drivers/staging/lustre/lustre/include/lprocfs_status.h +8 -217

291 lines not on this page · raw message

drivers/staging/lustre/lustre/include/lustre_fid.h +0 -3
index 0592f2b..c7c8fe4 100644
@@ -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;
 
drivers/staging/lustre/lustre/include/lustre_fld.h +0 -4
index 588cdd5..c1f08de 100644
@@ -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;
 
drivers/staging/lustre/lustre/include/lustre_net.h +0 -6
index e65e7d8..998dcd9 100644
@@ -2952,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 */
drivers/staging/lustre/lustre/include/lustre_quota.h deleted +0 -241

241 lines not on this page · raw message

drivers/staging/lustre/lustre/include/obd_class.h +0 -15
index 63f5224..36ed781 100644
@@ -139,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 */
@@ -356,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))		\
@@ -406,13 +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
 
 #define OBD_CHECK_MD_OP(obd, op, err)			   \
 do {							    \
drivers/staging/lustre/lustre/include/obd_support.h +0 -41

53 lines not on this page · raw message

drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +1 -1
index 50e049b..cdb6366 100644
@@ -955,7 +955,7 @@ void ldlm_namespace_free_post(struct ldlm_namespace *ns)
  * proc1: destroy import
  *	class_disconnect_export(grab cl_sem) ->
  *	      -> ldlm_namespace_free ->
- *	      -> lprocfs_remove(grab _lprocfs_lock).
+ *	      -> ldebugfs_remove(grab _lprocfs_lock).
  * proc2: read proc info
  *	lprocfs_fops_read(grab _lprocfs_lock) ->
  *	      -> osc_rd_active, etc(grab cl_sem).
drivers/staging/lustre/lustre/libcfs/module.c +0 -1
index f0ee76a..83b1a70 100644
@@ -49,7 +49,6 @@
 #include <linux/file.h>
 #include <linux/list.h>
 
-#include <linux/proc_fs.h>
 #include <linux/sysctl.h>
 
 # define DEBUG_SUBSYSTEM S_LNET
drivers/staging/lustre/lustre/llite/Makefile +1 -2
index 7d70115..2cbc468 100644
@@ -5,7 +5,6 @@ lustre-y := dcache.o dir.o file.o llite_close.o llite_lib.o llite_nfs.o \
 	    xattr.o xattr_cache.o remote_perm.o llite_rmtacl.o llite_capa.o \
 	    rw26.o super25.o statahead.o \
 	    ../lclient/glimpse.o ../lclient/lcommon_cl.o ../lclient/lcommon_misc.o \
-	    vvp_dev.o vvp_page.o vvp_lock.o vvp_io.o vvp_object.o
+	    vvp_dev.o vvp_page.o vvp_lock.o vvp_io.o vvp_object.o lproc_llite.o
 
-lustre-$(CONFIG_PROC_FS) += lproc_llite.o
 llite_lloop-y := lloop.o
drivers/staging/lustre/lustre/llite/llite_internal.h +0 -21
index b30eb85..f097d4d 100644
@@ -663,7 +663,6 @@ void ll_ra_read_ex(struct file *f, struct ll_ra_read *rar);
 struct ll_ra_read *ll_ra_read_get(struct file *f);
 
 /* llite/lproc_llite.c */
-#if defined (CONFIG_PROC_FS)
 int ldebugfs_register_mountpoint(struct dentry *parent,
 				 struct super_block *sb, char *osc, char *mdc);
 void ldebugfs_unregister_mountpoint(struct ll_sb_info *sbi);
@@ -672,26 +671,6 @@ void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars);
 void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
 		       struct ll_file_data *file, loff_t pos,
 		       size_t count, int rw);
-#else /* CONFIG_PROC_FS */
-static inline
-int ldebugfs_register_mountpoint(struct dentry *parent,
-				 struct super_block *sb, char *osc, char *mdc)
-{ return 0; }
-static inline
-void ldebugfs_unregister_mountpoint(struct ll_sb_info *sbi)
-{}
-static inline
-void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count)
-{}
-static inline void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars)
-{
-	memset(lvars, 0, sizeof(*lvars));
-}
-static inline void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
-				     struct ll_file_data *file, loff_t pos,
-				     size_t count, int rw) {}
-#endif /* CONFIG_PROC_FS */
-
 
 /* llite/dir.c */
 void ll_release_page(struct page *page, int remove);
drivers/staging/lustre/lustre/llite/vvp_dev.c +1 -1
index 6d9622a..2aae5f5 100644
@@ -534,7 +534,7 @@ static int vvp_dump_pgcache_seq_open(struct inode *inode, struct file *filp)
 		return rc;
 
 	seq = filp->private_data;
-	seq->private = inode->i_private ?: PDE_DATA(inode);
+	seq->private = inode->i_private;
 
 	return 0;
 }
drivers/staging/lustre/lustre/lmv/Makefile +1 -2
index a7a1536..1a24299 100644
@@ -1,3 +1,2 @@
 obj-$(CONFIG_LUSTRE_FS) += lmv.o
-lmv-y := lmv_obd.o lmv_intent.o lmv_fld.o
-lmv-$(CONFIG_PROC_FS) += lproc_lmv.o
+lmv-y := lmv_obd.o lmv_intent.o lmv_fld.o lproc_lmv.o
drivers/staging/lustre/lustre/lmv/lmv_internal.h +1 -7
index 852d787..b808728 100644
@@ -144,14 +144,8 @@ struct lmv_tgt_desc
 *lmv_locate_mds(struct lmv_obd *lmv, struct md_op_data *op_data,
 		struct lu_fid *fid);
 /* lproc_lmv.c */
-#if defined(CONFIG_PROC_FS)
 void lprocfs_lmv_init_vars(struct lprocfs_static_vars *lvars);
-#else
-static inline void lprocfs_lmv_init_vars(struct lprocfs_static_vars *lvars)
-{
-	memset(lvars, 0, sizeof(*lvars));
-}
-#endif
+
 extern struct file_operations lmv_proc_target_fops;
 
 #endif
drivers/staging/lustre/lustre/lov/Makefile +1 -2
index 6fe56a2..e4cc0db 100644
@@ -2,5 +2,4 @@ obj-$(CONFIG_LUSTRE_FS) += lov.o
 lov-y := lov_obd.o lov_pack.o lov_offset.o lov_merge.o \
 	 lov_request.o lov_ea.o lov_dev.o lov_object.o lov_page.o  \
 	 lov_lock.o lov_io.o lovsub_dev.o lovsub_object.o lovsub_page.o      \
-	 lovsub_lock.o lovsub_io.o lov_pool.o
-lov-$(CONFIG_PROC_FS) += lproc_lov.o
+	 lovsub_lock.o lovsub_io.o lov_pool.o lproc_lov.o
drivers/staging/lustre/lustre/lov/lov_internal.h +0 -7
index b644acc..5e8bcc6 100644
@@ -265,15 +265,8 @@ void lsm_free_plain(struct lov_stripe_md *lsm);
 void dump_lsm(unsigned int level, const struct lov_stripe_md *lsm);
 
 /* lproc_lov.c */
-#if defined (CONFIG_PROC_FS)
 extern const struct file_operations lov_proc_target_fops;
 void lprocfs_lov_init_vars(struct lprocfs_static_vars *lvars);
-#else
-static inline void lprocfs_lov_init_vars(struct lprocfs_static_vars *lvars)
-{
-	memset(lvars, 0, sizeof(*lvars));
-}
-#endif
 
 /* lov_cl.c */
 extern struct lu_device_type lov_device_type;
drivers/staging/lustre/lustre/lov/lov_pool.c +0 -2
index 30a29fd..3c46c36 100644
@@ -152,7 +152,6 @@ cfs_hash_ops_t pool_hash_operations = {
 
 };
 
-#if defined (CONFIG_PROC_FS)
 /* ifdef needed for liblustre support */
 /*
  * pool /proc seq_file methods
@@ -294,7 +293,6 @@ static struct file_operations pool_proc_operations = {
 	.llseek	 = seq_lseek,
 	.release	= seq_release,
 };
-#endif /* CONFIG_PROC_FS */
 
 void lov_dump_pool(int level, struct pool_desc *pool)
 {
drivers/staging/lustre/lustre/mdc/Makefile +1 -2
index 2516551..99ba9ff 100644
@@ -1,3 +1,2 @@
 obj-$(CONFIG_LUSTRE_FS) += mdc.o
-mdc-y := mdc_request.o mdc_reint.o mdc_lib.o mdc_locks.o
-mdc-$(CONFIG_PROC_FS) += lproc_mdc.o
+mdc-y := mdc_request.o mdc_reint.o mdc_lib.o mdc_locks.o lproc_mdc.o
drivers/staging/lustre/lustre/mdc/lproc_mdc.c +1 -1
index 858d568..1c95f87 100644
@@ -84,7 +84,7 @@ LUSTRE_RW_ATTR(max_rpcs_in_flight);
 
 static int mdc_kuc_open(struct inode *inode, struct file *file)
 {
-	return single_open(file, NULL, inode->i_private ?: PDE_DATA(inode));
+	return single_open(file, NULL, inode->i_private);
 }
 
 /* temporary for testing */
drivers/staging/lustre/lustre/mdc/mdc_internal.h +0 -7
index 81780c9..4d14943 100644
@@ -40,14 +40,7 @@
 #include "../include/lustre_mdc.h"
 #include "../include/lustre_mds.h"
 
-#if defined CONFIG_PROC_FS
 void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars);
-#else
-static inline void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars)
-{
-	memset(lvars, 0, sizeof(*lvars));
-}
-#endif
 
 void mdc_pack_body(struct ptlrpc_request *req, const struct lu_fid *fid,
 		   struct obd_capa *oc, __u64 valid, int ea_size,
drivers/staging/lustre/lustre/mgc/Makefile +1 -2
index cc6e9f5..8ea29a8 100644
@@ -1,3 +1,2 @@
 obj-$(CONFIG_LUSTRE_FS) += mgc.o
-mgc-y := mgc_request.o
-mgc-$(CONFIG_PROC_FS) += lproc_mgc.o
+mgc-y := mgc_request.o lproc_mgc.o
drivers/staging/lustre/lustre/mgc/mgc_internal.h +0 -11
index a6f8b3c..82fb8f4 100644
@@ -44,19 +44,8 @@
 #include "../include/lustre_log.h"
 #include "../include/lustre_export.h"
 
-#if defined (CONFIG_PROC_FS)
 void lprocfs_mgc_init_vars(struct lprocfs_static_vars *lvars);
 int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data);
-#else
-static inline void lprocfs_mgc_init_vars(struct lprocfs_static_vars *lvars)
-{
-	memset(lvars, 0, sizeof(*lvars));
-}
-static inline int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
-{
-	return 0;
-}
-#endif  /* CONFIG_PROC_FS */
 
 int mgc_process_log(struct obd_device *mgc, struct config_llog_data *cld);
 
drivers/staging/lustre/lustre/mgc/mgc_request.c +0 -2
index 91dbb08..c3e4334 100644
@@ -448,7 +448,6 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg)
 	return rc;
 }
 
-#if defined (CONFIG_PROC_FS)
 int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
 {
 	struct obd_device       *obd = data;
@@ -477,7 +476,6 @@ int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data)
 	LPROCFS_CLIMP_EXIT(obd);
 	return 0;
 }
-#endif
 
 /* reenqueue any lost locks */
 #define RQ_RUNNING 0x1
drivers/staging/lustre/lustre/obdclass/Makefile +1 -3
index e894681..d0f70b4 100644
@@ -6,6 +6,4 @@ obdclass-y := linux/linux-module.o linux/linux-obdo.o linux/linux-sysctl.o \
 	      lustre_handles.o lustre_peer.o \
 	      statfs_pack.o obdo.o obd_config.o obd_mount.o \
 	      lu_object.o dt_object.o capa.o cl_object.o   \
-	      cl_page.o cl_lock.o cl_io.o lu_ref.o acl.o
-
-obdclass-$(CONFIG_PROC_FS) += lprocfs_counters.o
+	      cl_page.o cl_lock.o cl_io.o lu_ref.o acl.o lprocfs_counters.o
drivers/staging/lustre/lustre/obdclass/class_obd.c +13 -24
index 6e967af..1bc3756 100644
@@ -506,15 +506,8 @@ int obd_init_checks(void)
 	return ret;
 }
 
-#if defined (CONFIG_PROC_FS)
 extern int class_procfs_init(void);
 extern int class_procfs_clean(void);
-#else
-static inline int class_procfs_init(void)
-{ return 0; }
-static inline int class_procfs_clean(void)
-{ return 0; }
-#endif
 
 static int __init init_obdclass(void)
 {
@@ -529,24 +522,22 @@ static int __init init_obdclass(void)
 	spin_lock_init(&obd_types_lock);
 	obd_zombie_impexp_init();
 
-	if (IS_ENABLED(CONFIG_PROC_FS)) {
-		obd_memory = lprocfs_alloc_stats(OBD_STATS_NUM,
-						 LPROCFS_STATS_FLAG_NONE |
-						 LPROCFS_STATS_FLAG_IRQ_SAFE);
+	obd_memory = lprocfs_alloc_stats(OBD_STATS_NUM,
+					 LPROCFS_STATS_FLAG_NONE |
+					 LPROCFS_STATS_FLAG_IRQ_SAFE);
 
-		if (obd_memory == NULL) {
-			CERROR("kmalloc of 'obd_memory' failed\n");
-			return -ENOMEM;
-		}
-
-		lprocfs_counter_init(obd_memory, OBD_MEMORY_STAT,
-				     LPROCFS_CNTR_AVGMINMAX,
-				     "memused", "bytes");
-		lprocfs_counter_init(obd_memory, OBD_MEMORY_PAGES_STAT,
-				     LPROCFS_CNTR_AVGMINMAX,
-				     "pagesused", "pages");
+	if (obd_memory == NULL) {
+		CERROR("kmalloc of 'obd_memory' failed\n");
+		return -ENOMEM;
 	}
 
+	lprocfs_counter_init(obd_memory, OBD_MEMORY_STAT,
+			     LPROCFS_CNTR_AVGMINMAX,
+			     "memused", "bytes");
+	lprocfs_counter_init(obd_memory, OBD_MEMORY_PAGES_STAT,
+			     LPROCFS_CNTR_AVGMINMAX,
+			     "pagesused", "pages");
+
 	err = obd_init_checks();
 	if (err == -EOVERFLOW)
 		return err;
@@ -620,7 +611,6 @@ void obd_update_maxusage(void)
 }
 EXPORT_SYMBOL(obd_update_maxusage);
 
-#if defined (CONFIG_PROC_FS)
 __u64 obd_memory_max(void)
 {
 	__u64 ret;
@@ -644,7 +634,6 @@ __u64 obd_pages_max(void)
 	return ret;
 }
 EXPORT_SYMBOL(obd_pages_max);
-#endif
 
 /* liblustre doesn't call cleanup_obdclass, apparently.  we carry on in this
  * ifdef to the end of the file to cover module and versioning goo.*/
drivers/staging/lustre/lustre/obdclass/dt_object.c +0 -6
index b1eee0a..6ce407f 100644
@@ -49,8 +49,6 @@
 /* fid_be_to_cpu() */
 #include "../include/lustre_fid.h"
 
-#include "../include/lustre_quota.h"
-
 /* context key constructor/destructor: dt_global_key_init, dt_global_key_fini */
 LU_KEY_INIT(dt_global, struct dt_thread_info);
 LU_KEY_FINI(dt_global, struct dt_thread_info);
@@ -939,8 +937,6 @@ out:
 }
 EXPORT_SYMBOL(dt_index_read);
 
-#if defined (CONFIG_PROC_FS)
-
 int lprocfs_dt_rd_blksize(char *page, char **start, off_t off,
 			  int count, int *eof, void *data)
 {
@@ -1055,5 +1051,3 @@ int lprocfs_dt_rd_filesfree(char *page, char **start, off_t off,
 	return rc;
 }
 EXPORT_SYMBOL(lprocfs_dt_rd_filesfree);
-
-#endif /* CONFIG_PROC_FS */
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +0 -1
index 50c3d1d..e3c6dcb 100644
@@ -53,7 +53,6 @@
 #include <linux/fcntl.h>
 #include <linux/delay.h>
 #include <linux/skbuff.h>
-#include <linux/proc_fs.h>
 #include <linux/fs.h>
 #include <linux/poll.h>
 #include <linux/list.h>
drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c +0 -1
index 8927e24..54f0a81 100644
@@ -38,7 +38,6 @@
 #include <linux/sysctl.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
-#include <linux/proc_fs.h>
 #include <linux/slab.h>
 #include <linux/stat.h>
 #include <linux/ctype.h>
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +7 -146

211 lines not on this page · raw message

drivers/staging/lustre/lustre/obdclass/lu_object.c +0 -4
index 4458faa..eae6606 100644
@@ -1989,14 +1989,10 @@ void lu_global_fini(void)
 
 static __u32 ls_stats_read(struct lprocfs_stats *stats, int idx)
 {
-#if defined (CONFIG_PROC_FS)
 	struct lprocfs_counter ret;
 
 	lprocfs_stats_collect(stats, idx, &ret);
 	return (__u32)ret.lc_count;
-#else
-	return 0;
-#endif
 }
 
 /**
drivers/staging/lustre/lustre/osc/Makefile +1 -2
index 54927fb..37cdeea 100644
@@ -1,4 +1,3 @@
 obj-$(CONFIG_LUSTRE_FS) += osc.o
 osc-y := osc_request.o osc_dev.o osc_object.o \
-	 osc_page.o osc_lock.o osc_io.o osc_quota.o osc_cache.o
-osc-$(CONFIG_PROC_FS) += lproc_osc.o
+	 osc_page.o osc_lock.o osc_io.o osc_quota.o osc_cache.o lproc_osc.o
drivers/staging/lustre/lustre/osc/lproc_osc.c +2 -2
index 0ba2c36..9dc84ba 100644
@@ -741,8 +741,8 @@ int lproc_osc_attach_seqstat(struct obd_device *dev)
 	rc = ldebugfs_seq_create(dev->obd_debugfs_entry, "osc_stats", 0644,
 				 &osc_stats_fops, dev);
 	if (rc == 0)
-		rc = lprocfs_obd_seq_create(dev, "rpc_stats", 0644,
-					    &osc_rpc_stats_fops, dev);
+		rc = ldebugfs_obd_seq_create(dev, "rpc_stats", 0644,
+					     &osc_rpc_stats_fops, dev);
 
 	return rc;
 }
drivers/staging/lustre/lustre/osc/osc_internal.h +0 -8
index af96c7b..470698b 100644
@@ -136,16 +136,8 @@ extern spinlock_t osc_ast_guard;
 int osc_cleanup(struct obd_device *obd);
 int osc_setup(struct obd_device *obd, struct lustre_cfg *lcfg);
 
-#if defined (CONFIG_PROC_FS)
 int lproc_osc_attach_seqstat(struct obd_device *dev);
 void lprocfs_osc_init_vars(struct lprocfs_static_vars *lvars);
-#else
-static inline int lproc_osc_attach_seqstat(struct obd_device *dev) {return 0;}
-static inline void lprocfs_osc_init_vars(struct lprocfs_static_vars *lvars)
-{
-	memset(lvars, 0, sizeof(*lvars));
-}
-#endif
 
 extern struct lu_device_type osc_device_type;
 
drivers/staging/lustre/lustre/ptlrpc/Makefile +1 -2
index fb50cd4..24bbac1 100644
@@ -15,6 +15,5 @@ ptlrpc_objs += pers.o lproc_ptlrpc.o wiretest.o layout.o
 ptlrpc_objs += sec.o sec_bulk.o sec_gc.o sec_config.o
 ptlrpc_objs += sec_null.o sec_plain.o nrs.o nrs_fifo.o
 
-ptlrpc-y := $(ldlm_objs) $(ptlrpc_objs)
-ptlrpc-$(CONFIG_PROC_FS) += sec_lproc.o
+ptlrpc-y := $(ldlm_objs) $(ptlrpc_objs) sec_lproc.o
 ptlrpc-$(CONFIG_LUSTRE_TRANSLATE_ERRNOS) += errno.o
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +1 -4
index cf5196a..1362160 100644
@@ -256,7 +256,6 @@ ptlrpc_ldebugfs_register(struct dentry *root, char *dir,
 	}
 }
 
-#if defined(CONFIG_PROC_FS)
 static int
 ptlrpc_lprocfs_req_history_len_seq_show(struct seq_file *m, void *v)
 {
@@ -1237,7 +1236,7 @@ int lprocfs_wr_evict_client(struct file *file, const char __user *buffer,
 	/* Kludge code(deadlock situation): the lprocfs lock has been held
 	 * since the client is evicted by writing client's
 	 * uuid/nid to procfs "evict_client" entry. However,
-	 * obd_export_evict_by_uuid() will call lprocfs_remove() to destroy
+	 * obd_export_evict_by_uuid() will call ldebugfs_remove() to destroy
 	 * the proc entries under the being destroyed export{}, so I have
 	 * to drop the lock at first here.
 	 * - jay, [email protected] */
@@ -1390,5 +1389,3 @@ int lprocfs_wr_pinger_recov(struct file *file, const char __user *buffer,
 
 }
 EXPORT_SYMBOL(lprocfs_wr_pinger_recov);
-
-#endif /* CONFIG_PROC_FS */
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +0 -12
index 9f9ef9a..6dc3998 100644
@@ -82,16 +82,10 @@ void ptlrpc_sysfs_unregister_service(struct ptlrpc_service *svc);
 
 void ptlrpc_ldebugfs_register_service(struct dentry *debugfs_entry,
 				      struct ptlrpc_service *svc);
-#if defined(CONFIG_PROC_FS)
 void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc);
 void ptlrpc_lprocfs_rpc_sent(struct ptlrpc_request *req, long amount);
 void ptlrpc_lprocfs_do_request_stat(struct ptlrpc_request *req,
 				     long q_usec, long work_usec);
-#else
-#define ptlrpc_lprocfs_unregister_service(params...) do {} while (0)
-#define ptlrpc_lprocfs_rpc_sent(params...) do {} while (0)
-#define ptlrpc_lprocfs_do_request_stat(params...) do {} while (0)
-#endif /* CONFIG_PROC_FS */
 
 /* NRS */
 
@@ -266,14 +260,8 @@ void sptlrpc_enc_pool_fini(void);
 int sptlrpc_proc_enc_pool_seq_show(struct seq_file *m, void *v);
 
 /* sec_lproc.c */
-#if defined(CONFIG_PROC_FS)
 int  sptlrpc_lproc_init(void);
 void sptlrpc_lproc_fini(void);
-#else
-static inline int sptlrpc_lproc_init(void)
-{ return 0; }
-static inline void sptlrpc_lproc_fini(void) {}
-#endif
 
 /* sec_gc.c */
 int sptlrpc_gc_init(void);
drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c +4 -4
index 549515d..982512f 100644
@@ -144,16 +144,16 @@ int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev)
 		return -EINVAL;
 	}
 
-	rc = lprocfs_obd_seq_create(dev, "srpc_info", 0444,
-				    &sptlrpc_info_lprocfs_fops, dev);
+	rc = ldebugfs_obd_seq_create(dev, "srpc_info", 0444,
+				     &sptlrpc_info_lprocfs_fops, dev);
 	if (rc) {
 		CERROR("create proc entry srpc_info for %s: %d\n",
 		       dev->obd_name, rc);
 		return rc;
 	}
 
-	rc = lprocfs_obd_seq_create(dev, "srpc_contexts", 0444,
-				    &sptlrpc_ctxs_lprocfs_fops, dev);
+	rc = ldebugfs_obd_seq_create(dev, "srpc_contexts", 0444,
+				     &sptlrpc_ctxs_lprocfs_fops, dev);
 	if (rc) {
 		CERROR("create proc entry srpc_contexts for %s: %d\n",
 		       dev->obd_name, rc);
Signature · 1 line
2.1.0