Merge tag 'iommu-fixes-v4.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / drivers / staging / lustre / lustre / llite / lproc_llite.c
index f134ad9..27ab126 100644 (file)
@@ -43,7 +43,7 @@
 #include "llite_internal.h"
 #include "vvp_internal.h"
 
-/* /proc/lustre/llite mount point registration */
+/* debugfs llite mount point registration */
 static struct file_operations ll_rw_extents_stats_fops;
 static struct file_operations ll_rw_extents_stats_pp_fops;
 static struct file_operations ll_rw_offset_stats_fops;
@@ -233,7 +233,7 @@ static ssize_t max_read_ahead_mb_show(struct kobject *kobj,
        pages_number = sbi->ll_ra_info.ra_max_pages;
        spin_unlock(&sbi->ll_lock);
 
-       mult = 1 << (20 - PAGE_CACHE_SHIFT);
+       mult = 1 << (20 - PAGE_SHIFT);
        return lprocfs_read_frac_helper(buf, PAGE_SIZE, pages_number, mult);
 }
 
@@ -251,12 +251,12 @@ static ssize_t max_read_ahead_mb_store(struct kobject *kobj,
        if (rc)
                return rc;
 
-       pages_number *= 1 << (20 - PAGE_CACHE_SHIFT); /* MB -> pages */
+       pages_number *= 1 << (20 - PAGE_SHIFT); /* MB -> pages */
 
        if (pages_number > totalram_pages / 2) {
 
                CERROR("can't set file readahead more than %lu MB\n",
-                      totalram_pages >> (20 - PAGE_CACHE_SHIFT + 1)); /*1/2 of RAM*/
+                      totalram_pages >> (20 - PAGE_SHIFT + 1)); /*1/2 of RAM*/
                return -ERANGE;
        }
 
@@ -281,7 +281,7 @@ static ssize_t max_read_ahead_per_file_mb_show(struct kobject *kobj,
        pages_number = sbi->ll_ra_info.ra_max_pages_per_file;
        spin_unlock(&sbi->ll_lock);
 
-       mult = 1 << (20 - PAGE_CACHE_SHIFT);
+       mult = 1 << (20 - PAGE_SHIFT);
        return lprocfs_read_frac_helper(buf, PAGE_SIZE, pages_number, mult);
 }
 
@@ -326,7 +326,7 @@ static ssize_t max_read_ahead_whole_mb_show(struct kobject *kobj,
        pages_number = sbi->ll_ra_info.ra_max_read_ahead_whole_pages;
        spin_unlock(&sbi->ll_lock);
 
-       mult = 1 << (20 - PAGE_CACHE_SHIFT);
+       mult = 1 << (20 - PAGE_SHIFT);
        return lprocfs_read_frac_helper(buf, PAGE_SIZE, pages_number, mult);
 }
 
@@ -345,10 +345,11 @@ static ssize_t max_read_ahead_whole_mb_store(struct kobject *kobj,
                return rc;
 
        /* Cap this at the current max readahead window size, the readahead
-        * algorithm does this anyway so it's pointless to set it larger. */
+        * algorithm does this anyway so it's pointless to set it larger.
+        */
        if (pages_number > sbi->ll_ra_info.ra_max_pages_per_file) {
                CERROR("can't set max_read_ahead_whole_mb more than max_read_ahead_per_file_mb: %lu\n",
-                      sbi->ll_ra_info.ra_max_pages_per_file >> (20 - PAGE_CACHE_SHIFT));
+                      sbi->ll_ra_info.ra_max_pages_per_file >> (20 - PAGE_SHIFT));
                return -ERANGE;
        }
 
@@ -365,7 +366,7 @@ static int ll_max_cached_mb_seq_show(struct seq_file *m, void *v)
        struct super_block     *sb    = m->private;
        struct ll_sb_info      *sbi   = ll_s2sbi(sb);
        struct cl_client_cache *cache = &sbi->ll_cache;
-       int shift = 20 - PAGE_CACHE_SHIFT;
+       int shift = 20 - PAGE_SHIFT;
        int max_cached_mb;
        int unused_mb;
 
