Fix build if LPROCFS isn't defined to see if this is cause of 2.6.9 x86_64 prob.
b=6471
static inline struct proc_dir_entry *
lprocfs_register(const char *name, struct proc_dir_entry *parent,
struct lprocfs_vars *list, void *data) { return NULL; }
-#define LPROCFS_INIT_VARS(name, vclass, vinstance) do {} while (0)
+#define LPROCFS_INIT_VARS(name, vclass, vinstance)
#define lprocfs_init_vars(...) do {} while (0)
static inline int lprocfs_add_vars(struct proc_dir_entry *root,
struct lprocfs_vars *var,
struct list_head ns_root_list; /* all root resources in ns */
struct lustre_lock ns_lock; /* protects hash, refcount, list */
struct list_head ns_list_chain; /* position in global NS list */
- /*
- struct proc_dir_entry *ns_proc_dir;
- */
struct list_head ns_unused_list; /* all root resources in ns */
int ns_nr_unused;
int ldlm_namespace_cleanup(struct ldlm_namespace *ns, int flags);
int ldlm_namespace_free(struct ldlm_namespace *ns, int force);
int ldlm_proc_setup(void);
+#ifdef LPROCFS
void ldlm_proc_cleanup(void);
+#else
+static inline void ldlm_proc_cleanup(void) {}
+#endif
/* resource.c - internal */
struct ldlm_resource *ldlm_resource_get(struct ldlm_namespace *ns,
void ptlrpcd_decref(void);
/* ptlrpc/lproc_ptlrpc.c */
-#ifdef __KERNEL__
-void ptlrpc_lprocfs_register_obd(struct obd_device *obddev);
-void ptlrpc_lprocfs_unregister_obd(struct obd_device *obddev);
+#ifdef LPROCFS
+void ptlrpc_lprocfs_register_obd(struct obd_device *obd);
+void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd);
#else
-#define ptlrpc_lprocfs_register_obd(param...) do{}while(0)
-#define ptlrpc_lprocfs_unregister_obd(param...) do{}while(0)
+static inline void ptlrpc_lprocfs_register_obd(struct obd_device *obd) {}
+static inline void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd) {}
#endif
/* ptlrpc/llog_server.c */
.o_cleanup = quotfmt_test_cleanup,
};
+#ifdef LPROCFS
static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
LPROCFS_INIT_VARS(quotfmt_test, lprocfs_module_vars, lprocfs_obd_vars)
+#endif
static int __init quotfmt_test_init(void)
{
if (ldlm_state == NULL)
RETURN(-ENOMEM);
-#ifdef __KERNEL__
+#ifdef LPROCFS
rc = ldlm_proc_setup();
if (rc != 0)
GOTO(out_free, rc);
#endif
out_proc:
-#ifdef __KERNEL__
+#ifdef LPROCFS
ldlm_proc_cleanup();
out_free:
#endif
struct proc_dir_entry *ldlm_ns_proc_dir = NULL;
struct proc_dir_entry *ldlm_svc_proc_dir = NULL;
-#ifdef __KERNEL__
+#ifdef LPROCFS
static int ldlm_proc_dump_ns(struct file *file, const char *buffer,
unsigned long count, void *data)
{
lprocfs_add_vars(ldlm_ns_proc_dir, lock_vars, 0);
}
}
-#endif
#undef MAX_STRING_SIZE
+#else
+#define ldlm_proc_namespace(ns) do {} while (0)
+#endif /* LPROCFS */
struct ldlm_namespace *ldlm_namespace_new(char *name, __u32 client)
{
down(&ldlm_namespace_lock);
list_add(&ns->ns_list_chain, &ldlm_namespace_list);
up(&ldlm_namespace_lock);
-#ifdef __KERNEL__
ldlm_proc_namespace(ns);
-#endif
RETURN(ns);
out_hash:
/* At shutdown time, don't call the cancellation callback */
ldlm_namespace_cleanup(ns, 0);
-#ifdef __KERNEL__
+#ifdef LPROCFS
{
struct proc_dir_entry *dir;
dir = lprocfs_srch(ldlm_ns_proc_dir, ns->ns_name);
"of this node.\n", ns->ns_name,
atomic_read(&ns->ns_refcount), rc);
}
- CDEBUG(D_DLMTRACE,
+ CDEBUG(D_DLMTRACE,
"dlm namespace %s free done waiting\n", ns->ns_name);
}
extern spinlock_t inode_lock;
-extern void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi);
extern struct proc_dir_entry *proc_lustre_fs_root;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#endif
/* llite/lproc_llite.c */
+#ifdef LPROCFS
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);
+#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) {}
+#endif
+
/* llite/dir.c */
extern struct file_operations ll_dir_operations;
#include "llite_internal.h"
-/* /proc/lustre/llite mount point registration */
struct proc_dir_entry *proc_lustre_fs_root;
+
+#ifdef LPROCFS
+/* /proc/lustre/llite mount point registration */
struct file_operations llite_dump_pgcache_fops;
struct file_operations ll_ra_stats_fops;
-#ifndef LPROCFS
-int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
- struct super_block *sb, char *osc, char *mdc)
-{
- return 0;
-}
-void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi){}
-#else
-
long long mnt_instance;
static int ll_rd_blksize(char *page, char **start, off_t off, int count,
if (ll_file_data_slab == NULL)
return -ENOMEM;
- proc_lustre_fs_root = proc_lustre_root ?
- proc_mkdir("llite", proc_lustre_root) : NULL;
+ if (proc_lustre_root)
+ proc_lustre_fs_root = proc_mkdir("llite", proc_lustre_root);
ll_register_cache(&ll_cache_definition);
lprocfs_init_vars(lov, &lvars);
lprocfs_obd_setup(obd, lvars.obd_vars);
-#ifdef __KERNEL__
+#ifdef LPROCFS
{
struct proc_dir_entry *entry;
#include <linux/obd_class.h>
#include <linux/seq_file.h>
-#ifndef LPROCFS
-static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
-static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
-#else
-
+#ifdef LPROCFS
static int lov_rd_stripesize(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
.release = seq_release,
};
-#endif /* LPROCFS */
LPROCFS_INIT_VARS(lov, lprocfs_module_vars, lprocfs_obd_vars)
+#endif /* LPROCFS */
.o_cleanup = quotacheck_test_cleanup,
};
+#ifdef LPROCFS
static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
LPROCFS_INIT_VARS(quotacheck_test, lprocfs_module_vars, lprocfs_obd_vars)
+#endif
static int __init quotacheck_test_init(void)
{
.o_cleanup = quotactl_test_cleanup,
};
+#ifdef LPROCFS
static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
LPROCFS_INIT_VARS(quotactl_test, lprocfs_module_vars, lprocfs_obd_vars)
+#endif
static int __init quotactl_test_init(void)
{
#include <linux/obd_class.h>
#include <linux/lprocfs_status.h>
-#ifndef LPROCFS
-static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
-static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
-#else
+#ifdef LPROCFS
static struct lprocfs_vars lprocfs_obd_vars[] = {
{ "uuid", lprocfs_rd_uuid, 0, 0 },
{ "ping", 0, lprocfs_wr_ping, 0 },
{ 0 }
};
+LPROCFS_INIT_VARS(mdc, lprocfs_module_vars, lprocfs_obd_vars)
#endif /* LPROCFS */
-LPROCFS_INIT_VARS(mdc, lprocfs_module_vars, lprocfs_obd_vars)
#include <linux/obd_class.h>
#include <linux/lprocfs_status.h>
-#ifndef LPROCFS
-struct lprocfs_vars lprocfs_mds_obd_vars[] = { {0} };
-struct lprocfs_vars lprocfs_mds_module_vars[] = { {0} };
-struct lprocfs_vars lprocfs_mdt_obd_vars[] = { {0} };
-struct lprocfs_vars lprocfs_mdt_module_vars[] = { {0} };
-
-#else
-
+#ifdef LPROCFS
static int lprocfs_mds_rd_mntdev(char *page, char **start, off_t off, int count,
int *eof, void *data)
{
{ 0 }
};
-#endif
LPROCFS_INIT_VARS(mds, lprocfs_mds_module_vars, lprocfs_mds_obd_vars);
LPROCFS_INIT_VARS(mdt, lprocfs_mdt_module_vars, lprocfs_mdt_obd_vars);
+#endif
EXPORT_SYMBOL(obd_sync_filter);
EXPORT_SYMBOL(ptlrpc_put_connection_superhack);
EXPORT_SYMBOL(ptlrpc_abort_inflight_superhack);
+
+struct proc_dir_entry *proc_lustre_root;
EXPORT_SYMBOL(proc_lustre_root);
EXPORT_SYMBOL(class_register_type);
}
/* Root for /proc/fs/lustre */
-struct proc_dir_entry *proc_lustre_root = NULL;
struct lprocfs_vars lprocfs_base[] = {
{ "version", obd_proc_read_version, NULL, NULL },
{ "kernel_version", obd_proc_read_kernel_version, NULL, NULL },
{ "pinger", obd_proc_read_pinger, NULL, NULL },
{ 0 }
};
+#else
+#define lprocfs_base NULL
+#endif /* LPROCFS */
+#ifdef __KERNEL__
static void *obd_device_list_seq_start(struct seq_file *p, loff_t*pos)
{
if (*pos >= MAX_OBD_DEVICES)
#endif
{
struct obd_device *obd;
-#ifdef LPROCFS
+#ifdef __KERNEL__
struct proc_dir_entry *entry;
#endif
int err;
#ifdef __KERNEL__
obd_sysctl_init();
-#endif
-#ifdef LPROCFS
proc_lustre_root = proc_mkdir("lustre", proc_root_fs);
if (!proc_lustre_root) {
printk(KERN_ERR
obd_cleanup_caches();
obd_sysctl_clean();
-#ifdef LPROCFS
+
if (proc_lustre_root) {
lprocfs_remove(proc_lustre_root);
proc_lustre_root = NULL;
}
-#endif
class_handle_cleanup();
class_exit_uuidlist();
.o_llog_finish = llog_test_llog_finish,
};
+#ifdef LPROCFS
static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
LPROCFS_INIT_VARS(llog_test, lprocfs_module_vars, lprocfs_obd_vars)
+#endif
static int __init llog_test_init(void)
{
#include <linux/lprocfs_status.h>
#include <linux/lustre_fsfilt.h>
-#if defined(LPROCFS) && defined(__KERNEL__)
+#if defined(LPROCFS)
struct proc_dir_entry *lprocfs_srch(struct proc_dir_entry *head,
const char *name)
}
EXPORT_SYMBOL(lprocfs_obd_rd_recovery_status);
-#endif /* LPROCFS*/
-
EXPORT_SYMBOL(lprocfs_register);
EXPORT_SYMBOL(lprocfs_srch);
EXPORT_SYMBOL(lprocfs_remove);
EXPORT_SYMBOL(lprocfs_write_helper);
EXPORT_SYMBOL(lprocfs_write_u64_helper);
+#endif /* LPROCFS*/
#include <linux/lprocfs_status.h>
#include <linux/obd_class.h>
-#ifndef LPROCFS
-static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
-static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
-#else
-
+#ifdef LPROCFS
static struct lprocfs_vars lprocfs_obd_vars[] = {
{ "uuid", lprocfs_rd_uuid, 0, 0 },
{ 0 }
{ 0 }
};
-#endif /* LPROCFS */
LPROCFS_INIT_VARS(echo, lprocfs_module_vars, lprocfs_obd_vars)
+#endif /* LPROCFS */
int filter_san_preprw(int cmd, struct obd_export *, struct obdo *, int objcount,
struct obd_ioobj *, int niocount, struct niobuf_remote *);
-#ifdef __KERNEL__
+#ifdef LPROCFS
void filter_tally_write(struct filter_obd *filter, struct page **pages,
- int nr_pages, unsigned long *blocks,
+ int nr_pages, unsigned long *blocks,
int blocks_per_page);
-void filter_tally_read(struct filter_obd *filter, struct niobuf_local *lnb,
+void filter_tally_read(struct filter_obd *filter, struct niobuf_local *lnb,
int niocount);
int lproc_filter_attach_seqstat(struct obd_device *dev);
#else
-static inline filter_tally_write(struct filter_obd *filter,
- struct page **pages, int nr_pages,
+static inline void filter_tally_write(struct filter_obd *filter,
+ struct page **pages, int nr_pages,
unsigned long *blocks, int blocks_per_page) {}
-static inline void filter_tally_read(struct filter_obd *filter,
+static inline void filter_tally_read(struct filter_obd *filter,
struct niobuf_local *lnb, int niocount)
{}
-static inline lproc_filter_attach_seqstat(struct obd_device *dev) {}
+static inline int lproc_filter_attach_seqstat(struct obd_device *dev){return 0;}
#endif
#include "filter_internal.h"
-#ifndef LPROCFS
-static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
-static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
-#else
-
+#ifdef LPROCFS
static int lprocfs_filter_rd_groups(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
&filter_brw_stats_fops, dev);
}
-
-
-#endif /* LPROCFS */
LPROCFS_INIT_VARS(filter, lprocfs_module_vars, lprocfs_obd_vars)
+#endif /* LPROCFS */
#include <linux/seq_file.h>
#include "osc_internal.h"
-#ifndef LPROCFS
-static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
-static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
-#else
-
+#ifdef LPROCFS
static int osc_rd_max_pages_per_rpc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
&osc_rpc_stats_fops, dev);
}
-#endif /* LPROCFS */
LPROCFS_INIT_VARS(osc, lprocfs_module_vars, lprocfs_obd_vars)
+#endif /* LPROCFS */
int osc_qinfo_init(void);
void osc_qinfo_exit(void);
-#ifdef __KERNEL__
+#ifdef LPROCFS
int lproc_osc_attach_seqstat(struct obd_device *dev);
#else
static inline int lproc_osc_attach_seqstat(struct obd_device *dev) {return 0;}
list_splice(&rpc_list, &aa->aa_oaps);
INIT_LIST_HEAD(&rpc_list);
-#ifdef __KERNEL__
+#ifdef LPROCFS
if (cmd == OBD_BRW_READ) {
lprocfs_oh_tally_log2(&cli->cl_read_page_hist, page_count);
lprocfs_oh_tally(&cli->cl_read_rpc_hist, cli->cl_r_in_flight);
.o_quotactl = osc_quotactl,
};
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#if defined(__KERNEL__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
struct obd_ops sanosc_obd_ops = {
.o_owner = THIS_MODULE,
.o_cleanup = client_obd_cleanup,
int __init osc_init(void)
{
struct lprocfs_static_vars lvars;
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#if defined(__KERNEL__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
struct lprocfs_static_vars sanlvars;
#endif
int rc;
ENTRY;
lprocfs_init_vars(osc, &lvars);
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#if defined(__KERNEL__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
lprocfs_init_vars(osc, &sanlvars);
#endif
if (rc)
RETURN(rc);
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#if defined(__KERNEL__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
rc = class_register_type(&sanosc_obd_ops, sanlvars.module_vars,
LUSTRE_SANOSC_NAME);
if (rc)
class_unregister_type(LUSTRE_OSC_NAME);
#endif
-
+
rc = osc_qinfo_init();
RETURN(rc);
static void /*__exit*/ osc_exit(void)
{
osc_qinfo_exit();
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#if defined(__KERNEL__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
class_unregister_type(LUSTRE_SANOSC_NAME);
#endif
class_unregister_type(LUSTRE_OSC_NAME);
#include <linux/seq_file.h>
#include "ost_internal.h"
-#ifndef LPROCFS
-static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
-static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
-#else
+#ifdef LPROCFS
static struct lprocfs_vars lprocfs_obd_vars[] = {
{ "uuid", lprocfs_rd_uuid, 0, 0 },
{ 0 }
}
}
-#endif /* LPROCFS */
LPROCFS_INIT_VARS(ost, lprocfs_module_vars, lprocfs_obd_vars)
+#endif /* LPROCFS */
return ll_rpc_opcode_table[offset].opname;
}
-#ifndef LPROCFS
-void ptlrpc_lprocfs_register_service(struct obd_device *obddev,
- struct ptlrpc_service *svc) { return ; }
-void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc) { return; }
-#else
-
+#ifdef LPROCFS
void ptlrpc_lprocfs_register(struct proc_dir_entry *root, char *dir,
char *name, struct proc_dir_entry **procroot_ret,
struct lprocfs_stats **stats_ret)
int count, int *eof, void *data)
{
struct ptlrpc_service *svc = data;
-
+
*eof = 1;
return snprintf(page, count, "%d\n", svc->srv_n_history_rqbds);
}
int count, int *eof, void *data)
{
struct ptlrpc_service *svc = data;
-
+
*eof = 1;
return snprintf(page, count, "%d\n", svc->srv_max_history_rqbds);
}
unsigned long flags;
int val;
int rc = lprocfs_write_helper(buffer, count, &val);
-
+
if (rc < 0)
return rc;
bufpages = (svc->srv_buf_size + PAGE_SIZE - 1)/PAGE_SIZE;
if (val > num_physpages/(2*bufpages))
return -ERANGE;
-
+
spin_lock_irqsave(&svc->srv_lock, flags);
svc->srv_max_history_rqbds = val;
spin_unlock_irqrestore(&svc->srv_lock, flags);
-
+
return count;
}
srhi->srhi_seq <= seq) {
/* If srhi_req was set previously, hasn't been culled and
* we're searching for a seq on or after it (i.e. more
- * recent), search from it onwards.
+ * recent), search from it onwards.
* Since the service history is LRU (i.e. culled reqs will
* be near the head), we shouldn't have to do long
* re-scans */
while (e != &svc->srv_request_history) {
req = list_entry(e, struct ptlrpc_request, rq_history_list);
-
+
if (req->rq_history_seq >= seq) {
srhi->srhi_seq = req->rq_history_seq;
srhi->srhi_req = req;
}
e = e->next;
}
-
+
return -ENOENT;
}
srhi->srhi_seq = 0;
srhi->srhi_req = NULL;
-
+
spin_lock_irqsave(&svc->srv_lock, flags);
rc = ptlrpc_lprocfs_svc_req_history_seek(svc, srhi, *pos);
spin_unlock_irqrestore(&svc->srv_lock, flags);
-
+
if (rc == 0) {
*pos = srhi->srhi_seq;
return srhi;
}
-
+
OBD_FREE(srhi, sizeof(*srhi));
return NULL;
}
}
static void *
-ptlrpc_lprocfs_svc_req_history_next(struct seq_file *s,
+ptlrpc_lprocfs_svc_req_history_next(struct seq_file *s,
void *iter, loff_t *pos)
{
struct ptlrpc_service *svc = s->private;
struct ptlrpc_service *svc)
{
struct lprocfs_vars lproc_vars[] = {
- {.name = "req_buffer_history_len",
+ {.name = "req_buffer_history_len",
.write_fptr = NULL,
- .read_fptr = ptlrpc_lprocfs_read_req_history_len,
+ .read_fptr = ptlrpc_lprocfs_read_req_history_len,
.data = svc},
{.name = "req_buffer_history_max",
.write_fptr = ptlrpc_lprocfs_write_req_history_max,
- .read_fptr = ptlrpc_lprocfs_read_req_history_max,
+ .read_fptr = ptlrpc_lprocfs_read_req_history_max,
.data = svc},
{NULL}
};
ptlrpc_lprocfs_register(entry, svc->srv_name,
"stats", &svc->srv_procroot,
&svc->srv_stats);
-
+
if (svc->srv_procroot == NULL)
return;
lprocfs_add_vars(svc->srv_procroot, lproc_vars, NULL);
- req_history = create_proc_entry("req_history", 0400,
+ req_history = create_proc_entry("req_history", 0400,
svc->srv_procroot);
if (req_history != NULL) {
req_history->data = svc;
&obddev->obd_svc_procroot,
&obddev->obd_svc_stats);
}
+EXPORT_SYMBOL(ptlrpc_lprocfs_register_obd);
void ptlrpc_lprocfs_rpc_sent(struct ptlrpc_request *req)
{
obd->obd_svc_stats = NULL;
}
}
+EXPORT_SYMBOL(ptlrpc_lprocfs_unregister_obd);
+
int lprocfs_wr_evict_client(struct file *file, const char *buffer,
unsigned long count, void *data)
void ptlrpc_initiate_recovery(struct obd_import *imp);
-#ifdef __KERNEL__
+#ifdef LPROCFS
void ptlrpc_lprocfs_register_service(struct proc_dir_entry *proc_entry,
struct ptlrpc_service *svc);
void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc);
EXPORT_SYMBOL(ptlrpcd_add_req);
EXPORT_SYMBOL(ptlrpcd_wake);
-/* lproc_ptlrpc.c */
-EXPORT_SYMBOL(ptlrpc_lprocfs_register_obd);
-EXPORT_SYMBOL(ptlrpc_lprocfs_unregister_obd);
-
/* llogd.c */
EXPORT_SYMBOL(llog_origin_handle_create);
EXPORT_SYMBOL(llog_origin_handle_next_block);