Skip to contentSkip to conversation

staging/lustre/libcfs: cleanup linux-fs.h and kp30.h

PATCH New Peng Tao 1 participant 11 messages Nov 21, 2013 Staging

lore
Share & tools
lore

Peng Tao

author
#0 lore raw

cover staging/lustre/libcfs: cleanup linux-fs.h and kp30.h

Hi Greg and Andreas,

Following patches remove linux-fs.h and clean up kp30.h a bit.

Thanks,
Tao

Cc Andreas Dilger <[email protected]>

Peng Tao (10):
staging/lustre/libcfs: remove filp_size/filp_poff staging/lustre/libcfs: remove filp_fsync staging/lustre/libcfs: remove filp_read staging/lustre/libcfs: remove filp_write staging/lustre: move IFTODT/DTTOIF to lustre_idl.h staging/lustre/libcfs: remove flock wrappers staging/lustre/libcfs: remove linux-fs.h staging/lustre/libcfs: remove lwt code staging/lustre: remove CFS_MODULE_PARM staging/lustre/libcfs: remove LI_POISON

 .../lustre/include/linux/libcfs/libcfs_ioctl.h     |    3 -
 .../lustre/include/linux/libcfs/linux/kp30.h       |  113 ---------
 .../lustre/include/linux/libcfs/linux/libcfs.h     |    1 -
 .../lustre/include/linux/libcfs/linux/linux-fs.h   |   92 -------
 .../lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c  |   96 +++----
 .../lustre/lnet/klnds/socklnd/socklnd_modparams.c  |  112 ++++-----
 drivers/staging/lustre/lnet/lnet/acceptor.c        |   16 +-
 drivers/staging/lustre/lnet/lnet/api-ni.c          |   16 +-
 drivers/staging/lustre/lnet/lnet/lib-move.c        |    4 +-
 drivers/staging/lustre/lnet/lnet/lib-ptl.c         |    4 +-
 drivers/staging/lustre/lnet/lnet/module.c          |    4 +-
 drivers/staging/lustre/lnet/lnet/router.c          |   44 ++--
 drivers/staging/lustre/lnet/selftest/brw_test.c    |    7 +-
 drivers/staging/lustre/lnet/selftest/framework.c   |    8 +-
 drivers/staging/lustre/lnet/selftest/ping_test.c   |    3 +-
 .../lustre/lustre/include/lustre/lustre_idl.h      |   12 +
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c    |   17 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c    |    8 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |    4 +-
 drivers/staging/lustre/lustre/libcfs/debug.c       |   42 ++--
 drivers/staging/lustre/lustre/libcfs/hash.c        |    4 +-
 .../staging/lustre/lustre/libcfs/linux/linux-cpu.c |    6 +-
 drivers/staging/lustre/lustre/libcfs/lwt.c         |  266 --------------------
 drivers/staging/lustre/lustre/libcfs/module.c      |   53 +---
 drivers/staging/lustre/lustre/libcfs/tracefile.c   |   22 +-
 drivers/staging/lustre/lustre/llite/lloop.c        |    3 +-
 .../lustre/lustre/obdclass/lprocfs_status.c        |    4 +-
 drivers/staging/lustre/lustre/obdclass/lu_object.c |    4 +-
 drivers/staging/lustre/lustre/ptlrpc/pinger.c      |    3 +-
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c     |    8 +-
 drivers/staging/lustre/lustre/ptlrpc/service.c     |   26 +-
 31 files changed, 253 insertions(+), 752 deletions(-)
 delete mode 100644 drivers/staging/lustre/include/linux/libcfs/linux/linux-fs.h
 delete mode 100644 drivers/staging/lustre/lustre/libcfs/lwt.c
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/10 staging/lustre/libcfs: remove filp_size/filp_poff

Cc Andreas Dilger <[email protected]>
---
 .../lustre/include/linux/libcfs/linux/linux-fs.h   |    5 -----
 drivers/staging/lustre/lustre/libcfs/tracefile.c   |    6 +++---
 2 files changed, 3 insertions(+), 8 deletions(-)
drivers/staging/lustre/include/linux/libcfs/linux/linux-fs.h +0 -5
index eebf138..8fabe4b 100644
@@ -52,11 +52,6 @@
 #include <linux/backing-dev.h>
 #include <linux/posix_acl_xattr.h>
 
-#define filp_size(f)					\
-	(i_size_read((f)->f_dentry->d_inode))
-#define filp_poff(f)					\
-	(&(f)->f_pos)
-
 # define do_fsync(fp, flag)				\
 	((fp)->f_op->fsync(fp, 0, LLONG_MAX, flag))
 
