Whamcloud - gitweb
LU-2049 grant: Fix grant interop with pre-GRANT_PARAM clients
[fs/lustre-release.git] / lustre / fid / lproc_fid.c
index 03a2098..11ae1b6 100644 (file)
  *
  * 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
  */
@@ -27,7 +23,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2015, Intel Corporation.
+ * Copyright (c) 2011, 2016, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -67,8 +63,9 @@ static int
 lprocfs_fid_write_common(const char __user *buffer, size_t count,
                                struct lu_seq_range *range)
 {
-       struct lu_seq_range tmp = { 0, };
-       int rc;
+       struct lu_seq_range tmp = {
+               .lsr_start = 0,
+       };
        char kernbuf[MAX_FID_RANGE_STRLEN];
        ENTRY;
 
@@ -88,9 +85,9 @@ lprocfs_fid_write_common(const char __user *buffer, size_t count,
        }
 
        /* of the form "[0x0000000240000400 - 0x000000028000400]" */
-       rc = sscanf(kernbuf, "[%llx - %llx]\n",
-                   (long long unsigned *)&tmp.lsr_start,
-                   (long long unsigned *)&tmp.lsr_end);
+       sscanf(kernbuf, "[%llx - %llx]\n",
+              (long long unsigned *)&tmp.lsr_start,
+              (long long unsigned *)&tmp.lsr_end);
        if (!lu_seq_range_is_sane(&tmp) || lu_seq_range_is_zero(&tmp) ||
            tmp.lsr_start < range->lsr_start || tmp.lsr_end > range->lsr_end)
                RETURN(-EINVAL);
@@ -132,7 +129,7 @@ lprocfs_server_fid_space_seq_show(struct seq_file *m, void *unused)
        LASSERT(seq != NULL);
 
        mutex_lock(&seq->lss_mutex);
-       seq_printf(m, "["LPX64" - "LPX64"]:%x:%s\n", PRANGE(&seq->lss_space));
+       seq_printf(m, "[%#llx - %#llx]:%x:%s\n", PRANGE(&seq->lss_space));
        mutex_unlock(&seq->lss_mutex);
 
        RETURN(0);
@@ -189,7 +186,7 @@ lprocfs_server_fid_width_seq_write(struct file *file, const char __user *buffer,
 
        seq->lss_width = val;
 
-       CDEBUG(D_INFO, "%s: Width: "LPU64"\n",
+       CDEBUG(D_INFO, "%s: Width: %llu\n",
               seq->lss_name, seq->lss_width);
 out_unlock:
        mutex_unlock(&seq->lss_mutex);
@@ -206,7 +203,7 @@ lprocfs_server_fid_width_seq_show(struct seq_file *m, void *unused)
        LASSERT(seq != NULL);
 
        mutex_lock(&seq->lss_mutex);
-       seq_printf(m, LPU64"\n", seq->lss_width);
+       seq_printf(m, "%llu\n", seq->lss_width);
        mutex_unlock(&seq->lss_mutex);
 
        RETURN(0);
@@ -541,7 +538,7 @@ lprocfs_client_fid_space_seq_show(struct seq_file *m, void *unused)
        LASSERT(seq != NULL);
 
        mutex_lock(&seq->lcs_mutex);
-       seq_printf(m, "["LPX64" - "LPX64"]:%x:%s\n",
+       seq_printf(m, "[%#llx - %#llx]:%x:%s\n",
                   PRANGE(&seq->lcs_space));
        mutex_unlock(&seq->lcs_mutex);
 
@@ -575,7 +572,7 @@ lprocfs_client_fid_width_seq_write(struct file *file, const char __user *buffer,
        if (val <= max && val > 0) {
                seq->lcs_width = val;
 
-               CDEBUG(D_INFO, "%s: Sequence size: "LPU64"\n",
+               CDEBUG(D_INFO, "%s: Sequence size: %llu\n",
                       seq->lcs_name, seq->lcs_width);
        } else {
                GOTO(out_unlock, count = -ERANGE);
@@ -595,7 +592,7 @@ lprocfs_client_fid_width_seq_show(struct seq_file *m, void *unused)
        LASSERT(seq != NULL);
 
        mutex_lock(&seq->lcs_mutex);
-       seq_printf(m, LPU64"\n", seq->lcs_width);
+       seq_printf(m, "%llu\n", seq->lcs_width);
        mutex_unlock(&seq->lcs_mutex);
 
        RETURN(0);