Merge tag '6.6-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6
[linux-2.6-microblaze.git] / fs / buffer.c
index 084a6ad..2379564 100644 (file)
@@ -563,12 +563,6 @@ repeat:
        return err;
 }
 
-void emergency_thaw_bdev(struct super_block *sb)
-{
-       while (sb->s_bdev && !thaw_bdev(sb->s_bdev))
-               printk(KERN_WARNING "Emergency Thaw on %pg\n", sb->s_bdev);
-}
-
 /**
  * sync_mapping_buffers - write out & wait upon a mapping's "associated" buffers
  * @mapping: the mapping which wants those buffers written
@@ -1539,21 +1533,6 @@ void invalidate_bh_lrus_cpu(void)
        bh_lru_unlock();
 }
 
-void set_bh_page(struct buffer_head *bh,
-               struct page *page, unsigned long offset)
-{
-       bh->b_page = page;
-       BUG_ON(offset >= PAGE_SIZE);
-       if (PageHighMem(page))
-               /*
-                * This catches illegal uses and preserves the offset:
-                */
-               bh->b_data = (char *)(0 + offset);
-       else
-               bh->b_data = page_address(page) + offset;
-}
-EXPORT_SYMBOL(set_bh_page);
-
 void folio_set_bh(struct buffer_head *bh, struct folio *folio,
                  unsigned long offset)
 {
@@ -2180,8 +2159,7 @@ int __block_write_begin(struct page *page, loff_t pos, unsigned len,
 }
 EXPORT_SYMBOL(__block_write_begin);
 
-static int __block_commit_write(struct inode *inode, struct folio *folio,
-               size_t from, size_t to)
+static void __block_commit_write(struct folio *folio, size_t from, size_t to)
 {
        size_t block_start, block_end;
        bool partial = false;
@@ -2216,7 +2194,6 @@ static int __block_commit_write(struct inode *inode, struct folio *folio,
         */
        if (!partial)
                folio_mark_uptodate(folio);
-       return 0;
 }
 
 /*
@@ -2253,7 +2230,6 @@ int block_write_end(struct file *file, struct address_space *mapping,
                        struct page *page, void *fsdata)
 {
        struct folio *folio = page_folio(page);
-       struct inode *inode = mapping->host;
        size_t start = pos - folio_pos(folio);
 
        if (unlikely(copied < len)) {
@@ -2277,7 +2253,7 @@ int block_write_end(struct file *file, struct address_space *mapping,
        flush_dcache_folio(folio);
 
        /* This could be a short (even 0-length) commit */
-       __block_commit_write(inode, folio, start, start + copied);
+       __block_commit_write(folio, start, start + copied);
 
        return copied;
 }
@@ -2598,12 +2574,10 @@ int cont_write_begin(struct file *file, struct address_space *mapping,
 }
 EXPORT_SYMBOL(cont_write_begin);
 
-int block_commit_write(struct page *page, unsigned from, unsigned to)
+void block_commit_write(struct page *page, unsigned from, unsigned to)
 {
        struct folio *folio = page_folio(page);
-       struct inode *inode = folio->mapping->host;
-       __block_commit_write(inode, folio, from, to);
-       return 0;
+       __block_commit_write(folio, from, to);
 }
 EXPORT_SYMBOL(block_commit_write);
 
@@ -2649,11 +2623,11 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
                end = size - folio_pos(folio);
 
        ret = __block_write_begin_int(folio, 0, end, get_block, NULL);
-       if (!ret)
-               ret = __block_commit_write(inode, folio, 0, end);
-
-       if (unlikely(ret < 0))
+       if (unlikely(ret))
                goto out_unlock;
+
+       __block_commit_write(folio, 0, end);
+
        folio_mark_dirty(folio);
        folio_wait_stable(folio);
        return 0;