26 #include <linux/types.h>
47 struct buffer_head *bh;
53 if (
unlikely(buffer_mapped(bh) || buffer_uptodate(bh) ||
59 bh->b_bdev = inode->
i_sb->s_bdev;
61 set_buffer_mapped(bh);
62 set_buffer_uptodate(bh);
71 struct buffer_head **pbh,
sector_t *submit_ptr)
73 struct buffer_head *bh;
85 if (buffer_uptodate(bh) || buffer_dirty(bh))
104 if (pblocknr != *submit_ptr + 1 || !trylock_buffer(bh)) {
112 if (buffer_uptodate(bh)) {
117 set_buffer_mapped(bh);
118 bh->b_bdev = inode->
i_sb->s_bdev;
119 bh->b_blocknr = pblocknr;
124 *submit_ptr = pblocknr;
151 wait_on_page_writeback(page);
154 still_dirty = PageDirty(page);
159 if (!still_dirty && mapping)
173 struct buffer_head *obh, *nbh;
178 if (oldkey == newkey)
185 lock_page(obh->b_page);
195 if (
unlikely(oldkey != obh->b_page->index))
197 "invalid oldkey %lld (newkey=%lld)",
198 (
unsigned long long)oldkey,
199 (
unsigned long long)newkey);
210 radix_tree_preload_end();
243 struct buffer_head *obh = ctxt->
bh, *nbh = ctxt->
newbh;
247 if (oldkey == newkey)
254 "invalid oldkey %lld (newkey=%lld)",
255 (
unsigned long long)oldkey,
256 (
unsigned long long)newkey);
265 opage->
index = obh->b_blocknr = newkey;
271 nbh->b_blocknr = newkey;
284 struct buffer_head *nbh = ctxt->
newbh;
287 if (oldkey == newkey)