On Wednesday 20 June 2007 10:23:13 Michael Menge wrote:
> Hi,
>
> thanks for the help, but i still have some trouble to build a patchles
> client for lustre-1.6.0.1 on RHEL5 x86_64
>
> I patched lustre-1.6.0.1 with export_truncate_page.diff and
> patchless-2.6.21-rhel5.diff but the file
> lnet/include/libcfs/winnt/kp30.h was missing for the patch to succeed.
>
> /configure --with-linux=/usr/src/kernels/2.6.18-8.1.4.el5-x86_64/
> CC=/usr/bin/gcc34
>
> showed no errors, but make had the following error:
>
> In file included from
> /tmp/lustre-1.6.0.1/lnet/libcfs/linux/linux-proc.c:30:
> include/linux/config.h:6:2: warning: #warning Including config.h is
> deprecated.
> /tmp/lustre-1.6.0.1/lnet/libcfs/linux/linux-proc.c: In function
> `insert_proc': /tmp/lustre-1.6.0.1/lnet/libcfs/linux/linux-proc.c:235:
> error: too few arguments to function `register_sysctl_table'
> make[6]: *** [/tmp/lustre-1.6.0.1/lnet/libcfs/linux/linux-proc.o] Error 1
> make[5]: *** [/tmp/lustre-1.6.0.1/lnet/libcfs] Error 2
> make[4]: *** [/tmp/lustre-1.6.0.1/lnet] Error 2
> make[3]: *** [_module_/tmp/lustre-1.6.0.1] Error 2
> make[3]: Leaving directory `/usr/src/kernels/2.6.18-8.1.4.el5-x86_64'
> make[2]: *** [modules] Error 2
> make[2]: Leaving directory `/tmp/lustre-1.6.0.1'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/tmp/lustre-1.6.0.1'
> make: *** [all] Error 2
>
> Whats wrong?
See the attached patch.
Greetings from Tübingen ;) ,
Bernd
--
Bernd Schubert
Q-Leap Networks GmbH
diff -r 01ab6291ab08 lnet/libcfs/linux/linux-proc.c
--- a/lnet/libcfs/linux/linux-proc.c Mon Jun 11 16:16:32 2007 +0200
+++ b/lnet/libcfs/linux/linux-proc.c Mon Jun 11 16:29:36 2007 +0200
@@ -61,6 +61,8 @@
static struct ctl_table_header *lnet_table_header = NULL;
extern char lnet_upcall[1024];
+
+extern struct ctl_table top_table[2];
#define PSDEV_LNET (0x100)
enum {
@@ -77,6 +79,86 @@ enum {
int LL_PROC_PROTO(proc_dobitmasks);
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
+static struct ctl_table lnet_table[] = {
+ {.ctl_name = PSDEV_DEBUG,
+ .procname = "debug",
+ .data = &libcfs_debug,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .child = NULL,
+ .parent = top_table,
+ .proc_handler = &proc_dobitmasks},
+
+ {.ctl_name = PSDEV_SUBSYSTEM_DEBUG,
+ .procname = "subsystem_debug",
+ .data = &libcfs_subsystem_debug,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .child = NULL,
+ .parent = top_table,
+ .proc_handler = &proc_dobitmasks},
+
+ {.ctl_name = PSDEV_PRINTK,
+ .procname = "printk",
+ .data = &libcfs_printk,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .child = NULL,
+ .parent = top_table,
+ .proc_handler = &proc_dobitmasks},
+
+ {.ctl_name = PSDEV_CONSOLE_RATELIMIT,
+ .procname = "console_ratelimit",
+ .data = &libcfs_console_ratelimit,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .child = NULL,
+ .parent = top_table,
+ .proc_handler = &proc_dointvec},
+
+ {.ctl_name = PSDEV_DEBUG_PATH,
+ .procname = "debug_path",
+ .data = debug_file_path,
+ .maxlen = sizeof(debug_file_path),
+ .mode = 0644,
+ .child = NULL,
+ .parent = top_table,
+ .proc_handler = &proc_dostring,
+ .strategy = &sysctl_string},
+
+ {.ctl_name = PSDEV_LNET_UPCALL,
+ .procname = "upcall",
+ .data = lnet_upcall,
+ .maxlen = sizeof(lnet_upcall),
+ .mode = 0644,
+ .child = NULL,
+ .parent = top_table,
+ .proc_handler = &proc_dostring,
+ .strategy = &sysctl_string},
+
+ {.ctl_name = PSDEV_LNET_MEMUSED,
+ .procname = "memused",
+ .data = (int *)&libcfs_kmemory.counter,
+ .maxlen = sizeof(int),
+ .mode = 0444,
+ .child = NULL,
+ .parent = top_table,
+ .proc_handler = &proc_dointvec},
+
+ {.ctl_name = PSDEV_LNET_CATASTROPHE,
+ .procname = "catastrophe",
+ .data = &libcfs_catastrophe,
+ .maxlen = sizeof(int),
+ .mode = 0444,
+ .child = NULL,
+ .parent = top_table,
+ .proc_handler = &proc_dointvec},
+
+ {0}
+};
+#else
static struct ctl_table lnet_table[] = {
{PSDEV_DEBUG, "debug", &libcfs_debug, sizeof(int), 0644, NULL,
&proc_dobitmasks},
@@ -97,9 +179,15 @@ static struct ctl_table lnet_table[] = {
sizeof(int), 0444, NULL, &proc_dointvec},
{0}
};
+#endif
static struct ctl_table top_table[2] = {
- {PSDEV_LNET, "lnet", NULL, 0, 0555, lnet_table},
+ {.ctl_name = PSDEV_LNET,
+ .procname = "lnet",
+ .data = NULL,
+ .maxlen = 0,
+ .mode = 0555,
+ .child = lnet_table},
{0}
};
@@ -172,10 +260,24 @@ int insert_proc(void)
{
struct proc_dir_entry *ent;
+ ent = proc_mkdir("sys/lnet", NULL);
+ if (ent == NULL) {
+ CERROR("couldn't create /proc/sys/lnet \n");
+ return -1;
+ }
+
#ifdef CONFIG_SYSCTL
if (!lnet_table_header)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
+ lnet_table_header = register_sysctl_table(top_table);
+#else
lnet_table_header = register_sysctl_table(top_table, 0);
#endif
+#endif
+ if (!lnet_table_header) {
+ CERROR("registering top_table failed\n");
+ return -1;
+ }
ent = create_proc_entry("sys/lnet/dump_kernel", 0, NULL);
if (ent == NULL) {
diff -r 01ab6291ab08 lustre/obdclass/linux/linux-sysctl.c
--- a/lustre/obdclass/linux/linux-sysctl.c Mon Jun 11 16:16:32 2007 +0200
+++ b/lustre/obdclass/linux/linux-sysctl.c Mon Jun 11 16:16:32 2007 +0200
@@ -82,6 +82,26 @@ int LL_PROC_PROTO(proc_set_timeout)
return rc;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
+static ctl_table obd_table[] = {
+ {OBD_FAIL_LOC, "fail_loc", &obd_fail_loc, sizeof(int), 0644, NULL,
+ NULL, &proc_fail_loc},
+ {OBD_TIMEOUT, "timeout", &obd_timeout, sizeof(int), 0644, NULL,
+ NULL, &proc_set_timeout},
+ {OBD_DEBUG_PEER_ON_TIMEOUT, "debug_peer_on_timeout",
+ &obd_debug_peer_on_timeout,
+ sizeof(int), 0644, NULL, NULL, &proc_dointvec},
+ {OBD_DUMP_ON_TIMEOUT, "dump_on_timeout", &obd_dump_on_timeout,
+ sizeof(int), 0644, NULL, NULL, &proc_dointvec},
+ {OBD_DUMP_ON_EVICTION, "dump_on_eviction", &obd_dump_on_eviction,
+ sizeof(int), 0644, NULL, NULL, &proc_dointvec},
+ {OBD_MEMUSED, "memused", (int *)&obd_memory.counter,
+ sizeof(int), 0644, NULL, NULL, &proc_dointvec},
+ {OBD_LDLM_TIMEOUT, "ldlm_timeout", &ldlm_timeout, sizeof(int), 0644,
+ NULL, NULL, &proc_set_timeout},
+ { 0 }
+};
+#else
static ctl_table obd_table[] = {
{OBD_FAIL_LOC, "fail_loc", &obd_fail_loc, sizeof(int), 0644, NULL,
&proc_fail_loc},
@@ -100,6 +120,7 @@ static ctl_table obd_table[] = {
NULL, &proc_set_timeout},
{ 0 }
};
+#endif
static ctl_table parent_table[] = {
{OBD_SYSCTL, "lustre", NULL, 0, 0555, obd_table},
@@ -110,7 +131,11 @@ void obd_sysctl_init (void)
{
#ifdef CONFIG_SYSCTL
if ( !obd_table_header )
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
+ obd_table_header = register_sysctl_table(parent_table);
+#else
obd_table_header = register_sysctl_table(parent_table, 0);
+#endif
#endif
}
_______________________________________________
Lustre-discuss mailing list
[email protected]
https://mail.clusterfs.com/mailman/listinfo/lustre-discuss