Whamcloud - gitweb
b=15534
authorpravins <pravins>
Tue, 15 Sep 2009 11:13:06 +0000 (11:13 +0000)
committerpravins <pravins>
Tue, 15 Sep 2009 11:13:06 +0000 (11:13 +0000)
i=rahul.deshmukh
i=yong.fan
fix fail_loc proc handler

libcfs/include/libcfs/linux/portals_compat25.h
lustre/obdclass/linux/linux-sysctl.c

index 38906e9..4f47b82 100644 (file)
@@ -140,24 +140,16 @@ typedef unsigned long cpumask_t;
 #define __user
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
-#define ll_proc_dointvec(table, write, filp, buffer, lenp, ppos)        \
-        proc_dointvec(table, write, filp, buffer, lenp)
-#define ll_proc_dostring(table, write, filp, buffer, lenp, ppos)        \
-        proc_dostring(table, write, filp, buffer, lenp)
-#define LL_PROC_PROTO(name)                                             \
-        name(cfs_sysctl_table_t *table, int write, struct file *filp,   \
-             void __user *buffer, size_t *lenp)
-#define DECLARE_LL_PROC_PPOS_DECL  loff_t *ppos = &filp->f_pos
-#else
 #define ll_proc_dointvec(table, write, filp, buffer, lenp, ppos)        \
         proc_dointvec(table, write, filp, buffer, lenp, ppos);
+
+#define ll_proc_dolongvec(table, write, filp, buffer, lenp, ppos)        \
+        proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos);
 #define ll_proc_dostring(table, write, filp, buffer, lenp, ppos)        \
         proc_dostring(table, write, filp, buffer, lenp, ppos);
 #define LL_PROC_PROTO(name)                                             \
         name(cfs_sysctl_table_t *table, int write, struct file *filp,   \
              void __user *buffer, size_t *lenp, loff_t *ppos)
 #define DECLARE_LL_PROC_PPOS_DECL
-#endif
 
 #endif /* _PORTALS_COMPAT_H */
index 3d26e98..24f50e6 100644 (file)
@@ -85,7 +85,7 @@ int LL_PROC_PROTO(proc_fail_loc)
         int rc;
         long old_fail_loc = obd_fail_loc;
 
-        rc = ll_proc_dointvec(table, write, filp, buffer, lenp, ppos);
+        rc = ll_proc_dolongvec(table, write, filp, buffer, lenp, ppos);
         if (old_fail_loc != obd_fail_loc)
                 wake_up(&obd_race_waitq);
         return rc;
@@ -297,7 +297,7 @@ static cfs_sysctl_table_t obd_table[] = {
                 .ctl_name = OBD_FAIL_LOC,
                 .procname = "fail_loc",
                 .data     = &obd_fail_loc,
-                .maxlen   = sizeof(int),
+                .maxlen   = sizeof(obd_fail_loc),
                 .mode     = 0644,
                 .proc_handler = &proc_fail_loc
         },