EXTRA_DIST = kp30.h libcfs.h linux-fs.h linux-lock.h linux-mem.h \
linux-prim.h linux-time.h linux-tcpip.h linux-cpu.h \
- portals_compat25.h linux-crypto.h
+ linux-crypto.h
#include <linux/moduleparam.h>
#include <linux/scatterlist.h>
-#include <libcfs/linux/portals_compat25.h>
-
/******************************************************************************/
/* Module parameter support */
#define CFS_MODULE_PARM(name, t, type, perm, desc) \
*/
#define CFS_CURPROC_COMM_MAX (sizeof ((struct task_struct *)0)->comm)
+/* helper for sysctl handlers */
+int lprocfs_call_handler(void *data, int write, loff_t *ppos, void *buffer,
+ size_t *lenp, int (*handler)(void *data, int write,
+ loff_t pos, void *buffer, int len));
+
#include <linux/capability.h>
/*
#endif
#include <linux/user_namespace.h>
#include <linux/miscdevice.h>
-#include <libcfs/linux/portals_compat25.h>
#include <asm/div64.h>
#include <libcfs/linux/linux-time.h>
#define NR_CPUS 1
#endif
-#define DECLARE_PROC_HANDLER(name) \
-static int \
-LL_PROC_PROTO(name) \
-{ \
- return proc_call_handler(table->data, write, \
- ppos, buffer, lenp, \
- __##name); \
-}
-
/*
* Wait Queue
*/
#endif
#include <net/sock.h>
-#include <libcfs/linux/portals_compat25.h>
#ifndef HIPQUAD
// XXX Should just kill all users
#include <linux/time.h>
#include <asm/div64.h>
-#include <libcfs/linux/portals_compat25.h>
-
/*
* post 2.5 kernels.
*/
+++ /dev/null
-/*
- * 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, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, 2013, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- */
-
-#ifndef __LIBCFS_LINUX_PORTALS_COMPAT_H__
-#define __LIBCFS_LINUX_PORTALS_COMPAT_H__
-
-#define LL_PROC_PROTO(name) \
- name(struct ctl_table *table, int write, \
- void __user *buffer, size_t *lenp, loff_t *ppos)
-
-/* helper for sysctl handlers */
-int proc_call_handler(void *data, int write,
- loff_t *ppos, void *buffer, size_t *lenp,
- int (*handler)(void *data, int write,
- loff_t pos, void *buffer, int len));
-
-#ifdef HAVE_INIT_NET
-# define DEFAULT_NET (&init_net)
-#else
-/* some broken backports */
-# define DEFAULT_NET (NULL)
-#endif
-
-#endif /* _PORTALS_COMPAT_H */
# define DEBUG_SUBSYSTEM S_LNET
#include <libcfs/libcfs.h>
-#include <libcfs/linux/portals_compat25.h>
#include "tracefile.h"
*/
extern char lnet_debug_log_upcall[1024];
-int
-proc_call_handler(void *data, int write,
- loff_t *ppos, void *buffer, size_t *lenp,
- int (*handler)(void *data, int write,
- loff_t pos, void *buffer, int len))
+int lprocfs_call_handler(void *data, int write, loff_t *ppos, void *buffer,
+ size_t *lenp, int (*handler)(void *data, int write,
+ loff_t pos, void *buffer, int len))
{
int rc = handler(data, write, *ppos, buffer, *lenp);
}
return 0;
}
-EXPORT_SYMBOL(proc_call_handler);
+EXPORT_SYMBOL(lprocfs_call_handler);
static int __proc_dobitmasks(void *data, int write,
loff_t pos, void *buffer, int nob)
return rc;
}
-DECLARE_PROC_HANDLER(proc_dobitmasks)
+static int
+proc_dobitmasks(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+ return lprocfs_call_handler(table->data, write, ppos, buffer, lenp,
+ __proc_dobitmasks);
+}
static int min_watchdog_ratelimit = 0; /* disable ratelimiting */
static int max_watchdog_ratelimit = (24*60*60); /* limit to once per day */
return cfs_trace_dump_debug_buffer_usrstr(buffer, nob);
}
-DECLARE_PROC_HANDLER(proc_dump_kernel)
+static int
+proc_dump_kernel(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
+{
+ return lprocfs_call_handler(table->data, write, ppos, buffer, lenp,
+ __proc_dump_kernel);
+}
static int __proc_daemon_file(void *data, int write,
loff_t pos, void *buffer, int nob)
return cfs_trace_daemon_command_usrstr(buffer, nob);
}
-DECLARE_PROC_HANDLER(proc_daemon_file)
+static int
+proc_daemon_file(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
+{
+ return lprocfs_call_handler(table->data, write, ppos, buffer, lenp,
+ __proc_daemon_file);
+}
static int __proc_debug_mb(void *data, int write,
loff_t pos, void *buffer, int nob)
return cfs_trace_set_debug_mb_usrstr(buffer, nob);
}
-DECLARE_PROC_HANDLER(proc_debug_mb)
+static int
+proc_debug_mb(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
+{
+ return lprocfs_call_handler(table->data, write, ppos, buffer, lenp,
+ __proc_debug_mb);
+}
-int LL_PROC_PROTO(proc_console_max_delay_cs)
+static int
+proc_console_max_delay_cs(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp, loff_t *ppos)
{
int rc, max_delay_cs;
struct ctl_table dummy = *table;
return rc;
}
-int LL_PROC_PROTO(proc_console_min_delay_cs)
+static int
+proc_console_min_delay_cs(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp, loff_t *ppos)
{
int rc, min_delay_cs;
struct ctl_table dummy = *table;
return rc;
}
-int LL_PROC_PROTO(proc_console_backoff)
+static int
+proc_console_backoff(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
{
int rc, backoff;
struct ctl_table dummy = *table;
return rc;
}
-int LL_PROC_PROTO(libcfs_force_lbug)
+static int
+libcfs_force_lbug(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
{
if (write)
LBUG();
return 0;
}
-int LL_PROC_PROTO(proc_fail_loc)
+static int
+proc_fail_loc(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
{
int rc;
long old_fail_loc = cfs_fail_loc;
LIBCFS_FREE(buf, len);
return rc;
}
-DECLARE_PROC_HANDLER(proc_cpt_table)
+
+static int
+proc_cpt_table(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
+{
+ return lprocfs_call_handler(table->data, write, ppos, buffer, lenp,
+ __proc_cpt_table);
+}
static struct ctl_table lnet_table[] = {
/*
static struct ctl_table_header *kgnilnd_table_header = NULL;
-static int LL_PROC_PROTO(proc_toggle_thread_pause)
+static int
+proc_toggle_thread_pause(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp, loff_t *ppos)
{
int old_val = kgnilnd_sysctl.ksd_pause_trigger;
int rc = 0;
RETURN(rc);
}
-static int LL_PROC_PROTO(proc_hw_quiesce)
+static int
+proc_hw_quiesce(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
{
int rc = 0;
kgn_device_t *dev;
RETURN(rc);
}
-int LL_PROC_PROTO(proc_trigger_stack_reset)
+static int
+proc_trigger_stack_reset(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp, loff_t *ppos)
{
int rc = 0;
int i = 1;
RETURN(rc);
}
-static int LL_PROC_PROTO(proc_toggle_rdmaq_override)
+static int
+proc_toggle_rdmaq_override(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp, loff_t *ppos)
{
int old_val = kgnilnd_sysctl.ksd_rdmaq_override;
int rc = 0;
/* /proc/sys entry point for injecting up/down nid event
* <up|down> <nid>
*/
-static int LL_PROC_PROTO(proc_peer_state)
+static int
+proc_peer_state(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
{
int rc;
int nid;
#include <linux/syscalls.h>
#include <libcfs/libcfs.h>
-#include <libcfs/linux/portals_compat25.h>
#include <linux/crc32.h>
static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len)
return rc;
}
-DECLARE_PROC_HANDLER(proc_lnet_stats);
+static int
+proc_lnet_stats(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
+{
+ return lprocfs_call_handler(table->data, write, ppos, buffer, lenp,
+ __proc_lnet_stats);
+}
-int LL_PROC_PROTO(proc_lnet_routes)
+static int
+proc_lnet_routes(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
{
const int tmpsiz = 256;
char *tmpstr;
return rc;
}
-int LL_PROC_PROTO(proc_lnet_routers)
+static int
+proc_lnet_routers(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
{
int rc = 0;
char *tmpstr;
return rc;
}
-int LL_PROC_PROTO(proc_lnet_peers)
+static int
+proc_lnet_peers(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
{
const int tmpsiz = 256;
struct lnet_peer_table *ptable;
return rc;
}
-DECLARE_PROC_HANDLER(proc_lnet_buffers);
+static int
+proc_lnet_buffers(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
+{
+ return lprocfs_call_handler(table->data, write, ppos, buffer, lenp,
+ __proc_lnet_buffers);
+}
-int LL_PROC_PROTO(proc_lnet_nis)
+static int
+proc_lnet_nis(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
{
int tmpsiz = 128 * LNET_CPT_NUMBER;
int rc = 0;
LIBCFS_FREE(buf, buf_len);
return rc;
}
-DECLARE_PROC_HANDLER(proc_lnet_portal_rotor);
+
+static int
+proc_lnet_portal_rotor(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
+{
+ return lprocfs_call_handler(table->data, write, ppos, buffer, lenp,
+ __proc_lnet_portal_rotor);
+}
+
static struct ctl_table lnet_table[] = {
/*
#include <linux/fs_struct.h>
#include <linux/namei.h>
-#include <libcfs/linux/portals_compat25.h>
#include <linux/lustre_patchless_compat.h>
struct ctl_table_header *obd_table_header = NULL;
#endif
-int LL_PROC_PROTO(proc_set_timeout)
+static int
+proc_set_timeout(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
{
int rc;
return rc;
}
-int LL_PROC_PROTO(proc_memory_alloc)
+static int
+proc_memory_alloc(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
{
char buf[22];
int len;
return 0;
}
-int LL_PROC_PROTO(proc_pages_alloc)
+static int
+proc_pages_alloc(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
{
char buf[22];
int len;
return 0;
}
-int LL_PROC_PROTO(proc_mem_max)
+static int
+proc_mem_max(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
{
char buf[22];
int len;
return 0;
}
-int LL_PROC_PROTO(proc_pages_max)
+static int
+proc_pages_max(struct ctl_table *table, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
{
char buf[22];
int len;
return 0;
}
-int LL_PROC_PROTO(proc_max_dirty_pages_in_mb)
+static int
+proc_max_dirty_pages_in_mb(struct ctl_table *table, int write,
+ void __user *buffer, size_t *lenp, loff_t *ppos)
{
int rc = 0;
}
#endif
-int LL_PROC_PROTO(proc_bulk_timeout)
-{
- return proc_dointvec(table, write, buffer, lenp, ppos);
-}
-int LL_PROC_PROTO(proc_at_min)
-{
- return proc_dointvec(table, write, buffer, lenp, ppos);
-}
-int LL_PROC_PROTO(proc_at_max)
-{
- return proc_dointvec(table, write, buffer, lenp, ppos);
-}
-int LL_PROC_PROTO(proc_at_extra)
-{
- return proc_dointvec(table, write, buffer, lenp, ppos);
-}
-int LL_PROC_PROTO(proc_at_early_margin)
-{
- return proc_dointvec(table, write, buffer, lenp, ppos);
-}
-int LL_PROC_PROTO(proc_at_history)
-{
- return proc_dointvec(table, write, buffer, lenp, ppos);
-}
-
#ifdef CONFIG_SYSCTL
static struct ctl_table obd_table[] = {
{
.data = &bulk_timeout,
.maxlen = sizeof(int),
.mode = 0644,
- .proc_handler = &proc_bulk_timeout
+ .proc_handler = &proc_dointvec
},
{
INIT_CTL_NAME
.data = &at_min,
.maxlen = sizeof(int),
.mode = 0644,
- .proc_handler = &proc_at_min
+ .proc_handler = &proc_dointvec
},
{
INIT_CTL_NAME
.data = &at_max,
.maxlen = sizeof(int),
.mode = 0644,
- .proc_handler = &proc_at_max
+ .proc_handler = &proc_dointvec
},
{
INIT_CTL_NAME
.data = &at_extra,
.maxlen = sizeof(int),
.mode = 0644,
- .proc_handler = &proc_at_extra
+ .proc_handler = &proc_dointvec
},
{
INIT_CTL_NAME
.data = &at_early_margin,
.maxlen = sizeof(int),
.mode = 0644,
- .proc_handler = &proc_at_early_margin
+ .proc_handler = &proc_dointvec
},
{
INIT_CTL_NAME
.data = &at_history,
.maxlen = sizeof(int),
.mode = 0644,
- .proc_handler = &proc_at_history
+ .proc_handler = &proc_dointvec
},
{ 0 }
};