public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Final part of lustre procfs removal series
@ 2015-05-31  3:26 green
  2015-05-31  3:27 ` [PATCH 1/6] staging/lustre/llite: Move all remaining procfs entries to debugfs green
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: green @ 2015-05-31  3:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Oleg Drokin

From: Oleg Drokin <green@linuxhacker.ru>

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

-- 
2.1.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/6] staging/lustre/llite: Move all remaining procfs entries to debugfs
  2015-05-31  3:26 [PATCH 0/6] Final part of lustre procfs removal series green
@ 2015-05-31  3:27 ` green
  2015-05-31  3:27 ` [PATCH 2/6] staging/lustre/obd: remove unused proc_lustre_root green
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: green @ 2015-05-31  3:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Oleg Drokin, Dmitry Eremin,
	Oleg Drokin

From: Oleg Drokin <green@linuxhacker.ru>

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

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
---
 .../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(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index e180912..b30eb85 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -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 */
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 4c9fd4a..2513988 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -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);
diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c
index 2c84bed..486dca6 100644
--- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
+++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
@@ -950,12 +950,13 @@ static const char *ra_stat_string[] = {
 	[RA_STAT_WRONG_GRAB_PAGE] = "wrong page from grab_cache_page",
 };
 
-int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
-				struct super_block *sb, char *osc, char *mdc)
+int ldebugfs_register_mountpoint(struct dentry *parent,
+				 struct super_block *sb, char *osc, char *mdc)
 {
 	struct lustre_sb_info *lsi = s2lsi(sb);
 	struct ll_sb_info *sbi = ll_s2sbi(sb);
 	struct obd_device *obd;
+	struct dentry *dir;
 	char name[MAX_STRING_SIZE + 1], *ptr;
 	int err, id, len, rc;
 
@@ -976,30 +977,32 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
 	snprintf(name, MAX_STRING_SIZE, "%.*s-%p", len,
 		 lsi->lsi_lmd->lmd_profile, sb);
 
-	sbi->ll_proc_root = lprocfs_register(name, parent, NULL, NULL);
-	if (IS_ERR(sbi->ll_proc_root)) {
-		err = PTR_ERR(sbi->ll_proc_root);
-		sbi->ll_proc_root = NULL;
+	dir = ldebugfs_register(name, parent, NULL, NULL);
+	if (IS_ERR_OR_NULL(dir)) {
+		err = dir ? PTR_ERR(dir) : -ENOMEM;
+		sbi->ll_debugfs_entry = NULL;
 		return err;
 	}
+	sbi->ll_debugfs_entry = dir;
 
-	rc = lprocfs_seq_create(sbi->ll_proc_root, "dump_page_cache", 0444,
-				&vvp_dump_pgcache_file_ops, sbi);
+	rc = ldebugfs_seq_create(sbi->ll_debugfs_entry, "dump_page_cache", 0444,
+				 &vvp_dump_pgcache_file_ops, sbi);
 	if (rc)
 		CWARN("Error adding the dump_page_cache file\n");
 
-	rc = lprocfs_seq_create(sbi->ll_proc_root, "extents_stats", 0644,
-				&ll_rw_extents_stats_fops, sbi);
+	rc = ldebugfs_seq_create(sbi->ll_debugfs_entry, "extents_stats", 0644,
+				 &ll_rw_extents_stats_fops, sbi);
 	if (rc)
 		CWARN("Error adding the extent_stats file\n");
 
-	rc = lprocfs_seq_create(sbi->ll_proc_root, "extents_stats_per_process",
-				0644, &ll_rw_extents_stats_pp_fops, sbi);
+	rc = ldebugfs_seq_create(sbi->ll_debugfs_entry,
+				  "extents_stats_per_process",
+				 0644, &ll_rw_extents_stats_pp_fops, sbi);
 	if (rc)
 		CWARN("Error adding the extents_stats_per_process file\n");
 
-	rc = lprocfs_seq_create(sbi->ll_proc_root, "offset_stats", 0644,
-				&ll_rw_offset_stats_fops, sbi);
+	rc = ldebugfs_seq_create(sbi->ll_debugfs_entry, "offset_stats", 0644,
+				 &ll_rw_offset_stats_fops, sbi);
 	if (rc)
 		CWARN("Error adding the offset_stats file\n");
 
@@ -1025,7 +1028,8 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
 				     (type & LPROCFS_CNTR_AVGMINMAX),
 				     llite_opcode_table[id].opname, ptr);
 	}
-	err = lprocfs_register_stats(sbi->ll_proc_root, "stats", sbi->ll_stats);
+	err = ldebugfs_register_stats(sbi->ll_debugfs_entry, "stats",
+				     sbi->ll_stats);
 	if (err)
 		goto out;
 
@@ -1039,13 +1043,15 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
 	for (id = 0; id < ARRAY_SIZE(ra_stat_string); id++)
 		lprocfs_counter_init(sbi->ll_ra_stats, id, 0,
 				     ra_stat_string[id], "pages");
-	err = lprocfs_register_stats(sbi->ll_proc_root, "read_ahead_stats",
+
+	err = ldebugfs_register_stats(sbi->ll_debugfs_entry, "read_ahead_stats",
 				     sbi->ll_ra_stats);
 	if (err)
 		goto out;
 
 
-	err = lprocfs_add_vars(sbi->ll_proc_root, lprocfs_llite_obd_vars, sb);
+	err = ldebugfs_add_vars(sbi->ll_debugfs_entry,
+				lprocfs_llite_obd_vars, sb);
 	if (err)
 		goto out;
 
@@ -1071,17 +1077,17 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
 				obd->obd_type->typ_name);
 out:
 	if (err) {
-		lprocfs_remove(&sbi->ll_proc_root);
+		ldebugfs_remove(&sbi->ll_debugfs_entry);
 		lprocfs_free_stats(&sbi->ll_ra_stats);
 		lprocfs_free_stats(&sbi->ll_stats);
 	}
 	return err;
 }
 
-void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi)
+void ldebugfs_unregister_mountpoint(struct ll_sb_info *sbi)
 {
-	if (sbi->ll_proc_root) {
-		lprocfs_remove(&sbi->ll_proc_root);
+	if (sbi->ll_debugfs_entry) {
+		ldebugfs_remove(&sbi->ll_debugfs_entry);
 		kobject_put(&sbi->ll_kobj);
 		wait_for_completion(&sbi->ll_kobj_unregister);
 		lprocfs_free_stats(&sbi->ll_ra_stats);
diff --git a/drivers/staging/lustre/lustre/llite/super25.c b/drivers/staging/lustre/lustre/llite/super25.c
index 8753560..e4020ce 100644
--- a/drivers/staging/lustre/lustre/llite/super25.c
+++ b/drivers/staging/lustre/lustre/llite/super25.c
@@ -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();
diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c
index fde41d7..6d9622a 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_dev.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c
@@ -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 = {
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/6] staging/lustre/obd: remove unused proc_lustre_root
  2015-05-31  3:26 [PATCH 0/6] Final part of lustre procfs removal series green
  2015-05-31  3:27 ` [PATCH 1/6] staging/lustre/llite: Move all remaining procfs entries to debugfs green