@@ -404,7 +405,7 @@ static ssize_t ll_max_cached_mb_seq_write(struct file *file,
                return -EFAULT;
        kernbuf[count] = 0;
 
-       mult = 1 << (20 - PAGE_CACHE_SHIFT);
+       mult = 1 << (20 - PAGE_SHIFT);
        buffer += lprocfs_find_named_value(kernbuf, "max_cached_mb:", &count) -
                  kernbuf;
        rc = lprocfs_write_frac_helper(buffer, count, &pages_number, mult);
@@ -414,7 +415,7 @@ static ssize_t ll_max_cached_mb_seq_write(struct file *file,
        if (pages_number < 0 || pages_number > totalram_pages) {
                CERROR("%s: can't set max cache more than %lu MB\n",
                       ll_get_fsname(sb, NULL, 0),
-                      totalram_pages >> (20 - PAGE_CACHE_SHIFT));
+                      totalram_pages >> (20 - PAGE_SHIFT));
                return -ERANGE;
        }
 
@@ -453,7 +454,7 @@ static ssize_t ll_max_cached_mb_seq_write(struct file *file,
                if (diff <= 0)
                        break;
 
-               if (sbi->ll_dt_exp == NULL) { /* being initialized */
+               if (!sbi->ll_dt_exp) { /* being initialized */
                        rc = -ENODEV;
                        break;
                }
@@ -461,9 +462,9 @@ static ssize_t ll_max_cached_mb_seq_write(struct file *file,
                /* difficult - have to ask OSCs to drop LRU slots. */
                tmp = diff << 1;
                rc = obd_set_info_async(NULL, sbi->ll_dt_exp,
-                               sizeof(KEY_CACHE_LRU_SHRINK),
-                               KEY_CACHE_LRU_SHRINK,
-                               sizeof(tmp), &tmp, NULL);
+                                       sizeof(KEY_CACHE_LRU_SHRINK),
+                                       KEY_CACHE_LRU_SHRINK,
+                                       sizeof(tmp), &tmp, NULL);
                if (rc < 0)
                        break;
        }
@@ -966,9 +967,9 @@ int ldebugfs_register_mountpoint(struct dentry *parent,
 
        name[MAX_STRING_SIZE] = '\0';
 
-       LASSERT(sbi != NULL);
-       LASSERT(mdc != NULL);
-       LASSERT(osc != NULL);
+       LASSERT(sbi);
+       LASSERT(mdc);
+       LASSERT(osc);
 
        /* Get fsname */
        len = strlen(lsi->lsi_lmd->lmd_profile);
@@ -999,7 +1000,7 @@ int ldebugfs_register_mountpoint(struct dentry *parent,
                CWARN("Error adding the extent_stats file\n");
 
        rc = ldebugfs_seq_create(sbi->ll_debugfs_entry,
-                                 "extents_stats_per_process",
+                                "extents_stats_per_process",
                                 0644, &ll_rw_extents_stats_pp_fops, sbi);
        if (rc)
                CWARN("Error adding the extents_stats_per_process file\n");
@@ -1012,7 +1013,7 @@ int ldebugfs_register_mountpoint(struct dentry *parent,
        /* File operations stats */
        sbi->ll_stats = lprocfs_alloc_stats(LPROC_LL_FILE_OPCODES,
                                            LPROCFS_STATS_FLAG_NONE);
-       if (sbi->ll_stats == NULL) {
+       if (!sbi->ll_stats) {
                err = -ENOMEM;
                goto out;
        }
@@ -1033,13 +1034,13 @@ int ldebugfs_register_mountpoint(struct dentry *parent,
                                     llite_opcode_table[id].opname, ptr);
        }
        err = ldebugfs_register_stats(sbi->ll_debugfs_entry, "stats",
-                                    sbi->ll_stats);
+                                     sbi->ll_stats);
        if (err)
                goto out;
 
        sbi->ll_ra_stats = lprocfs_alloc_stats(ARRAY_SIZE(ra_stat_string),
                                               LPROCFS_STATS_FLAG_NONE);
-       if (sbi->ll_ra_stats == NULL) {
+       if (!sbi->ll_ra_stats) {
                err = -ENOMEM;
                goto out;
        }
@@ -1049,7 +1050,7 @@ int ldebugfs_register_mountpoint(struct dentry *parent,
                                     ra_stat_string[id], "pages");
 
        err = ldebugfs_register_stats(sbi->ll_debugfs_entry, "read_ahead_stats",
-                                    sbi->ll_ra_stats);
+                                     sbi->ll_ra_stats);
        if (err)
                goto out;
 
@@ -1103,7 +1104,7 @@ void ldebugfs_unregister_mountpoint(struct ll_sb_info *sbi)
 #define pct(a, b) (b ? a * 100 / b : 0)
 
 static void ll_display_extents_info(struct ll_rw_extents_info *io_extents,
-                                  struct seq_file *seq, int which)
+                                   struct seq_file *seq, int which)
 {
        unsigned long read_tot = 0, write_tot = 0, read_cum, write_cum;
        unsigned long start, end, r, w;
@@ -1503,5 +1504,5 @@ LPROC_SEQ_FOPS(ll_rw_offset_stats);
 
 void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars)
 {
-    lvars->obd_vars     = lprocfs_llite_obd_vars;
+       lvars->obd_vars = lprocfs_llite_obd_vars;
 }