Merge tag 'upstream-4.1-rc1' of git://git.infradead.org/linux-ubifs
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 Apr 2015 20:43:40 +0000 (13:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 Apr 2015 20:43:40 +0000 (13:43 -0700)
Pull UBI/UBIFS updates from Richard Weinberger:
 "This pull request includes the following UBI/UBIFS changes:

   - powercut emulation for UBI
   - a huge update to UBI Fastmap
   - cleanups and bugfixes all over UBI and UBIFS"

* tag 'upstream-4.1-rc1' of git://git.infradead.org/linux-ubifs: (50 commits)
  UBI: power cut emulation for testing
  UBIFS: fix output format of INUM_WATERMARK
  UBI: Fastmap: Fall back to scanning mode after ECC error
  UBI: Fastmap: Remove is_fm_block()
  UBI: Fastmap: Add blank line after declarations
  UBI: Fastmap: Remove else after return.
  UBI: Fastmap: Introduce may_reserve_for_fm()
  UBI: Fastmap: Introduce ubi_fastmap_init()
  UBI: Fastmap: Wire up WL accessor functions
  UBI: Add accessor functions for WL data structures
  UBI: Move fastmap specific functions out of wl.c
  UBI: Fastmap: Add new module parameter fm_debug
  UBI: Fastmap: Make self_check_eba() depend on fastmap self checking
  UBI: Fastmap: Add self check to detect absent PEBs
  UBI: Fix stale pointers in ubi->lookuptbl
  UBI: Fastmap: Enhance fastmap checking
  UBI: Add initial support for fastmap self checks
  UBI: Fastmap: Rework fastmap error paths
  UBI: Fastmap: Prepare for variable sized fastmaps
  UBI: Fastmap: Locking updates
  ...

1  2 
fs/ubifs/file.c

diff --combined fs/ubifs/file.c
index 475b15635f11654f40ddbc23dfc0f76aeb2a1099,9cd12976ed1b76f6e195315116d24accc9197082..3ba3fef64e9eaf67d9ca4a03457a68d5f0c95011
@@@ -50,6 -50,7 +50,6 @@@
   */
  
  #include "ubifs.h"
 -#include <linux/aio.h>
  #include <linux/mount.h>
  #include <linux/namei.h>
  #include <linux/slab.h>
@@@ -79,7 -80,7 +79,7 @@@ static int read_block(struct inode *ino
  
        dlen = le32_to_cpu(dn->ch.len) - UBIFS_DATA_NODE_SZ;
        out_len = UBIFS_BLOCK_SIZE;
-       err = ubifs_decompress(&dn->data, dlen, addr, &out_len,
+       err = ubifs_decompress(c, &dn->data, dlen, addr, &out_len,
                               le16_to_cpu(dn->compr_type));
        if (err || len != out_len)
                goto dump;
@@@ -95,7 -96,7 +95,7 @@@
        return 0;
  
  dump:
-       ubifs_err("bad data node (block %u, inode %lu)",
+       ubifs_err(c, "bad data node (block %u, inode %lu)",
                  block, inode->i_ino);
        ubifs_dump_node(c, dn);
        return -EINVAL;
@@@ -160,13 -161,14 +160,14 @@@ static int do_readpage(struct page *pag
                addr += UBIFS_BLOCK_SIZE;
        }
        if (err) {
+               struct ubifs_info *c = inode->i_sb->s_fs_info;
                if (err == -ENOENT) {
                        /* Not found, so it must be a hole */
                        SetPageChecked(page);
                        dbg_gen("hole");
                        goto out_free;
                }
-               ubifs_err("cannot read page %lu of inode %lu, error %d",
+               ubifs_err(c, "cannot read page %lu of inode %lu, error %d",
                          page->index, inode->i_ino, err);
                goto error;
        }
@@@ -649,7 -651,7 +650,7 @@@ static int populate_page(struct ubifs_i
  
                        dlen = le32_to_cpu(dn->ch.len) - UBIFS_DATA_NODE_SZ;
                        out_len = UBIFS_BLOCK_SIZE;
-                       err = ubifs_decompress(&dn->data, dlen, addr, &out_len,
+                       err = ubifs_decompress(c, &dn->data, dlen, addr, &out_len,
                                               le16_to_cpu(dn->compr_type));
                        if (err || len != out_len)
                                goto out_err;
@@@ -697,7 -699,7 +698,7 @@@ out_err
        SetPageError(page);
        flush_dcache_page(page);
        kunmap(page);
-       ubifs_err("bad data node (block %u, inode %lu)",
+       ubifs_err(c, "bad data node (block %u, inode %lu)",
                  page_block, inode->i_ino);
        return -EINVAL;
  }
@@@ -801,7 -803,7 +802,7 @@@ out_free
        return ret;
  
  out_warn:
-       ubifs_warn("ignoring error %d and skipping bulk-read", err);
+       ubifs_warn(c, "ignoring error %d and skipping bulk-read", err);
        goto out_free;
  
  out_bu_off:
@@@ -929,7 -931,7 +930,7 @@@ static int do_writepage(struct page *pa
        }
        if (err) {
                SetPageError(page);
-               ubifs_err("cannot write page %lu of inode %lu, error %d",
+               ubifs_err(c, "cannot write page %lu of inode %lu, error %d",
                          page->index, inode->i_ino, err);
                ubifs_ro_mode(c, err);
        }
@@@ -1484,7 -1486,7 +1485,7 @@@ static int ubifs_vm_page_mkwrite(struc
        err = ubifs_budget_space(c, &req);
        if (unlikely(err)) {
                if (err == -ENOSPC)
-                       ubifs_warn("out of space for mmapped file (inode number %lu)",
+                       ubifs_warn(c, "out of space for mmapped file (inode number %lu)",
                                   inode->i_ino);
                return VM_FAULT_SIGBUS;
        }
@@@ -1580,6 -1582,8 +1581,6 @@@ const struct inode_operations ubifs_sym
  
  const struct file_operations ubifs_file_operations = {
        .llseek         = generic_file_llseek,
 -      .read           = new_sync_read,
 -      .write          = new_sync_write,
        .read_iter      = generic_file_read_iter,
        .write_iter     = ubifs_write_iter,
        .mmap           = ubifs_file_mmap,