@ 2015-05-31  3:27 ` green
  2015-05-31  3:27 ` [PATCH 3/6] staging/lustre/obd: Rename lprocfs_add_symlink to ldebugfs_add_symlink green
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: green @ 2015-05-31  3:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Dmitry Eremin

From: Dmitry Eremin <dmiter4ever@gmail.com>

Signed-off-by: Dmitry Eremin <dmiter4ever@gmail.com>
---
 drivers/staging/lustre/lustre/include/lprocfs_status.h |  3 ---
 .../lustre/lustre/obdclass/linux/linux-module.c        | 18 ------------------
 2 files changed, 21 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 721efd6..19ab9e8 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -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; }
diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 03a982a..50c3d1d 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -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 */
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/6] staging/lustre/obd: Rename lprocfs_add_symlink to ldebugfs_add_symlink
  2015-05-31  3:26 [PATCH 0/6] Final part of lustre procfs removal series green
  2015-05-31  3:27 ` [PATCH 1/6] staging/lustre/llite: Move all remaining procfs entries to debugfs green
  2015-05-31  3:27 ` [PATCH 2/6] staging/lustre/obd: remove unused proc_lustre_root green
@ 2015-05-31  3:27 ` green
  2015-05-31  3:27 ` [PATCH 4/6] staging/lustre/obd: remove unused lprocfs_exp_setup() and related functions green
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: green @ 2015-05-31  3:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Oleg Drokin, Dmitry Eremin

From: Oleg Drokin <green@linuxhacker.ru>

Signed-off-by: Dmitry Eremin <dmiter4ever@gmail.com>
---
 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(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 19ab9e8..328cd07 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -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
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index 51865dd..79ff72c 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -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 = { };
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/6] staging/lustre/obd: remove unused lprocfs_exp_setup() and related functions
  2015-05-31  3:26 [PATCH 0/6] Final part of lustre procfs removal series green
                   ` (2 preceding siblings ...)
  2015-05-31  3:27 ` [PATCH 3/6] staging/lustre/obd: Rename lprocfs_add_symlink to ldebugfs_add_symlink green
