aboutsummaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index ddfdd2c80bf9..98196327ddf0 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2564,14 +2564,13 @@ int nobh_write_end(struct file *file, struct address_space *mapping,
2564 struct inode *inode = page->mapping->host; 2564 struct inode *inode = page->mapping->host;
2565 struct buffer_head *head = fsdata; 2565 struct buffer_head *head = fsdata;
2566 struct buffer_head *bh; 2566 struct buffer_head *bh;
2567 BUG_ON(fsdata != NULL && page_has_buffers(page));
2567 2568
2568 if (!PageMappedToDisk(page)) { 2569 if (unlikely(copied < len) && !page_has_buffers(page))
2569 if (unlikely(copied < len) && !page_has_buffers(page)) 2570 attach_nobh_buffers(page, head);
2570 attach_nobh_buffers(page, head); 2571 if (page_has_buffers(page))
2571 if (page_has_buffers(page)) 2572 return generic_write_end(file, mapping, pos, len,
2572 return generic_write_end(file, mapping, pos, len, 2573 copied, page, fsdata);
2573 copied, page, fsdata);
2574 }
2575 2574
2576 SetPageUptodate(page); 2575 SetPageUptodate(page);
2577 set_page_dirty(page); 2576 set_page_dirty(page);
@@ -3213,7 +3212,7 @@ static int buffer_cpu_notify(struct notifier_block *self,
3213} 3212}
3214 3213
3215/** 3214/**
3216 * bh_uptodate_or_lock: Test whether the buffer is uptodate 3215 * bh_uptodate_or_lock - Test whether the buffer is uptodate
3217 * @bh: struct buffer_head 3216 * @bh: struct buffer_head
3218 * 3217 *
3219 * Return true if the buffer is up-to-date and false, 3218 * Return true if the buffer is up-to-date and false,
@@ -3232,7 +3231,7 @@ int bh_uptodate_or_lock(struct buffer_head *bh)
3232EXPORT_SYMBOL(bh_uptodate_or_lock); 3231EXPORT_SYMBOL(bh_uptodate_or_lock);
3233 3232
3234/** 3233/**
3235 * bh_submit_read: Submit a locked buffer for reading 3234 * bh_submit_read - Submit a locked buffer for reading
3236 * @bh: struct buffer_head 3235 * @bh: struct buffer_head
3237 * 3236 *
3238 * Returns zero on success and -EIO on error. 3237 * Returns zero on success and -EIO on error.