Whamcloud - gitweb
LU-6210 tests: Change positional struct initializers to C99
[fs/lustre-release.git] / lustre / ofd / lproc_ofd.c
index 281289c..86de1ad 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2014 Intel Corporation.
+ * Copyright (c) 2012, 2016, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -85,7 +85,7 @@ static int ofd_tot_dirty_seq_show(struct seq_file *m, void *data)
 
        LASSERT(obd != NULL);
        ofd = ofd_dev(obd->obd_lu_dev);
-       seq_printf(m, LPU64"\n", ofd->ofd_tot_dirty);
+       seq_printf(m, "%llu\n", ofd->ofd_tot_dirty);
        return 0;
 }
 LPROC_SEQ_FOPS_RO(ofd_tot_dirty);
@@ -106,7 +106,7 @@ static int ofd_tot_granted_seq_show(struct seq_file *m, void *data)
 
        LASSERT(obd != NULL);
        ofd = ofd_dev(obd->obd_lu_dev);
-       seq_printf(m, LPU64"\n", ofd->ofd_tot_granted);
+       seq_printf(m, "%llu\n", ofd->ofd_tot_granted);
        return 0;
 }
 LPROC_SEQ_FOPS_RO(ofd_tot_granted);
@@ -127,7 +127,7 @@ static int ofd_tot_pending_seq_show(struct seq_file *m, void *data)
 
        LASSERT(obd != NULL);
        ofd = ofd_dev(obd->obd_lu_dev);
-       seq_printf(m, LPU64"\n", ofd->ofd_tot_pending);
+       seq_printf(m, "%llu\n", ofd->ofd_tot_pending);
        return 0;
 }
 LPROC_SEQ_FOPS_RO(ofd_tot_pending);
@@ -510,10 +510,9 @@ static int ofd_brw_size_seq_show(struct seq_file *m, void *data)
 {
        struct obd_device       *obd = m->private;
        struct ofd_device       *ofd = ofd_dev(obd->obd_lu_dev);
-       int                      rc;
 
-       rc = seq_printf(m, "%u\n", ofd->ofd_brw_size / ONE_MB_BRW_SIZE);
-       return rc;
+       seq_printf(m, "%u\n", ofd->ofd_brw_size / ONE_MB_BRW_SIZE);
+       return 0;
 }
 
 static ssize_t
@@ -534,7 +533,8 @@ ofd_brw_size_seq_write(struct file *file, const char __user *buffer,
                return -EINVAL;
 
        val = val * ONE_MB_BRW_SIZE;
-       if (val <= 0 || val > DT_MAX_BRW_SIZE)
+       if (val <= 0 || val > DT_MAX_BRW_SIZE ||
+           val < (1 << ofd->ofd_blockbits))
                return -ERANGE;
 
        spin_lock(&ofd->ofd_flags_lock);
@@ -639,7 +639,7 @@ LPROC_SEQ_FOPS(ofd_sync_lock_cancel);
  *
  * When ofd_grant_compat_disable is set, we don't grant any space to clients
  * not supporting OBD_CONNECT_GRANT_PARAM. Otherwise, space granted to such
- * a client is inflated since it consumes PAGE_CACHE_SIZE of grant space per
+ * a client is inflated since it consumes PAGE_SIZE of grant space per
  * block, (i.e. typically 4kB units), but underlaying file system might have
  * block size bigger than page size, e.g. ZFS. See LU-2049 for details.
  *
@@ -836,7 +836,7 @@ static int ofd_lfsck_verify_pfid_seq_show(struct seq_file *m, void *data)
        struct obd_device *obd = m->private;
        struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
 
-       seq_printf(m, "switch: %s\ndetected: "LPU64"\nrepaired: "LPU64"\n",
+       seq_printf(m, "switch: %s\ndetected: %llu\nrepaired: %llu\n",
                   ofd->ofd_lfsck_verify_pfid ? "on" : "off",
                   ofd->ofd_inconsistency_self_detected,
                   ofd->ofd_inconsistency_self_repaired);