@ 2015-05-31  3:27 ` green
  2015-05-31  3:27 ` [PATCH 5/6] staging/lustre/obd: Remove nid_stats tracking green
  2015-05-31  3:27 ` [PATCH 6/6] staging/lustre/obd: final removal of procfs stuff green
  5 siblings, 0 replies; 7+ messages in thread
From: green @ 2015-05-31  3:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Oleg Drokin, Dmitry Eremin,
	Oleg Drokin

From: Oleg Drokin <green@linuxhacker.ru>

This code only made sense on servers.

Signed-off-by: Dmitry Eremin <dmiter4ever@gmail.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
---
 .../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(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 328cd07..4b8c265 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -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,
diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
index d3df9eb..5268ae5 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -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;
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index 79ff72c..3ef5474 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1096,12 +1096,6 @@ int lprocfs_obd_cleanup(struct obd_device *obd)
 	if (!obd)
 		return -EINVAL;
 
-	if (obd->obd_proc_exports_entry) {
-		/* Should be no exports left */
-		lprocfs_remove(&obd->obd_proc_exports_entry);
-		obd->obd_proc_exports_entry = NULL;
-	}
-
 	if (!IS_ERR_OR_NULL(obd->obd_debugfs_entry))
 		ldebugfs_remove(&obd->obd_debugfs_entry);
 
@@ -1685,72 +1679,6 @@ void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats)
 }
 EXPORT_SYMBOL(lprocfs_init_ldlm_stats);
 
-int lprocfs_exp_print_uuid(struct cfs_hash *hs, struct cfs_hash_bd *bd,
-			   struct hlist_node *hnode, void *data)
-
-{
-	struct obd_export *exp = cfs_hash_object(hs, hnode);
-	struct seq_file *m = (struct seq_file *)data;
-
-	if (exp->exp_nid_stats)
-		seq_printf(m, "%s\n", obd_uuid2str(&exp->exp_client_uuid));
-
-	return 0;
-}
-
-static int
-lproc_exp_uuid_seq_show(struct seq_file *m, void *unused)
-{
-	struct nid_stat *stats = (struct nid_stat *)m->private;
-	struct obd_device *obd = stats->nid_obd;
-
-	cfs_hash_for_each_key(obd->obd_nid_hash, &stats->nid,
-			      lprocfs_exp_print_uuid, m);
-	return 0;
-}
-
-LPROC_SEQ_FOPS_RO(lproc_exp_uuid);
-
-struct exp_hash_cb_data {
-	struct seq_file *m;
-	bool		first;
-};
-
-int lprocfs_exp_print_hash(struct cfs_hash *hs, struct cfs_hash_bd *bd,
-			   struct hlist_node *hnode, void *cb_data)
-
-{
-	struct exp_hash_cb_data *data = (struct exp_hash_cb_data *)cb_data;
-	struct obd_export       *exp = cfs_hash_object(hs, hnode);
-
-	if (exp->exp_lock_hash != NULL) {
-		if (data->first) {
-			cfs_hash_debug_header(data->m);
-			data->first = false;
-		}
-		cfs_hash_debug_str(hs, data->m);
-	}
-
-	return 0;
-}
-
-static int
-lproc_exp_hash_seq_show(struct seq_file *m, void *unused)
-{
-	struct nid_stat *stats = (struct nid_stat *)m->private;
-	struct obd_device *obd = stats->nid_obd;
-	struct exp_hash_cb_data cb_data = {
-		.m = m,
-		.first = true
-	};
-
-	cfs_hash_for_each_key(obd->obd_nid_hash, &stats->nid,
-			      lprocfs_exp_print_hash, &cb_data);
-	return 0;
-}
-
-LPROC_SEQ_FOPS_RO(lproc_exp_hash);
-
 int lprocfs_nid_stats_clear_read(struct seq_file *m, void *data)
 {
 	seq_printf(m, "%s\n",
@@ -1799,116 +1727,6 @@ int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
 }
 EXPORT_SYMBOL(lprocfs_nid_stats_clear_write);
 
-int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
-{
-	struct nid_stat *new_stat, *old_stat;
-	struct obd_device *obd = NULL;
-	struct proc_dir_entry *entry;
-	char *buffer = NULL;
-	int rc = 0;
-
-	*newnid = 0;
-
-	if (!exp || !exp->exp_obd || !exp->exp_obd->obd_proc_exports_entry ||
-	    !exp->exp_obd->obd_nid_stats_hash)
-		return -EINVAL;
-
-	/* not test against zero because eric say:
-	 * You may only test nid against another nid, or LNET_NID_ANY.
-	 * Anything else is nonsense.*/
-	if (!nid || *nid == LNET_NID_ANY)
-		return 0;
-
-	obd = exp->exp_obd;
-
-	CDEBUG(D_CONFIG, "using hash %p\n", obd->obd_nid_stats_hash);
-
-	new_stat = kzalloc(sizeof(*new_stat), GFP_NOFS);
-	if (new_stat == NULL)
-		return -ENOMEM;
-
-	new_stat->nid	       = *nid;
-	new_stat->nid_obd	   = exp->exp_obd;
-	/* we need set default refcount to 1 to balance obd_disconnect */
-	atomic_set(&new_stat->nid_exp_ref_count, 1);
-
-	old_stat = cfs_hash_findadd_unique(obd->obd_nid_stats_hash,
-					   nid, &new_stat->nid_hash);
-	CDEBUG(D_INFO, "Found stats %p for nid %s - ref %d\n",
-	       old_stat, libcfs_nid2str(*nid),
-	       atomic_read(&new_stat->nid_exp_ref_count));
-
-	/* We need to release old stats because lprocfs_exp_cleanup() hasn't
-	 * been and will never be called. */
-	if (exp->exp_nid_stats) {
-		nidstat_putref(exp->exp_nid_stats);
-		exp->exp_nid_stats = NULL;
-	}
-
-	/* Return -EALREADY here so that we know that the /proc
-	 * entry already has been created */
-	if (old_stat != new_stat) {
-		exp->exp_nid_stats = old_stat;
-		rc = -EALREADY;
-		goto destroy_new;
-	}
-	/* not found - create */
-	buffer = kmemdup(libcfs_nid2str(*nid), LNET_NIDSTR_SIZE, GFP_NOFS);
-	if (buffer == NULL) {
-		rc = -ENOMEM;
-		goto destroy_new;
-	}
-
-	new_stat->nid_proc = lprocfs_register(buffer,
-					      obd->obd_proc_exports_entry,
-					      NULL, NULL);
-	kfree(buffer);
-
-	if (IS_ERR(new_stat->nid_proc)) {
-		CERROR("Error making export directory for nid %s\n",
-		       libcfs_nid2str(*nid));
-		rc = PTR_ERR(new_stat->nid_proc);
-		new_stat->nid_proc = NULL;
-		goto destroy_new_ns;
-	}
-
-	entry = lprocfs_add_simple(new_stat->nid_proc, "uuid",
-				   new_stat, &lproc_exp_uuid_fops);
-	if (IS_ERR(entry)) {
-		CWARN("Error adding the NID stats file\n");
-		rc = PTR_ERR(entry);
-		goto destroy_new_ns;
-	}
-
-	entry = lprocfs_add_simple(new_stat->nid_proc, "hash",
-				   new_stat, &lproc_exp_hash_fops);
-	if (IS_ERR(entry)) {
-		CWARN("Error adding the hash file\n");
-		rc = PTR_ERR(entry);
-		goto destroy_new_ns;
-	}
-
-	exp->exp_nid_stats = new_stat;
-	*newnid = 1;
-	/* protect competitive add to list, not need locking on destroy */
-	spin_lock(&obd->obd_nid_lock);
-	list_add(&new_stat->nid_list, &obd->obd_nid_stats);
-	spin_unlock(&obd->obd_nid_lock);
-
-	return rc;
-
-destroy_new_ns:
-	if (new_stat->nid_proc != NULL)
-		lprocfs_remove(&new_stat->nid_proc);
-	cfs_hash_del(obd->obd_nid_stats_hash, nid, &new_stat->nid_hash);
-
-destroy_new:
-	nidstat_putref(new_stat);
-	kfree(new_stat);
-	return rc;
-}
-EXPORT_SYMBOL(lprocfs_exp_setup);
-
 int lprocfs_exp_cleanup(struct obd_export *exp)
 {
 	struct nid_stat *stat = exp->exp_nid_stats;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/6] staging/lustre/obd: Remove nid_stats tracking
  2015-05-31  3:26 [PATCH 0/6] Final part of lustre procfs removal series green
                   ` (3 preceding siblings ...)
  2015-05-31  3:27 ` [PATCH 4/6] staging/lustre/obd: remove unused lprocfs_exp_setup() and related functions green
@ 2015-05-31  3:27 ` green
  2015-05-31  3:27 ` [PATCH 6/6] staging/lustre/obd: final removal of procfs stuff green
  5 siblings, 0 replies; 7+ messages in thread
From: green @ 2015-05-31  3:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Oleg Drokin, Dmitry Eremin

From: Oleg Drokin <green@linuxhacker.ru>

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

Signed-off-by: Dmitry Eremin <dmiter4ever@gmail.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 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(-)

diff --git a/drivers/staging/lustre/lustre/include/dt_object.h b/drivers/staging/lustre/lustre/include/dt_object.h
index be4c7d9..866d04b 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;
diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 4b8c265..6a77ea8 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -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,
diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/drivers/staging/lustre/lustre/include/lu_object.h
index c8cc48f..e1d72a7 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_export.h b/drivers/staging/lustre/lustre/include/lustre_export.h
index 9c06a49..3b992b4 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/obd.h b/drivers/staging/lustre/lustre/include/obd.h
index 5268ae5..7067693 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -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;
diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h
index 98b397e..63f5224 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -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)) {		     \
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index 3ef5474..f44c746 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1106,46 +1106,6 @@ int lprocfs_obd_cleanup(struct obd_device *obd)
 }
 EXPORT_SYMBOL(lprocfs_obd_cleanup);
 
-static void lprocfs_free_client_stats(struct nid_stat *client_stat)
-{
-	CDEBUG(D_CONFIG, "stat %p - data %p/%p\n", client_stat,
-	       client_stat->nid_proc, client_stat->nid_stats);
-
-	LASSERTF(atomic_read(&client_stat->nid_exp_ref_count) == 0,
-		 "nid %s:count %d\n", libcfs_nid2str(client_stat->nid),
-		 atomic_read(&client_stat->nid_exp_ref_count));
-
-	if (client_stat->nid_proc)
-		lprocfs_remove(&client_stat->nid_proc);
-
-	if (client_stat->nid_stats)
-		lprocfs_free_stats(&client_stat->nid_stats);
-
-	if (client_stat->nid_ldlm_stats)
-		lprocfs_free_stats(&client_stat->nid_ldlm_stats);
-
-	kfree(client_stat);
-	return;
-
-}
-
-void lprocfs_free_per_client_stats(struct obd_device *obd)
-{
-	struct cfs_hash *hash = obd->obd_nid_stats_hash;
-	struct nid_stat *stat;
-
-	/* we need extra list - because hash_exit called to early */
-	/* not need locking because all clients is died */
-	while (!list_empty(&obd->obd_nid_stats)) {
-		stat = list_entry(obd->obd_nid_stats.next,
-				      struct nid_stat, nid_list);
-		list_del_init(&stat->nid_list);
-		cfs_hash_del(hash, &stat->nid, &stat->nid_hash);
-		lprocfs_free_client_stats(stat);
-	}
-}
-EXPORT_SYMBOL(lprocfs_free_per_client_stats);
-
 int lprocfs_stats_alloc_one(struct lprocfs_stats *stats, unsigned int cpuid)
 {
 	struct lprocfs_counter  *cntr;
@@ -1679,64 +1639,8 @@ void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats)
 }
 EXPORT_SYMBOL(lprocfs_init_ldlm_stats);
 
-int lprocfs_nid_stats_clear_read(struct seq_file *m, void *data)
-{
-	seq_printf(m, "%s\n",
-		   "Write into this file to clear all nid stats and stale nid entries");
-	return 0;
-}
-EXPORT_SYMBOL(lprocfs_nid_stats_clear_read);
-
-static int lprocfs_nid_stats_clear_write_cb(void *obj, void *data)
-{
-	struct nid_stat *stat = obj;
-
-	CDEBUG(D_INFO, "refcnt %d\n", atomic_read(&stat->nid_exp_ref_count));
-	if (atomic_read(&stat->nid_exp_ref_count) == 1) {
-		/* object has only hash references. */
-		spin_lock(&stat->nid_obd->obd_nid_lock);
-		list_move(&stat->nid_list, data);
-		spin_unlock(&stat->nid_obd->obd_nid_lock);
-		return 1;
-	}
-	/* we has reference to object - only clear data*/
-	if (stat->nid_stats)
-		lprocfs_clear_stats(stat->nid_stats);
-
-	return 0;
-}
-
-int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
-				  unsigned long count, void *data)
-{
-	struct obd_device *obd = (struct obd_device *)data;
-	struct nid_stat *client_stat;
-	LIST_HEAD(free_list);
-
-	cfs_hash_cond_del(obd->obd_nid_stats_hash,
-			  lprocfs_nid_stats_clear_write_cb, &free_list);
-
-	while (!list_empty(&free_list)) {
-		client_stat = list_entry(free_list.next, struct nid_stat,
-					     nid_list);
-		list_del_init(&client_stat->nid_list);
-		lprocfs_free_client_stats(client_stat);
-	}
-
-	return count;
-}
-EXPORT_SYMBOL(lprocfs_nid_stats_clear_write);
-
 int lprocfs_exp_cleanup(struct obd_export *exp)
 {
-	struct nid_stat *stat = exp->exp_nid_stats;
-
-	if (!stat || !exp->exp_obd)
-		return 0;
-
-	nidstat_putref(exp->exp_nid_stats);
-	exp->exp_nid_stats = NULL;
-
 	return 0;
 }
 EXPORT_SYMBOL(lprocfs_exp_cleanup);
diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c
index 0bda9c5..19d4eb0 100644
--- a/drivers/staging/lustre/lustre/obdclass/obd_config.c
+++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c
@@ -49,7 +49,6 @@
 
 static cfs_hash_ops_t uuid_hash_ops;
 static cfs_hash_ops_t nid_hash_ops;
-static cfs_hash_ops_t nid_stat_hash_ops;
 
 /*********** string parsing utils *********/
 
@@ -383,7 +382,6 @@ int class_attach(struct lustre_cfg *lcfg)
 	INIT_LIST_HEAD(&obd->obd_unlinked_exports);
 	INIT_LIST_HEAD(&obd->obd_delayed_exports);
 	INIT_LIST_HEAD(&obd->obd_exports_timed);
-	INIT_LIST_HEAD(&obd->obd_nid_stats);
 	spin_lock_init(&obd->obd_nid_lock);
 	spin_lock_init(&obd->obd_dev_lock);
 	mutex_init(&obd->obd_dev_mutex);
@@ -486,7 +484,6 @@ int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 	obd->obd_starting = 1;
 	obd->obd_uuid_hash = NULL;
 	obd->obd_nid_hash = NULL;
-	obd->obd_nid_stats_hash = NULL;
 	spin_unlock(&obd->obd_dev_lock);
 
 	/* create an uuid-export lustre hash */
@@ -515,19 +512,6 @@ int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 		goto err_hash;
 	}
 
-	/* create a nid-stats lustre hash */
-	obd->obd_nid_stats_hash = cfs_hash_create("NID_STATS",
-						  HASH_NID_STATS_CUR_BITS,
-						  HASH_NID_STATS_MAX_BITS,
-						  HASH_NID_STATS_BKT_BITS, 0,
-						  CFS_HASH_MIN_THETA,
-						  CFS_HASH_MAX_THETA,
-						  &nid_stat_hash_ops, CFS_HASH_DEFAULT);
-	if (!obd->obd_nid_stats_hash) {
-		err = -ENOMEM;
-		goto err_hash;
-	}
-
 	exp = class_new_export(obd, &obd->obd_uuid);
 	if (IS_ERR(exp)) {
 		err = PTR_ERR(exp);
@@ -567,10 +551,6 @@ err_hash:
 		cfs_hash_putref(obd->obd_nid_hash);
 		obd->obd_nid_hash = NULL;
 	}
-	if (obd->obd_nid_stats_hash) {
-		cfs_hash_putref(obd->obd_nid_stats_hash);
-		obd->obd_nid_stats_hash = NULL;
-	}
 	obd->obd_starting = 0;
 	CERROR("setup %s failed (%d)\n", obd->obd_name, err);
 	return err;
@@ -694,12 +674,6 @@ int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg)
 		obd->obd_nid_hash = NULL;
 	}
 
-	/* destroy a nid-stats hash body */
-	if (obd->obd_nid_stats_hash) {
-		cfs_hash_putref(obd->obd_nid_stats_hash);
-		obd->obd_nid_stats_hash = NULL;
-	}
-
 	class_decref(obd, "setup", obd);
 	obd->obd_set_up = 0;
 
@@ -1893,57 +1867,3 @@ static cfs_hash_ops_t nid_hash_ops = {
 	.hs_get	 = nid_export_get,
 	.hs_put_locked  = nid_export_put_locked,
 };
-
-
-/*
- * nid<->nidstats hash operations
- */
-
-static void *
-nidstats_key(struct hlist_node *hnode)
-{
-	struct nid_stat *ns;
-
-	ns = hlist_entry(hnode, struct nid_stat, nid_hash);
-
-	return &ns->nid;
-}
-
-static int
-nidstats_keycmp(const void *key, struct hlist_node *hnode)
-{
-	return *(lnet_nid_t *)nidstats_key(hnode) == *(lnet_nid_t *)key;
-}
-
-static void *
-nidstats_object(struct hlist_node *hnode)
-{
-	return hlist_entry(hnode, struct nid_stat, nid_hash);
-}
-
-static void
-nidstats_get(struct cfs_hash *hs, struct hlist_node *hnode)
-{
-	struct nid_stat *ns;
-
-	ns = hlist_entry(hnode, struct nid_stat, nid_hash);
-	nidstat_getref(ns);
-}
-
-static void
-nidstats_put_locked(struct cfs_hash *hs, struct hlist_node *hnode)
-{
-	struct nid_stat *ns;
-
-	ns = hlist_entry(hnode, struct nid_stat, nid_hash);
-	nidstat_putref(ns);
-}
-
-static cfs_hash_ops_t nid_stat_hash_ops = {
-	.hs_hash	= nid_hash,
-	.hs_key	 = nidstats_key,
-	.hs_keycmp      = nidstats_keycmp,
-	.hs_object      = nidstats_object,
-	.hs_get	 = nidstats_get,
-	.hs_put_locked  = nidstats_put_locked,
-};
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 6/6] staging/lustre/obd: final removal of procfs stuff
  2015-05-31  3:26 [PATCH 0/6] Final part of lustre procfs removal series green
                   ` (4 preceding siblings ...)
  2015-05-31  3:27 ` [PATCH 5/6] staging/lustre/obd: Remove nid_stats tracking green
@ 2015-05-31  3:27 ` green
  5 siblings, 0 replies; 7+ messages in thread