drivers/staging/lustre/lustre/libcfs/tracefile.c +3 -3
index f71a3cc..0ce4aac 100644
@@ -709,7 +709,7 @@ int cfs_tracefile_dump_all_pages(char *filename)
 		__LASSERT_TAGE_INVARIANT(tage);
 
 		rc = filp_write(filp, page_address(tage->page),
-				tage->used, filp_poff(filp));
+				tage->used, &filp->f_pos);
 		if (rc != (int)tage->used) {
 			printk(KERN_WARNING "wanted to write %u but wrote "
 			       "%d\n", tage->used, rc);
@@ -1020,8 +1020,8 @@ static int tracefiled(void *arg)
 
 			if (f_pos >= (off_t)cfs_tracefile_size)
 				f_pos = 0;
-			else if (f_pos > (off_t)filp_size(filp))
-				f_pos = filp_size(filp);
+			else if (f_pos > i_size_read(filp->f_dentry->d_inode))
+				f_pos = i_size_read(filp->f_dentry->d_inode);
 
 			rc = filp_write(filp, page_address(tage->page),
 					tage->used, &f_pos);
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH 2/10 staging/lustre/libcfs: remove filp_fsync

In reply to Peng Tao

we can just call generic vfs_fsync().

Cc Andreas Dilger <[email protected]>
---
 .../lustre/include/linux/libcfs/linux/linux-fs.h   |    6 ------
 drivers/staging/lustre/lustre/libcfs/tracefile.c   |    2 +-
 2 files changed, 1 insertion(+), 7 deletions(-)
drivers/staging/lustre/include/linux/libcfs/linux/linux-fs.h +0 -6
index 8fabe4b..e523004 100644
@@ -52,18 +52,12 @@
 #include <linux/backing-dev.h>
 #include <linux/posix_acl_xattr.h>
 
-# define do_fsync(fp, flag)				\
-	((fp)->f_op->fsync(fp, 0, LLONG_MAX, flag))
-
 #define filp_read(fp, buf, size, pos)			\
 	((fp)->f_op->read((fp), (buf), (size), pos))
 
 #define filp_write(fp, buf, size, pos)			\
 	((fp)->f_op->write((fp), (buf), (size), pos))
 
-#define filp_fsync(fp)					\
-	do_fsync(fp, 1)
-
 #define flock_type(fl)			((fl)->fl_type)
 #define flock_set_type(fl, type)	do { (fl)->fl_type = (type); } while (0)
 #define flock_pid(fl)			((fl)->fl_pid)
drivers/staging/lustre/lustre/libcfs/tracefile.c +1 -1
index 0ce4aac..4c3dad6 100644
@@ -721,7 +721,7 @@ int cfs_tracefile_dump_all_pages(char *filename)
 		cfs_tage_free(tage);
 	}
 	MMSPACE_CLOSE;
-	rc = filp_fsync(filp);
+	rc = vfs_fsync(filp, 1);
 	if (rc)
 		printk(KERN_ERR "sync returns %d\n", rc);
 close:
Signature · 1 line
1.7.9.5
author
#3 lore raw

PATCH 3/10 staging/lustre/libcfs: remove filp_read

In reply to Peng Tao

no users.

Cc Andreas Dilger <[email protected]>
---
 .../lustre/include/linux/libcfs/linux/linux-fs.h   |    3 ---
 1 file changed, 3 deletions(-)
drivers/staging/lustre/include/linux/libcfs/linux/linux-fs.h +0 -3
index e523004..573ab08 100644
@@ -52,9 +52,6 @@
 #include <linux/backing-dev.h>
 #include <linux/posix_acl_xattr.h>
 
-#define filp_read(fp, buf, size, pos)			\
-	((fp)->f_op->read((fp), (buf), (size), pos))
-
 #define filp_write(fp, buf, size, pos)			\
 	((fp)->f_op->write((fp), (buf), (size), pos))
 
Signature · 1 line
1.7.9.5
author
#4 lore raw

PATCH 4/10 staging/lustre/libcfs: remove filp_write

In reply to Peng Tao

Use vfs_write instead and call kmap/kunmap to ensure that we can access high memory zone.

Cc Andreas Dilger <[email protected]>
---
 .../lustre/include/linux/libcfs/linux/linux-fs.h   |    3 ---
 drivers/staging/lustre/lustre/libcfs/tracefile.c   |   16 ++++++++++++----
 2 files changed, 12 insertions(+), 7 deletions(-)
drivers/staging/lustre/include/linux/libcfs/linux/linux-fs.h +0 -3
index 573ab08..102afa2 100644
@@ -52,9 +52,6 @@
 #include <linux/backing-dev.h>
 #include <linux/posix_acl_xattr.h>
 
-#define filp_write(fp, buf, size, pos)			\
-	((fp)->f_op->write((fp), (buf), (size), pos))
-
 #define flock_type(fl)			((fl)->fl_type)
 #define flock_set_type(fl, type)	do { (fl)->fl_type = (type); } while (0)
 #define flock_pid(fl)			((fl)->fl_pid)
drivers/staging/lustre/lustre/libcfs/tracefile.c +12 -4
index 4c3dad6..54290ce 100644
@@ -678,6 +678,7 @@ int cfs_tracefile_dump_all_pages(char *filename)
 	struct file		*filp;
 	struct cfs_trace_page	*tage;
 	struct cfs_trace_page	*tmp;
+	char			*buf;
 	int rc;
 
 	DECL_MMSPACE;
