*
* 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.
+ * http://www.gnu.org/licenses/gpl-2.0.html
*
* GPL HEADER END
*/
* Copyright 2008 Sun Microsystems, Inc. All rights reserved
* Use is subject to license terms.
*
- * Copyright (c) 2012, 2015, Intel Corporation.
+ * Copyright (c) 2012, 2016, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#include <obd_class.h>
#include <linux/seq_file.h>
#include "lod_internal.h"
-#include <lustre_param.h>
+#include <uapi/linux/lustre/lustre_param.h>
/*
* Notice, all the functions below (except for lod_procfs_init() and
LASSERT(dev != NULL);
lod = lu2lod_dev(dev->obd_lu_dev);
- seq_printf(m, LPU64"\n",
+ seq_printf(m, "%llu\n",
lod->lod_desc.ld_default_stripe_size);
return 0;
}
LASSERT(dev != NULL);
lod = lu2lod_dev(dev->obd_lu_dev);
- rc = lprocfs_str_to_s64(buffer, count, &val);
+ rc = lprocfs_str_with_units_to_s64(buffer, count, &val, '1');
if (rc)
return rc;
if (val < 0)
LASSERT(dev != NULL);
lod = lu2lod_dev(dev->obd_lu_dev);
- seq_printf(m, LPU64"\n",
+ seq_printf(m, "%llu\n",
lod->lod_desc.ld_default_stripe_offset);
return 0;
}
LASSERT(dev != NULL);
lod = lu2lod_dev(dev->obd_lu_dev);
- rc = lprocfs_str_to_s64(buffer, count, &val);
+ rc = lprocfs_str_with_units_to_s64(buffer, count, &val, '1');
if (rc)
return rc;
- if (val < 0)
+ if (val < -1)
return -ERANGE;
lod->lod_desc.ld_default_stripe_offset = val;
rc = lprocfs_str_to_s64(buffer, count, &val);
if (rc)
return rc;
- if (val < 0)
+ if (val < -1)
return -ERANGE;
stripe_count = val;
lustre_cfg_bufs_reset(&bufs, NULL);
snprintf(str, 32, "%smaxage=%u", PARAM_OSP, (__u32)val);
lustre_cfg_bufs_set_string(&bufs, 1, str);
- lcfg = lustre_cfg_new(LCFG_PARAM, &bufs);
+ OBD_ALLOC(lcfg, lustre_cfg_len(bufs.lcfg_bufcount, bufs.lcfg_buflen));
if (lcfg == NULL)
return -ENOMEM;
+ lustre_cfg_init(lcfg, LCFG_PARAM, &bufs);
lod_getref(&lod->lod_ost_descs);
lod_foreach_ost(lod, i) {
CERROR("can't set maxage on #%d: %d\n", i, rc);
}
lod_putref(lod, &lod->lod_ost_descs);
- lustre_cfg_free(lcfg);
+ OBD_FREE(lcfg, lustre_cfg_len(lcfg->lcfg_bufcount, lcfg->lcfg_buflens));
return count;
}
return 0;
}
-LPROC_SEQ_FOPS_RO_TYPE(lod, uuid);
-
LPROC_SEQ_FOPS_RO_TYPE(lod, dt_blksize);
LPROC_SEQ_FOPS_RO_TYPE(lod, dt_kbytestotal);
LPROC_SEQ_FOPS_RO_TYPE(lod, dt_kbytesfree);
LPROC_SEQ_FOPS(lod_lmv_failout);
static struct lprocfs_vars lprocfs_lod_obd_vars[] = {
- { .name = "uuid",
- .fops = &lod_uuid_fops },
{ .name = "stripesize",
.fops = &lod_stripesize_fops },
{ .name = "stripeoffset",
};
static struct lprocfs_vars lprocfs_lod_osd_vars[] = {
- { "blocksize", &lod_dt_blksize_fops },
- { "kbytestotal", &lod_dt_kbytestotal_fops },
- { "kbytesfree", &lod_dt_kbytesfree_fops },
- { "kbytesavail", &lod_dt_kbytesavail_fops },
- { "filestotal", &lod_dt_filestotal_fops },
- { "filesfree", &lod_dt_filesfree_fops },
- { NULL }
+ { .name = "blocksize", .fops = &lod_dt_blksize_fops },
+ { .name = "kbytestotal", .fops = &lod_dt_kbytestotal_fops },
+ { .name = "kbytesfree", .fops = &lod_dt_kbytesfree_fops },
+ { .name = "kbytesavail", .fops = &lod_dt_kbytesavail_fops },
+ { .name = "filestotal", .fops = &lod_dt_filestotal_fops },
+ { .name = "filesfree", .fops = &lod_dt_filesfree_fops },
+ { .name = NULL }
};
static const struct file_operations lod_proc_target_fops = {
int rc;
obd->obd_vars = lprocfs_lod_obd_vars;
- rc = lprocfs_obd_setup(obd);
+ rc = lprocfs_obd_setup(obd, true);
if (rc) {
CERROR("%s: cannot setup procfs entry: %d\n",
obd->obd_name, rc);