From: green @ 2015-05-31  3:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, Andreas Dilger
  Cc: Linux Kernel Mailing List, Dmitry Eremin, Oleg Drokin

From: Dmitry Eremin <dmiter4ever@gmail.com>

Signed-off-by: Dmitry Eremin <dmiter4ever@gmail.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
---
 .../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

diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h
index 4fe50841..3e2502a 100644
--- a/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h
@@ -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>
diff --git a/drivers/staging/lustre/lustre/fid/Makefile b/drivers/staging/lustre/lustre/fid/Makefile
index 5513ce4..b7ef314 100644
--- a/drivers/staging/lustre/lustre/fid/Makefile
+++ b/drivers/staging/lustre/lustre/fid/Makefile
@@ -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
diff --git a/drivers/staging/lustre/lustre/fld/Makefile b/drivers/staging/lustre/lustre/fld/Makefile
index 2bbf084..646e315 100644
--- a/drivers/staging/lustre/lustre/fld/Makefile
+++ b/drivers/staging/lustre/lustre/fld/Makefile
@@ -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
diff --git a/drivers/staging/lustre/lustre/include/dt_object.h b/drivers/staging/lustre/lustre/include/dt_object.h
index 866d04b..abae31b 100644
--- a/drivers/staging/lustre/lustre/include/dt_object.h
+++ b/drivers/staging/lustre/lustre/include/dt_object.h
@@ -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 */
diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_lite.h b/drivers/staging/lustre/lustre/include/linux/lustre_lite.h
index a7658a9..45651ca 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/obd.h b/drivers/staging/lustre/lustre/include/linux/obd.h
index 9cd8683..2817e88 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 6a77ea8..3292fd3 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -42,7 +42,6 @@
 #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>
