Whamcloud - gitweb
LU-9657 llapi: check if the file layout is composite
[fs/lustre-release.git] / lustre / lod / lproc_lod.c
index 8131cb5..3347a4d 100644 (file)
@@ -35,7 +35,7 @@
 #include <obd_class.h>
 #include <linux/seq_file.h>
 #include "lod_internal.h"
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
 
 /*
  * Notice, all the functions below (except for lod_procfs_init() and
@@ -154,7 +154,7 @@ lod_stripeoffset_seq_write(struct file *file, const char __user *buffer,
        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;
@@ -271,7 +271,7 @@ lod_stripecount_seq_write(struct file *file, const char __user *buffer,
        rc = lprocfs_str_to_s64(buffer, count, &val);
        if (rc)
                return rc;
-       if (val < 0)
+       if (val < -1)
                return -ERANGE;
 
        stripe_count = val;
@@ -542,9 +542,10 @@ lod_qos_maxage_seq_write(struct file *file, const char __user *buffer,
        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) {
@@ -554,7 +555,7 @@ lod_qos_maxage_seq_write(struct file *file, const char __user *buffer,
                        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;
 }
@@ -765,13 +766,13 @@ static struct lprocfs_vars lprocfs_lod_obd_vars[] = {
 };
 
 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 = {