* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2013, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#include <linux/seq_file.h>
#include "osc_internal.h"
-#ifdef LPROCFS
+#ifdef CONFIG_PROC_FS
static int osc_active_seq_show(struct seq_file *m, void *v)
{
struct obd_device *dev = m->private;
chunk_mask = ~((1 << (cli->cl_chunkbits - PAGE_CACHE_SHIFT)) - 1);
/* max_pages_per_rpc must be chunk aligned */
val = (val + ~chunk_mask) & chunk_mask;
- if (val == 0 || val > ocd->ocd_brw_size >> PAGE_CACHE_SHIFT) {
+ if (val == 0 || (ocd->ocd_brw_size != 0 &&
+ val > ocd->ocd_brw_size >> PAGE_CACHE_SHIFT)) {
LPROCFS_CLIMP_EXIT(dev);
return -ERANGE;
}
LPROC_SEQ_FOPS_RW_TYPE(osc, import);
LPROC_SEQ_FOPS_RW_TYPE(osc, pinger_recov);
-struct lprocfs_seq_vars lprocfs_osc_obd_vars[] = {
+struct lprocfs_vars lprocfs_osc_obd_vars[] = {
{ .name = "uuid",
.fops = &osc_uuid_fops },
{ .name = "ping",
.fops = &osc_pinger_recov_fops },
{ .name = "unstable_stats",
.fops = &osc_unstable_stats_fops },
- { 0 }
+ { NULL }
};
#define pct(a,b) (b ? a * 100 / b : 0)
return rc;
}
-#endif /* LPROCFS */
+#endif /* CONFIG_PROC_FS */