@@ -380,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);
 /*
@@ -558,17 +555,11 @@ 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;
-extern int lprocfs_add_clear_entry(struct obd_device *obd,
-				   struct proc_dir_entry *entry);
 extern int lprocfs_exp_cleanup(struct obd_export *exp);
 extern struct dentry *ldebugfs_add_simple(struct dentry *root,
 					  char *name,
 					  void *data,
 					  struct file_operations *fops);
-extern struct proc_dir_entry *lprocfs_add_simple(struct proc_dir_entry *root,
-						char *name,
-						void *data,
-						struct file_operations *fops);
 extern struct dentry *
 ldebugfs_add_symlink(const char *name, struct dentry *parent,
 		    const char *format, ...);
@@ -576,30 +567,18 @@ ldebugfs_add_symlink(const char *name, struct dentry *parent,
 extern int ldebugfs_register_stats(struct dentry *parent,
 				   const char *name,
 				   struct lprocfs_stats *stats);
-extern int lprocfs_register_stats(struct proc_dir_entry *root, const char *name,
-				  struct lprocfs_stats *stats);
 
 /* lprocfs_status.c */
 extern int ldebugfs_add_vars(struct dentry *parent,
 			     struct lprocfs_vars *var,
 			     void *data);
-extern int lprocfs_add_vars(struct proc_dir_entry *root,
-			    struct lprocfs_vars *var,
-			    void *data);
 
 extern struct dentry *ldebugfs_register(const char *name,
 					struct dentry *parent,
 					struct lprocfs_vars *list,
 					void *data);
