]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/buffer.c
net: dsa: change scope of bridging code
[karo-tx-linux.git] / fs / buffer.c
index 0e87401cf33535b03a1d2aa9da6e919d8a56a906..161be58c5cb0f738754b79d87eda879aa3bb9553 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/sched/signal.h>
 #include <linux/syscalls.h>
 #include <linux/fs.h>
 #include <linux/iomap.h>
@@ -48,7 +49,6 @@
 
 static int fsync_buffers_list(spinlock_t *lock, struct list_head *list);
 static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
-                        unsigned long bio_flags,
                         struct writeback_control *wbc);
 
 #define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers)
@@ -1829,7 +1829,7 @@ int __block_write_full_page(struct inode *inode, struct page *page,
        do {
                struct buffer_head *next = bh->b_this_page;
                if (buffer_async_write(bh)) {
-                       submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, 0, wbc);
+                       submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, wbc);
                        nr_underway++;
                }
                bh = next;
@@ -1883,7 +1883,7 @@ recover:
                struct buffer_head *next = bh->b_this_page;
                if (buffer_async_write(bh)) {
                        clear_buffer_dirty(bh);
-                       submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, 0, wbc);
+                       submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, wbc);
                        nr_underway++;
                }
                bh = next;
@@ -2378,8 +2378,7 @@ int generic_cont_expand_simple(struct inode *inode, loff_t size)
                goto out;
 
        err = pagecache_write_begin(NULL, mapping, size, 0,
-                               AOP_FLAG_UNINTERRUPTIBLE|AOP_FLAG_CONT_EXPAND,
-                               &page, &fsdata);
+                                   AOP_FLAG_CONT_EXPAND, &page, &fsdata);
        if (err)
                goto out;
 
@@ -2395,7 +2394,7 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
                            loff_t pos, loff_t *bytes)
 {
        struct inode *inode = mapping->host;
-       unsigned blocksize = 1 << inode->i_blkbits;
+       unsigned int blocksize = i_blocksize(inode);
        struct page *page;
        void *fsdata;
        pgoff_t index, curidx;
@@ -2414,9 +2413,8 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
                }
                len = PAGE_SIZE - zerofrom;
 
-               err = pagecache_write_begin(file, mapping, curpos, len,
-                                               AOP_FLAG_UNINTERRUPTIBLE,
-                                               &page, &fsdata);
+               err = pagecache_write_begin(file, mapping, curpos, len, 0,
+                                           &page, &fsdata);
                if (err)
                        goto out;
                zero_user(page, zerofrom, len);
@@ -2448,9 +2446,8 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
                }
                len = offset - zerofrom;
 
-               err = pagecache_write_begin(file, mapping, curpos, len,
-                                               AOP_FLAG_UNINTERRUPTIBLE,
-                                               &page, &fsdata);
+               err = pagecache_write_begin(file, mapping, curpos, len, 0,
+                                           &page, &fsdata);
                if (err)
                        goto out;
                zero_user(page, zerofrom, len);
@@ -2475,8 +2472,8 @@ int cont_write_begin(struct file *file, struct address_space *mapping,
                        get_block_t *get_block, loff_t *bytes)
 {
        struct inode *inode = mapping->host;
-       unsigned blocksize = 1 << inode->i_blkbits;
-       unsigned zerofrom;
+       unsigned int blocksize = i_blocksize(inode);
+       unsigned int zerofrom;
        int err;
 
        err = cont_expand_zero(file, mapping, pos, bytes);
@@ -2838,7 +2835,7 @@ int nobh_truncate_page(struct address_space *mapping,
        struct buffer_head map_bh;
        int err;
 
-       blocksize = 1 << inode->i_blkbits;
+       blocksize = i_blocksize(inode);
        length = offset & (blocksize - 1);
 
        /* Block boundary? Nothing to do */
@@ -2916,7 +2913,7 @@ int block_truncate_page(struct address_space *mapping,
        struct buffer_head *bh;
        int err;
 
-       blocksize = 1 << inode->i_blkbits;
+       blocksize = i_blocksize(inode);
        length = offset & (blocksize - 1);
 
        /* Block boundary? Nothing to do */
@@ -3028,7 +3025,7 @@ sector_t generic_block_bmap(struct address_space *mapping, sector_t block,
        struct inode *inode = mapping->host;
        tmp.b_state = 0;
        tmp.b_blocknr = 0;
-       tmp.b_size = 1 << inode->i_blkbits;
+       tmp.b_size = i_blocksize(inode);
        get_block(inode, block, &tmp, 0);
        return tmp.b_blocknr;
 }
@@ -3094,7 +3091,7 @@ void guard_bio_eod(int op, struct bio *bio)
 }
 
 static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
-                        unsigned long bio_flags, struct writeback_control *wbc)
+                        struct writeback_control *wbc)
 {
        struct bio *bio;
 
@@ -3129,7 +3126,6 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
 
        bio->bi_end_io = end_bio_bh_io_sync;
        bio->bi_private = bh;
-       bio->bi_flags |= bio_flags;
 
        /* Take care of bh's that straddle the end of the device */
        guard_bio_eod(op, bio);
@@ -3144,16 +3140,9 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
        return 0;
 }
 
-int _submit_bh(int op, int op_flags, struct buffer_head *bh,
-              unsigned long bio_flags)
+int submit_bh(int op, int op_flags, struct buffer_head *bh)
 {
-       return submit_bh_wbc(op, op_flags, bh, bio_flags, NULL);
-}
-EXPORT_SYMBOL_GPL(_submit_bh);
-
-int submit_bh(int op, int op_flags,  struct buffer_head *bh)
-{
-       return submit_bh_wbc(op, op_flags, bh, 0, NULL);
+       return submit_bh_wbc(op, op_flags, bh, NULL);
 }
 EXPORT_SYMBOL(submit_bh);