@@ -708,8 +709,11 @@ int cfs_tracefile_dump_all_pages(char *filename)
 
 		__LASSERT_TAGE_INVARIANT(tage);
 
-		rc = filp_write(filp, page_address(tage->page),
-				tage->used, &filp->f_pos);
+		buf = kmap(tage->page);
+		rc = vfs_write(filp, (__force const char __user *)buf,
+			       tage->used, &filp->f_pos);
+		kunmap(tage->page);
+
 		if (rc != (int)tage->used) {
 			printk(KERN_WARNING "wanted to write %u but wrote "
 			       "%d\n", tage->used, rc);
@@ -971,6 +975,7 @@ static int tracefiled(void *arg)
 	struct cfs_trace_page *tage;
 	struct cfs_trace_page *tmp;
 	struct file *filp;
+	char *buf;
 	int last_loop = 0;
 	int rc;
 
@@ -1023,8 +1028,11 @@ static int tracefiled(void *arg)
 			else if (f_pos > i_size_read(filp->f_dentry->d_inode))
 				f_pos = i_size_read(filp->f_dentry->d_inode);
 
-			rc = filp_write(filp, page_address(tage->page),
-					tage->used, &f_pos);
+			buf = kmap(tage->page);
+			rc = vfs_write(filp, (__force const char __user *)buf,
+				       tage->used, &f_pos);
+			kunmap(tage->page);
+
 			if (rc != (int)tage->used) {
 				printk(KERN_WARNING "wanted to write %u "
 				       "but wrote %d\n", tage->used, rc);
Signature · 1 line
1.7.9.5
author
#5 lore raw

PATCH 5/10 staging/lustre: move IFTODT/DTTOIF to lustre_idl.h

In reply to Peng Tao

They are in fact definition of how client/server talks to each other about file type.

Cc Andreas Dilger <[email protected]>
---
 .../lustre/include/linux/libcfs/linux/linux-fs.h   |   11 -----------
 .../lustre/lustre/include/lustre/lustre_idl.h      |   12 ++++++++++++
 2 files changed, 12 insertions(+), 11 deletions(-)
drivers/staging/lustre/include/linux/libcfs/linux/linux-fs.h +0 -11
index 102afa2..fdec53a 100644
@@ -61,15 +61,4 @@
 #define flock_end(fl)			((fl)->fl_end)
 #define flock_set_end(fl, end)		do { (fl)->fl_end = (end); } while (0)
 
-#ifndef IFSHIFT
-#define IFSHIFT			12
-#endif
-
-#ifndef IFTODT
-#define IFTODT(type)		(((type) & S_IFMT) >> IFSHIFT)
-#endif
-#ifndef DTTOIF
-#define DTTOIF(dirtype)		((dirtype) << IFSHIFT)
-#endif
-
 #endif
drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +12 -0
index e592a0e..5130468 100644
@@ -1025,6 +1025,18 @@ struct luda_type {
 	__u16 lt_type;
 };
 
+#ifndef IFSHIFT
+#define IFSHIFT                 12
+#endif
+
+#ifndef IFTODT
+#define IFTODT(type)		(((type) & S_IFMT) >> IFSHIFT)
+#endif
+#ifndef DTTOIF
+#define DTTOIF(dirtype)		((dirtype) << IFSHIFT)
+#endif
+
+
 struct lu_dirpage {
 	__u64	    ldp_hash_start;
 	__u64	    ldp_hash_end;
Signature · 1 line
1.7.9.5
author
#6 lore raw

PATCH 6/10 staging/lustre/libcfs: remove flock wrappers

In reply to Peng Tao
Cc Andreas Dilger <[email protected]>
---
 .../lustre/include/linux/libcfs/linux/linux-fs.h   |    9 ---------
 drivers/staging/lustre/lustre/ldlm/ldlm_flock.c    |   17 +++++++----------
 2 files changed, 7 insertions(+), 19 deletions(-)
drivers/staging/lustre/include/linux/libcfs/linux/linux-fs.h +0 -9
index fdec53a..71e7594 100644
@@ -52,13 +52,4 @@
 #include <linux/backing-dev.h>
 #include <linux/posix_acl_xattr.h>
 
-#define flock_type(fl)			((fl)->fl_type)
-#define flock_set_type(fl, type)	do { (fl)->fl_type = (type); } while (0)
-#define flock_pid(fl)			((fl)->fl_pid)
-#define flock_set_pid(fl, pid)		do { (fl)->fl_pid = (pid); } while (0)
-#define flock_start(fl)			((fl)->fl_start)
-#define flock_set_start(fl, st)		do { (fl)->fl_start = (st); } while (0)
-#define flock_end(fl)			((fl)->fl_end)
-#define flock_set_end(fl, end)		do { (fl)->fl_end = (end); } while (0)
-
 #endif
drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +7 -10
index 39fcdac..456d5aa 100644
@@ -665,23 +665,20 @@ granted:
 		/* fcntl(F_GETLK) request */
 		/* The old mode was saved in getlk->fl_type so that if the mode
 		 * in the lock changes we can decref the appropriate refcount.*/
-		ldlm_flock_destroy(lock, flock_type(getlk),
-				   LDLM_FL_WAIT_NOREPROC);
+		ldlm_flock_destroy(lock, getlk->fl_type, LDLM_FL_WAIT_NOREPROC);
 		switch (lock->l_granted_mode) {
 		case LCK_PR:
-			flock_set_type(getlk, F_RDLCK);
+			getlk->fl_type = F_RDLCK;
 			break;
 		case LCK_PW:
-			flock_set_type(getlk, F_WRLCK);
+			getlk->fl_type = F_WRLCK;
 			break;
 		default:
-			flock_set_type(getlk, F_UNLCK);
+			getlk->fl_type = F_UNLCK;
 		}
-		flock_set_pid(getlk, (pid_t)lock->l_policy_data.l_flock.pid);
-		flock_set_start(getlk,
-				(loff_t)lock->l_policy_data.l_flock.start);
-		flock_set_end(getlk,
-			      (loff_t)lock->l_policy_data.l_flock.end);
+		getlk->fl_pid = (pid_t)lock->l_policy_data.l_flock.pid;
+		getlk->fl_start = (loff_t)lock->l_policy_data.l_flock.start;
+		getlk->fl_end = (loff_t)lock->l_policy_data.l_flock.end;
 	} else {
 		__u64 noreproc = LDLM_FL_WAIT_NOREPROC;
 
Signature · 1 line
1.7.9.5
author
#7 lore raw

PATCH 7/10 staging/lustre/libcfs: remove linux-fs.h

In reply to Peng Tao
Cc Andreas Dilger <[email protected]>
---
 .../lustre/include/linux/libcfs/linux/libcfs.h     |    1 -
 .../lustre/include/linux/libcfs/linux/linux-fs.h   |   55 --------------------
 2 files changed, 56 deletions(-)
 delete mode 100644 drivers/staging/lustre/include/linux/libcfs/linux/linux-fs.h
drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h +0 -1
index 60ecaf6..a7bca40 100644
@@ -49,7 +49,6 @@
 #include <linux/libcfs/linux/linux-mem.h>
 #include <linux/libcfs/linux/linux-prim.h>
 #include <linux/libcfs/linux/linux-lock.h>
-#include <linux/libcfs/linux/linux-fs.h>
 #include <linux/libcfs/linux/linux-tcpip.h>
 #include <linux/libcfs/linux/linux-bitops.h>
 #include <linux/libcfs/linux/linux-types.h>
drivers/staging/lustre/include/linux/libcfs/linux/linux-fs.h deleted +0 -55

55 lines not on this page · raw message

Signature · 1 line
1.7.9.5
author
#8 lore raw

PATCH 8/10 staging/lustre/libcfs: remove lwt code

In reply to Peng Tao

It was never enabled.

Cc Andreas Dilger <[email protected]>
---
 .../lustre/include/linux/libcfs/libcfs_ioctl.h     |    3 -
 .../lustre/include/linux/libcfs/linux/kp30.h       |   96 -------
 drivers/staging/lustre/lustre/libcfs/lwt.c         |  266 --------------------
 drivers/staging/lustre/lustre/libcfs/module.c      |   53 +---
 4 files changed, 3 insertions(+), 415 deletions(-)
 delete mode 100644 drivers/staging/lustre/lustre/libcfs/lwt.c
drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h +0 -3
index 315743e..dd1a1f1 100644
@@ -113,9 +113,6 @@ struct libcfs_ioctl_handler {
 #define IOC_LIBCFS_PANIC		   _IOWR('e', 30, long)
 #define IOC_LIBCFS_CLEAR_DEBUG	     _IOWR('e', 31, long)
 #define IOC_LIBCFS_MARK_DEBUG	      _IOWR('e', 32, long)
-#define IOC_LIBCFS_LWT_CONTROL	     _IOWR('e', 33, long)
-#define IOC_LIBCFS_LWT_SNAPSHOT	    _IOWR('e', 34, long)
-#define IOC_LIBCFS_LWT_LOOKUP_STRING       _IOWR('e', 35, long)
 #define IOC_LIBCFS_MEMHOG		  _IOWR('e', 36, long)
 #define IOC_LIBCFS_PING_TEST	       _IOWR('e', 37, long)
 /* lnet ioctls */
drivers/staging/lustre/include/linux/libcfs/linux/kp30.h +0 -96

102 lines not on this page · raw message

drivers/staging/lustre/lustre/libcfs/lwt.c deleted +0 -266

266 lines not on this page · raw message

drivers/staging/lustre/lustre/libcfs/module.c +3 -50

80 lines not on this page · raw message

Signature · 1 line
1.7.9.5
author
#9 lore raw

PATCH 9/10 staging/lustre: remove CFS_MODULE_PARM

In reply to Peng Tao

Patch generated by coccinelle:

@generic_type@
declarer name CFS_MODULE_PARM;
declarer name module_param;
declarer name MODULE_PARM_DESC;
expression E1, E2, E3, E4;
type t;
@@
-CFS_MODULE_PARM(E1, E2, t, E3, E4);
+module_param(E1, t, E3);
+MODULE_PARM_DESC(E1, E4);

@charp@
expression E1, E2, E3, E4, E5;
@@
-CFS_MODULE_PARM(E1, E2, E3, E4, E5);
+module_param(E1, E3, E4);
+MODULE_PARM_DESC(E1, E5);

With manual modification to remove CFS_MODULE_PARM definition and fix up checkpatch.pl warnnings.

Cc Andreas Dilger <[email protected]>
---
 .../lustre/include/linux/libcfs/linux/kp30.h       |    7 --
 .../lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c  |   96 ++++++++---------
 .../lustre/lnet/klnds/socklnd/socklnd_modparams.c  |  112 ++++++++++----------
 drivers/staging/lustre/lnet/lnet/acceptor.c        |   16 +--
 drivers/staging/lustre/lnet/lnet/api-ni.c          |   16 +--
 drivers/staging/lustre/lnet/lnet/lib-move.c        |    4 +-
 drivers/staging/lustre/lnet/lnet/lib-ptl.c         |    4 +-
 drivers/staging/lustre/lnet/lnet/module.c          |    4 +-
 drivers/staging/lustre/lnet/lnet/router.c          |   44 ++++----
 drivers/staging/lustre/lnet/selftest/brw_test.c    |    7 +-
 drivers/staging/lustre/lnet/selftest/framework.c   |    8 +-
 drivers/staging/lustre/lnet/selftest/ping_test.c   |    3 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c    |    8 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |    4 +-
 drivers/staging/lustre/lustre/libcfs/debug.c       |   42 ++++----
 drivers/staging/lustre/lustre/libcfs/hash.c        |    4 +-
 .../staging/lustre/lustre/libcfs/linux/linux-cpu.c |    6 +-
 drivers/staging/lustre/lustre/llite/lloop.c        |    3 +-
 .../lustre/lustre/obdclass/lprocfs_status.c        |    4 +-
 drivers/staging/lustre/lustre/obdclass/lu_object.c |    4 +-
 drivers/staging/lustre/lustre/ptlrpc/pinger.c      |    3 +-
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c     |    8 +-
 drivers/staging/lustre/lustre/ptlrpc/service.c     |   26 ++---
 23 files changed, 216 insertions(+), 217 deletions(-)
drivers/staging/lustre/include/linux/libcfs/linux/kp30.h +0 -7
index ba14c31..8cab09c 100644
@@ -70,13 +70,6 @@
 
 #include <linux/libcfs/linux/portals_compat25.h>
 
-
-/******************************************************************************/
-/* Module parameter support */
-#define CFS_MODULE_PARM(name, t, type, perm, desc) \
-	module_param(name, type, perm);\
-	MODULE_PARM_DESC(name, desc)
-
 /* ------------------------------------------------------------------ */
 
 # define LI_POISON 0x5a5a5a5a
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_modparams.c +48 -48

160 lines not on this page · raw message

drivers/staging/lustre/lnet/klnds/socklnd/socklnd_modparams.c +56 -56

179 lines not on this page · raw message

drivers/staging/lustre/lnet/lnet/acceptor.c +8 -8
index 92c60a7..cb2ecd7 100644
@@ -64,14 +64,14 @@ lnet_accept_magic(__u32 magic, __u32 constant)
 
 static char *accept = "secure";
 
-CFS_MODULE_PARM(accept, "s", charp, 0444,
-		"Accept connections (secure|all|none)");
-CFS_MODULE_PARM(accept_port, "i", int, 0444,
-		"Acceptor's port (same on all nodes)");
-CFS_MODULE_PARM(accept_backlog, "i", int, 0444,
-		"Acceptor's listen backlog");
-CFS_MODULE_PARM(accept_timeout, "i", int, 0644,
-		"Acceptor's timeout (seconds)");
+module_param(accept, charp, 0444);
+MODULE_PARM_DESC(accept, "Accept connections (secure|all|none)");
+module_param(accept_port, int, 0444);
+MODULE_PARM_DESC(accept_port, "Acceptor's port (same on all nodes)");
+module_param(accept_backlog, int, 0444);
+MODULE_PARM_DESC(accept_backlog, "Acceptor's listen backlog");
+module_param(accept_timeout, int, 0644);
+MODULE_PARM_DESC(accept_timeout, "Acceptor's timeout (seconds)");
 
 static char *accept_type;
 
drivers/staging/lustre/lnet/lnet/api-ni.c +8 -8
index 160a429..5719959 100644
@@ -45,20 +45,20 @@ EXPORT_SYMBOL(the_lnet);
 
 
 static char *ip2nets = "";
-CFS_MODULE_PARM(ip2nets, "s", charp, 0444,
-		"LNET network <- IP table");
+module_param(ip2nets, charp, 0444);
+MODULE_PARM_DESC(ip2nets, "LNET network <- IP table");
 
 static char *networks = "";
-CFS_MODULE_PARM(networks, "s", charp, 0444,
-		"local networks");
+module_param(networks, charp, 0444);
+MODULE_PARM_DESC(networks, "local networks");
 
 static char *routes = "";
-CFS_MODULE_PARM(routes, "s", charp, 0444,
-		"routes to non-local networks");
+module_param(routes, charp, 0444);
+MODULE_PARM_DESC(routes, "routes to non-local networks");
 
 static int rnet_htable_size = LNET_REMOTE_NETS_HASH_DEFAULT;
-CFS_MODULE_PARM(rnet_htable_size, "i", int, 0444,
-		"size of remote network hash table");
+module_param(rnet_htable_size, int, 0444);
+MODULE_PARM_DESC(rnet_htable_size, "size of remote network hash table");
 
 char *
 lnet_get_routes(void)
drivers/staging/lustre/lnet/lnet/lib-move.c +2 -2
index b6f8ad3..2d61113 100644
@@ -43,8 +43,8 @@
 #include <linux/lnet/lib-lnet.h>
 
 static int local_nid_dist_zero = 1;
-CFS_MODULE_PARM(local_nid_dist_zero, "i", int, 0444,
-		"Reserved");
+module_param(local_nid_dist_zero, int, 0444);
+MODULE_PARM_DESC(local_nid_dist_zero, "Reserved");
 
 int
 lnet_fail_nid(lnet_nid_t nid, unsigned int threshold)
drivers/staging/lustre/lnet/lnet/lib-ptl.c +2 -2
index 9b9e7d3..6fffd5e 100644
@@ -40,8 +40,8 @@
 
 /* NB: add /proc interfaces in upcoming patches */
 int	portal_rotor	= LNET_PTL_ROTOR_HASH_RT;
-CFS_MODULE_PARM(portal_rotor, "i", int, 0644,
-		"redirect PUTs to different cpu-partitions");
+module_param(portal_rotor, int, 0644);
+MODULE_PARM_DESC(portal_rotor, "redirect PUTs to different cpu-partitions");
 
 static int
 lnet_ptl_match_type(unsigned int index, lnet_process_id_t match_id,
drivers/staging/lustre/lnet/lnet/module.c +2 -2
index 6db8774..3bd42a4 100644
@@ -38,8 +38,8 @@
 #include <linux/lnet/lib-lnet.h>
 
 static int config_on_load;
-CFS_MODULE_PARM(config_on_load, "i", int, 0444,
-		"configure network at module load");
+module_param(config_on_load, int, 0444);
+MODULE_PARM_DESC(config_on_load, "configure network at module load");
 
 static struct mutex lnet_config_mutex;
 
drivers/staging/lustre/lnet/lnet/router.c +22 -22

71 lines not on this page · raw message

drivers/staging/lustre/lnet/selftest/brw_test.c +4 -3
index b7613c8..3f8020c 100644
@@ -41,11 +41,12 @@
 #include "selftest.h"
 
 static int brw_srv_workitems = SFW_TEST_WI_MAX;
-CFS_MODULE_PARM(brw_srv_workitems, "i", int, 0644, "# BRW server workitems");
+module_param(brw_srv_workitems, int, 0644);
+MODULE_PARM_DESC(brw_srv_workitems, "# BRW server workitems");
 
 static int brw_inject_errors;
-CFS_MODULE_PARM(brw_inject_errors, "i", int, 0644,
-		"# data errors to inject randomly, zero by default");
+module_param(brw_inject_errors, int, 0644);
+MODULE_PARM_DESC(brw_inject_errors, "# data errors to inject randomly, zero by default");
 
 static void
 brw_client_fini(sfw_test_instance_t *tsi)
drivers/staging/lustre/lnet/selftest/framework.c +4 -4
index 483c785..050723a 100644
@@ -46,12 +46,12 @@
 lst_sid_t LST_INVALID_SID = {LNET_NID_ANY, -1};
 
 static int session_timeout = 100;
-CFS_MODULE_PARM(session_timeout, "i", int, 0444,
-		"test session timeout in seconds (100 by default, 0 == never)");
+module_param(session_timeout, int, 0444);
+MODULE_PARM_DESC(session_timeout, "test session timeout in seconds (100 by default, 0 == never)");
 
 static int rpc_timeout = 64;
-CFS_MODULE_PARM(rpc_timeout, "i", int, 0644,
-		"rpc timeout in seconds (64 by default, 0 == never)");
+module_param(rpc_timeout, int, 0644);
+MODULE_PARM_DESC(rpc_timeout, "rpc timeout in seconds (64 by default, 0 == never)");
 
 #define sfw_unpack_id(id)	       \
 do {				    \
drivers/staging/lustre/lnet/selftest/ping_test.c +2 -1
index f0f9194..a37c3ff 100644
@@ -45,7 +45,8 @@
 #define LST_PING_TEST_MAGIC     0xbabeface
 
 int ping_srv_workitems = SFW_TEST_WI_MAX;
-CFS_MODULE_PARM(ping_srv_workitems, "i", int, 0644, "# PING server workitems");
+module_param(ping_srv_workitems, int, 0644);
+MODULE_PARM_DESC(ping_srv_workitems, "# PING server workitems");
 
 typedef struct {
 	spinlock_t	pnd_lock;	/* serialize */
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +4 -4
index 40c58b7..bbf4291 100644
@@ -49,12 +49,12 @@
 #include "ldlm_internal.h"
 
 static int ldlm_num_threads;
-CFS_MODULE_PARM(ldlm_num_threads, "i", int, 0444,
-		"number of DLM service threads to start");
+module_param(ldlm_num_threads, int, 0444);
+MODULE_PARM_DESC(ldlm_num_threads, "number of DLM service threads to start");
 
 static char *ldlm_cpts;
-CFS_MODULE_PARM(ldlm_cpts, "s", charp, 0444,
-		"CPU partitions ldlm threads should run on");
+module_param(ldlm_cpts, charp, 0444);
+MODULE_PARM_DESC(ldlm_cpts, "CPU partitions ldlm threads should run on");
 
 extern struct kmem_cache *ldlm_resource_slab;
 extern struct kmem_cache *ldlm_lock_slab;
drivers/staging/lustre/lustre/ldlm/ldlm_request.c +2 -2
index 1e2c0dd..0b20fb4 100644
@@ -68,8 +68,8 @@
 #include "ldlm_internal.h"
 
 int ldlm_enqueue_min = OBD_TIMEOUT_DEFAULT;
-CFS_MODULE_PARM(ldlm_enqueue_min, "i", int, 0644,
-		"lock enqueue timeout minimum");
+module_param(ldlm_enqueue_min, int, 0644);
+MODULE_PARM_DESC(ldlm_enqueue_min, "lock enqueue timeout minimum");
 
 /* in client side, whether the cached locks will be canceled before replay */
 unsigned int ldlm_cancel_unused_locks_before_replay = 1;
drivers/staging/lustre/lustre/libcfs/debug.c +21 -21

82 lines not on this page · raw message

drivers/staging/lustre/lustre/libcfs/hash.c +2 -2
index e3e0578..85cbe91 100644
@@ -112,8 +112,8 @@
 
 #if CFS_HASH_DEBUG_LEVEL >= CFS_HASH_DEBUG_1
 static unsigned int warn_on_depth = 8;
-CFS_MODULE_PARM(warn_on_depth, "i", uint, 0644,
-		"warning when hash depth is high.");
+module_param(warn_on_depth, uint, 0644);
+MODULE_PARM_DESC(warn_on_depth, "warning when hash depth is high.");
 #endif
 
 struct cfs_wi_sched *cfs_sched_rehash;
drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c +4 -2
index 00ab8fd..58bb256 100644
@@ -47,7 +47,8 @@
  * >1 : specify number of partitions
  */
 static int	cpu_npartitions;
-CFS_MODULE_PARM(cpu_npartitions, "i", int, 0444, "# of CPU partitions");
+module_param(cpu_npartitions, int, 0444);
+MODULE_PARM_DESC(cpu_npartitions, "# of CPU partitions");
 
 /**
  * modparam for setting CPU partitions patterns:
@@ -61,7 +62,8 @@ CFS_MODULE_PARM(cpu_npartitions, "i", int, 0444, "# of CPU partitions");
  * NB: If user specified cpu_pattern, cpu_npartitions will be ignored
  */
 static char	*cpu_pattern = "";
-CFS_MODULE_PARM(cpu_pattern, "s", charp, 0444, "CPU partitions pattern");
+module_param(cpu_pattern, charp, 0444);
+MODULE_PARM_DESC(cpu_pattern, "CPU partitions pattern");
 
 struct cfs_cpt_data {
 	/* serialize hotplug etc */
drivers/staging/lustre/lustre/llite/lloop.c +2 -1
index e2421ea..5338e8d 100644
@@ -856,7 +856,8 @@ static void lloop_exit(void)
 module_init(lloop_init);
 module_exit(lloop_exit);
 
-CFS_MODULE_PARM(max_loop, "i", int, 0444, "maximum of lloop_device");
+module_param(max_loop, int, 0444);
+MODULE_PARM_DESC(max_loop, "maximum of lloop_device");
 MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
 MODULE_DESCRIPTION("Lustre virtual block device");
 MODULE_LICENSE("GPL");
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +2 -2
index 02d76f8..0f0750b 100644
@@ -49,8 +49,8 @@
 #if defined(LPROCFS)
 
 static int lprocfs_no_percpu_stats = 0;
-CFS_MODULE_PARM(lprocfs_no_percpu_stats, "i", int, 0644,
-		"Do not alloc percpu data for lprocfs stats");
+module_param(lprocfs_no_percpu_stats, int, 0644);
+MODULE_PARM_DESC(lprocfs_no_percpu_stats, "Do not alloc percpu data for lprocfs stats");
 
 #define MAX_STRING_SIZE 128
 
drivers/staging/lustre/lustre/obdclass/lu_object.c +2 -2
index 212823a..d61b0db 100644
@@ -830,8 +830,8 @@ enum {
 };
 
 static unsigned int lu_cache_percent = LU_CACHE_PERCENT_DEFAULT;
-CFS_MODULE_PARM(lu_cache_percent, "i", int, 0644,
-		"Percentage of memory to be used as lu_object cache");
+module_param(lu_cache_percent, int, 0644);
+MODULE_PARM_DESC(lu_cache_percent, "Percentage of memory to be used as lu_object cache");
 
 /**
  * Return desired hash table order.
drivers/staging/lustre/lustre/ptlrpc/pinger.c +2 -1
index a084eb1..1707e61 100644
@@ -45,7 +45,8 @@
 #include "ptlrpc_internal.h"
 
 static int suppress_pings;
-CFS_MODULE_PARM(suppress_pings, "i", int, 0644, "Suppress pings");
+module_param(suppress_pings, int, 0644);
+MODULE_PARM_DESC(suppress_pings, "Suppress pings");
 
 struct mutex pinger_mutex;
 static LIST_HEAD(pinger_imports);
drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +4 -4
index 89c9be96..2ebdb1b 100644
@@ -77,12 +77,12 @@ struct ptlrpcd {
 };
 
 static int max_ptlrpcds;
-CFS_MODULE_PARM(max_ptlrpcds, "i", int, 0644,
-		"Max ptlrpcd thread count to be started.");
+module_param(max_ptlrpcds, int, 0644);
+MODULE_PARM_DESC(max_ptlrpcds, "Max ptlrpcd thread count to be started.");
 
 static int ptlrpcd_bind_policy = PDB_POLICY_PAIR;
-CFS_MODULE_PARM(ptlrpcd_bind_policy, "i", int, 0644,
-		"Ptlrpcd threads binding mode.");
+module_param(ptlrpcd_bind_policy, int, 0644);
+MODULE_PARM_DESC(ptlrpcd_bind_policy, "Ptlrpcd threads binding mode.");
 static struct ptlrpcd *ptlrpcds;
 
 struct mutex ptlrpcd_mutex;
drivers/staging/lustre/lustre/ptlrpc/service.c +13 -13
index 2b10d6d..590fa8d 100644
@@ -44,19 +44,19 @@
 
 /* The following are visible and mutable through /sys/module/ptlrpc */
 int test_req_buffer_pressure = 0;
-CFS_MODULE_PARM(test_req_buffer_pressure, "i", int, 0444,
-		"set non-zero to put pressure on request buffer pools");
-CFS_MODULE_PARM(at_min, "i", int, 0644,
-		"Adaptive timeout minimum (sec)");
-CFS_MODULE_PARM(at_max, "i", int, 0644,
-		"Adaptive timeout maximum (sec)");
-CFS_MODULE_PARM(at_history, "i", int, 0644,
-		"Adaptive timeouts remember the slowest event that took place "
-		"within this period (sec)");
-CFS_MODULE_PARM(at_early_margin, "i", int, 0644,
-		"How soon before an RPC deadline to send an early reply");
-CFS_MODULE_PARM(at_extra, "i", int, 0644,
-		"How much extra time to give with each early reply");
+module_param(test_req_buffer_pressure, int, 0444);
+MODULE_PARM_DESC(test_req_buffer_pressure, "set non-zero to put pressure on request buffer pools");
+module_param(at_min, int, 0644);
+MODULE_PARM_DESC(at_min, "Adaptive timeout minimum (sec)");
+module_param(at_max, int, 0644);
+MODULE_PARM_DESC(at_max, "Adaptive timeout maximum (sec)");
+module_param(at_history, int, 0644);
+MODULE_PARM_DESC(at_history,
+		 "Adaptive timeouts remember the slowest event that took place within this period (sec)");
+module_param(at_early_margin, int, 0644);
+MODULE_PARM_DESC(at_early_margin, "How soon before an RPC deadline to send an early reply");
+module_param(at_extra, int, 0644);
+MODULE_PARM_DESC(at_extra, "How much extra time to give with each early reply");
 
 
 /* forward ref */
Signature · 1 line
1.7.9.5
author
#10 lore raw

PATCH 10/10 staging/lustre/libcfs: remove LI_POISON

In reply to Peng Tao

The extactly same definition exitst in lustre_lib.h.

Cc Andreas Dilger <[email protected]>
---
 .../lustre/include/linux/libcfs/linux/kp30.h       |   10 ----------
 1 file changed, 10 deletions(-)
drivers/staging/lustre/include/linux/libcfs/linux/kp30.h +0 -10
index 8cab09c..5cc7ba0 100644
@@ -70,16 +70,6 @@
 
 #include <linux/libcfs/linux/portals_compat25.h>
 
-/* ------------------------------------------------------------------ */
-
-# define LI_POISON 0x5a5a5a5a
-#if BITS_PER_LONG > 32
-# define LL_POISON 0x5a5a5a5a5a5a5a5aL
-#else
-# define LL_POISON 0x5a5a5a5aL
-#endif
-# define LP_POISON ((void *)LL_POISON)
-
 /* this is a bit chunky */
 
 # define LPU64 "%llu"
Signature · 1 line
1.7.9.5