-extern struct proc_dir_entry *lprocfs_register(const char *name,
-					      struct proc_dir_entry *parent,
-					      struct lprocfs_vars *list,
-					      void *data);
 
 extern void ldebugfs_remove(struct dentry **entryp);
-extern void lprocfs_remove(struct proc_dir_entry **root);
-extern void lprocfs_remove_proc_entry(const char *name,
-				      struct proc_dir_entry *parent);
 
 extern int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
 			     struct attribute_group *attrs);
@@ -610,14 +589,11 @@ extern int ldebugfs_seq_create(struct dentry *parent,
 			       umode_t mode,
 			       const struct file_operations *seq_fops,
 			       void *data);
-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_obd_seq_create(struct obd_device *dev,
+				   const char *name,
+				   umode_t mode,
+				   const struct file_operations *seq_fops,
+				   void *data);
 
 /* Generic callbacks */
 
@@ -691,12 +667,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,			\
-			   inode->i_private ?: PDE_DATA(inode));	\
+	return single_open(file, name##_seq_show, inode->i_private);	\
 }									\
 static struct file_operations name##_fops = {				\
 	.owner   = THIS_MODULE,					    \
@@ -741,8 +716,7 @@ static struct file_operations name##_fops = {				\
 	}								\
 	static int name##_##type##_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);	\
 	}								\
 	static struct file_operations name##_##type##_fops = {	\
 		.open	= name##_##type##_open,				\
@@ -839,187 +813,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 */
-
-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_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_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/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h
index 0592f2b..c7c8fe4 100644
--- a/drivers/staging/lustre/lustre/include/lustre_fid.h
+++ b/drivers/staging/lustre/lustre/include/lustre_fid.h
@@ -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 588cdd5..c1f08de 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;
 
diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h
index e65e7d8..998dcd9 100644
--- a/drivers/staging/lustre/lustre/include/lustre_net.h
+++ b/drivers/staging/lustre/lustre/include/lustre_net.h
@@ -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 */
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 2643f28..0000000
--- 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/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h
index 63f5224..36ed781 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -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 {							    \
diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h
index c0136ee..73e2d48 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
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index 50e049b..cdb6366 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -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).
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
index f0ee76a..83b1a70 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -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
diff --git a/drivers/staging/lustre/lustre/llite/Makefile b/drivers/staging/lustre/lustre/llite/Makefile
index 7d70115..2cbc468 100644
--- a/drivers/staging/lustre/lustre/llite/Makefile
+++ b/drivers/staging/lustre/lustre/llite/Makefile
@@ -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
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index b30eb85..f097d4d 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -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);
diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c
index 6d9622a..2aae5f5 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_dev.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c
@@ -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;
 }
diff --git a/drivers/staging/lustre/lustre/lmv/Makefile b/drivers/staging/lustre/lustre/lmv/Makefile
index a7a1536..1a24299 100644
--- a/drivers/staging/lustre/lustre/lmv/Makefile
+++ b/drivers/staging/lustre/lustre/lmv/Makefile
@@ -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
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_internal.h b/drivers/staging/lustre/lustre/lmv/lmv_internal.h
index 852d787..b808728 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_internal.h
+++ b/drivers/staging/lustre/lustre/lmv/lmv_internal.h
@@ -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
diff --git a/drivers/staging/lustre/lustre/lov/Makefile b/drivers/staging/lustre/lustre/lov/Makefile
index 6fe56a2..e4cc0db 100644
--- a/drivers/staging/lustre/lustre/lov/Makefile
+++ b/drivers/staging/lustre/lustre/lov/Makefile
@@ -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
diff --git a/drivers/staging/lustre/lustre/lov/lov_internal.h b/drivers/staging/lustre/lustre/lov/lov_internal.h
index b644acc..5e8bcc6 100644
--- a/drivers/staging/lustre/lustre/lov/lov_internal.h
+++ b/drivers/staging/lustre/lustre/lov/lov_internal.h
@@ -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;
diff --git a/drivers/staging/lustre/lustre/lov/lov_pool.c b/drivers/staging/lustre/lustre/lov/lov_pool.c
index 30a29fd..3c46c36 100644
--- a/drivers/staging/lustre/lustre/lov/lov_pool.c
+++ b/drivers/staging/lustre/lustre/lov/lov_pool.c
@@ -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)
 {
diff --git a/drivers/staging/lustre/lustre/mdc/Makefile b/drivers/staging/lustre/lustre/mdc/Makefile
index 2516551..99ba9ff 100644
--- a/drivers/staging/lustre/lustre/mdc/Makefile
+++ b/drivers/staging/lustre/lustre/mdc/Makefile
@@ -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
diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
index 858d568..1c95f87 100644
--- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
+++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
@@ -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 */
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_internal.h b/drivers/staging/lustre/lustre/mdc/mdc_internal.h
index 81780c9..4d14943 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_internal.h
+++ b/drivers/staging/lustre/lustre/mdc/mdc_internal.h
@@ -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,
diff --git a/drivers/staging/lustre/lustre/mgc/Makefile b/drivers/staging/lustre/lustre/mgc/Makefile
index cc6e9f5..8ea29a8 100644
--- a/drivers/staging/lustre/lustre/mgc/Makefile
+++ b/drivers/staging/lustre/lustre/mgc/Makefile
@@ -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
diff --git a/drivers/staging/lustre/lustre/mgc/mgc_internal.h b/drivers/staging/lustre/lustre/mgc/mgc_internal.h
index a6f8b3c..82fb8f4 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_internal.h
+++ b/drivers/staging/lustre/lustre/mgc/mgc_internal.h
@@ -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);
 
diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index 91dbb08..c3e4334 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -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
diff --git a/drivers/staging/lustre/lustre/obdclass/Makefile b/drivers/staging/lustre/lustre/obdclass/Makefile
index e894681..d0f70b4 100644
--- a/drivers/staging/lustre/lustre/obdclass/Makefile
+++ b/drivers/staging/lustre/lustre/obdclass/Makefile
@@ -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
diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c
index 6e967af..1bc3756 100644
--- a/drivers/staging/lustre/lustre/obdclass/class_obd.c
+++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c
@@ -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.*/
diff --git a/drivers/staging/lustre/lustre/obdclass/dt_object.c b/drivers/staging/lustre/lustre/obdclass/dt_object.c
index b1eee0a..6ce407f 100644
--- a/drivers/staging/lustre/lustre/obdclass/dt_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/dt_object.c
@@ -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 */
diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 50c3d1d..e3c6dcb 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -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>
diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
index 8927e24..54f0a81 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c
@@ -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>
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index f44c746..17e7c18 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -221,8 +221,6 @@ int lprocfs_write_frac_helper(const char __user *buffer, unsigned long count,
 }
 EXPORT_SYMBOL(lprocfs_write_frac_helper);
 
-#if defined (CONFIG_PROC_FS)
-
 static int lprocfs_no_percpu_stats;
 module_param(lprocfs_no_percpu_stats, int, 0644);
 MODULE_PARM_DESC(lprocfs_no_percpu_stats, "Do not alloc percpu data for lprocfs stats");
@@ -266,29 +264,6 @@ struct dentry *ldebugfs_add_simple(struct dentry *root,
 }
 EXPORT_SYMBOL(ldebugfs_add_simple);
 
-struct proc_dir_entry *lprocfs_add_simple(struct proc_dir_entry *root,
-				     char *name, void *data,
-				     struct file_operations *fops)
-{
-	struct proc_dir_entry *proc;
-	umode_t mode = 0;
-
-	if (root == NULL || name == NULL || fops == NULL)
-		return ERR_PTR(-EINVAL);
-
-	if (fops->read)
-		mode = 0444;
-	if (fops->write)
-		mode |= 0200;
-	proc = proc_create_data(name, mode, root, fops, data);
-	if (!proc) {
-		CERROR("LprocFS: No memory to create /proc entry %s", name);
-		return ERR_PTR(-ENOMEM);
-	}
-	return proc;
-}
-EXPORT_SYMBOL(lprocfs_add_simple);
-
 struct dentry *ldebugfs_add_symlink(const char *name, struct dentry *parent,
 				    const char *format, ...)
 {
@@ -352,46 +327,6 @@ int ldebugfs_add_vars(struct dentry *parent,
 }
 EXPORT_SYMBOL(ldebugfs_add_vars);
 
-/**
- * Add /proc entries.
- *
- * \param root [in]  The parent proc entry on which new entry will be added.
- * \param list [in]  Array of proc entries to be added.
- * \param data [in]  The argument to be passed when entries read/write routines
- *		   are called through /proc file.
- *
- * \retval 0   on success
- *	 < 0 on error
- */
-int lprocfs_add_vars(struct proc_dir_entry *root, struct lprocfs_vars *list,
-		     void *data)
-{
-	if (root == NULL || list == NULL)
-		return -EINVAL;
-
-	while (list->name != NULL) {
-		struct proc_dir_entry *proc;
-		umode_t mode = 0;
-
-		if (list->proc_mode != 0000) {
-			mode = list->proc_mode;
-		} else if (list->fops) {
-			if (list->fops->read)
-				mode = 0444;
-			if (list->fops->write)
-				mode |= 0200;
-		}
-		proc = proc_create_data(list->name, mode, root,
-					list->fops ?: &lprocfs_generic_fops,
-					list->data ?: data);
-		if (proc == NULL)
-			return -ENOMEM;
-		list++;
-	}
-	return 0;
-}
-EXPORT_SYMBOL(lprocfs_add_vars);
-
 void ldebugfs_remove(struct dentry **entryp)
 {
 	debugfs_remove(*entryp);
@@ -399,20 +334,6 @@ void ldebugfs_remove(struct dentry **entryp)
 }
 EXPORT_SYMBOL(ldebugfs_remove);
 
-void lprocfs_remove(struct proc_dir_entry **rooth)
-{
-	proc_remove(*rooth);
-	*rooth = NULL;
-}
-EXPORT_SYMBOL(lprocfs_remove);
-
-void lprocfs_remove_proc_entry(const char *name, struct proc_dir_entry *parent)
-{
-	LASSERT(parent != NULL);
-	remove_proc_entry(name, parent);
-}
-EXPORT_SYMBOL(lprocfs_remove_proc_entry);
-
 struct dentry *ldebugfs_register(const char *name,
 				 struct dentry *parent,
 				 struct lprocfs_vars *list, void *data)
@@ -439,30 +360,6 @@ out:
 }
 EXPORT_SYMBOL(ldebugfs_register);
 
-struct proc_dir_entry *lprocfs_register(const char *name,
-					struct proc_dir_entry *parent,
-					struct lprocfs_vars *list, void *data)
-{
-	struct proc_dir_entry *entry;
-
-	entry = proc_mkdir(name, parent);
-	if (entry == NULL) {
-		entry = ERR_PTR(-ENOMEM);
-		goto out;
-	}
-
-	if (list != NULL) {
-		int rc = lprocfs_add_vars(entry, list, data);
-		if (rc != 0) {
-			lprocfs_remove(&entry);
-			entry = ERR_PTR(rc);
-		}
-	}
-out:
-	return entry;
-}
-EXPORT_SYMBOL(lprocfs_register);
-
 /* Generic callbacks */
 int lprocfs_rd_uint(struct seq_file *m, void *data)
 {
@@ -1337,7 +1234,7 @@ static int lprocfs_stats_seq_open(struct inode *inode, struct file *file)
 		return rc;
 
 	seq = file->private_data;
-	seq->private = inode->i_private ?: PDE_DATA(inode);
+	seq->private = inode->i_private;
 
 	return 0;
 }
@@ -1367,21 +1264,6 @@ int ldebugfs_register_stats(struct dentry *parent, const char *name,
 }
 EXPORT_SYMBOL(ldebugfs_register_stats);
 
-int lprocfs_register_stats(struct proc_dir_entry *root, const char *name,
-			   struct lprocfs_stats *stats)
-{
-	struct proc_dir_entry *entry;
-	LASSERT(root != NULL);
-
-	entry = proc_create_data(name, 0644, root,
-				 &lprocfs_stats_seq_fops, stats);
-	if (entry == NULL)
-		return -ENOMEM;
-
-	return 0;
-}
-EXPORT_SYMBOL(lprocfs_register_stats);
-
 void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
 			  unsigned conf, const char *name, const char *units)
 {
@@ -1854,35 +1736,16 @@ int ldebugfs_seq_create(struct dentry *parent,
 }
 EXPORT_SYMBOL(ldebugfs_seq_create);
 
-int lprocfs_seq_create(struct proc_dir_entry *parent,
-		       const char *name,
-		       umode_t mode,
-		       const struct file_operations *seq_fops,
-		       void *data)
-{
-	struct proc_dir_entry *entry;
-
-	/* Disallow secretly (un)writable entries. */
-	LASSERT((seq_fops->write == NULL) == ((mode & 0222) == 0));
-	entry = proc_create_data(name, mode, parent, seq_fops, data);
-
-	if (entry == NULL)
-		return -ENOMEM;
-
-	return 0;
-}
-EXPORT_SYMBOL(lprocfs_seq_create);
-
-int lprocfs_obd_seq_create(struct obd_device *dev,
-			   const char *name,
-			   umode_t mode,
-			   const struct file_operations *seq_fops,
-			   void *data)
+int ldebugfs_obd_seq_create(struct obd_device *dev,
+			    const char *name,
+			    umode_t mode,
+			    const struct file_operations *seq_fops,
+			    void *data)
 {
 	return ldebugfs_seq_create(dev->obd_debugfs_entry, name,
 				   mode, seq_fops, data);
 }
-EXPORT_SYMBOL(lprocfs_obd_seq_create);
+EXPORT_SYMBOL(ldebugfs_obd_seq_create);
 
 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value)
 {
@@ -1938,8 +1801,6 @@ int lprocfs_obd_rd_max_pages_per_rpc(struct seq_file *m, void *data)
 }
 EXPORT_SYMBOL(lprocfs_obd_rd_max_pages_per_rpc);
 
-#endif
-
 ssize_t lustre_attr_show(struct kobject *kobj,
 			 struct attribute *attr, char *buf)
 {
diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c
index 4458faa..eae6606 100644
--- a/drivers/staging/lustre/lustre/obdclass/lu_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c
@@ -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
 }
 
 /**
diff --git a/drivers/staging/lustre/lustre/osc/Makefile b/drivers/staging/lustre/lustre/osc/Makefile
index 54927fb..37cdeea 100644
--- a/drivers/staging/lustre/lustre/osc/Makefile
+++ b/drivers/staging/lustre/lustre/osc/Makefile
@@ -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
diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c b/drivers/staging/lustre/lustre/osc/lproc_osc.c
index 0ba2c36..9dc84ba 100644
--- a/drivers/staging/lustre/lustre/osc/lproc_osc.c
+++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c
@@ -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;
 }
diff --git a/drivers/staging/lustre/lustre/osc/osc_internal.h b/drivers/staging/lustre/lustre/osc/osc_internal.h
index af96c7b..470698b 100644
--- a/drivers/staging/lustre/lustre/osc/osc_internal.h
+++ b/drivers/staging/lustre/lustre/osc/osc_internal.h
@@ -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;
 
diff --git a/drivers/staging/lustre/lustre/ptlrpc/Makefile b/drivers/staging/lustre/lustre/ptlrpc/Makefile
index fb50cd4..24bbac1 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/Makefile
+++ b/drivers/staging/lustre/lustre/ptlrpc/Makefile
@@ -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
diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
index cf5196a..1362160 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
@@ -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, jxiong@clusterfs.com */
@@ -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 */
diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
index 9f9ef9a..6dc3998 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
+++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
@@ -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);
diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c b/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c
index 549515d..982512f 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c
@@ -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);
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-05-31  3:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-31  3:26 [PATCH 0/6] Final part of lustre procfs removal series green
2015-05-31  3:27 ` [PATCH 1/6] staging/lustre/llite: Move all remaining procfs entries to debugfs green
2015-05-31  3:27 ` [PATCH 2/6] staging/lustre/obd: remove unused proc_lustre_root green
2015-05-31  3:27 ` [PATCH 3/6] staging/lustre/obd: Rename lprocfs_add_symlink to ldebugfs_add_symlink green
2015-05-31  3:27 ` [PATCH 4/6] staging/lustre/obd: remove unused lprocfs_exp_setup() and related functions green
2015-05-31  3:27 ` [PATCH 5/6] staging/lustre/obd: Remove nid_stats tracking green
2015-05-31  3:27 ` [PATCH 6/6] staging/lustre/obd: final removal of procfs stuff green

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox