Skip to content

Commit 002cbb1

Browse files
Christoph HellwigMatthew Wilcox (Oracle)
authored andcommitted
jfs: stop using the nobh helper
The nobh mode is an obscure feature to save lowlevel for large memory 32-bit configurations while trading for much slower performance and has been long obsolete. Switch to the regular buffer head based helpers instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
1 parent 0cc5b4c commit 002cbb1

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

fs/jfs/inode.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,25 @@ static int jfs_write_begin(struct file *file, struct address_space *mapping,
301301
{
302302
int ret;
303303

304-
ret = nobh_write_begin(mapping, pos, len, pagep, fsdata, jfs_get_block);
304+
ret = block_write_begin(mapping, pos, len, pagep, jfs_get_block);
305305
if (unlikely(ret))
306306
jfs_write_failed(mapping, pos + len);
307307

308308
return ret;
309309
}
310310

311+
static int jfs_write_end(struct file *file, struct address_space *mapping,
312+
loff_t pos, unsigned len, unsigned copied, struct page *page,
313+
void *fsdata)
314+
{
315+
int ret;
316+
317+
ret = generic_write_end(file, mapping, pos, len, copied, page, fsdata);
318+
if (ret < len)
319+
jfs_write_failed(mapping, pos + len);
320+
return ret;
321+
}
322+
311323
static sector_t jfs_bmap(struct address_space *mapping, sector_t block)
312324
{
313325
return generic_block_bmap(mapping, block, jfs_get_block);
@@ -346,7 +358,7 @@ const struct address_space_operations jfs_aops = {
346358
.writepage = jfs_writepage,
347359
.writepages = jfs_writepages,
348360
.write_begin = jfs_write_begin,
349-
.write_end = nobh_write_end,
361+
.write_end = jfs_write_end,
350362
.bmap = jfs_bmap,
351363
.direct_IO = jfs_direct_IO,
352364
};
@@ -399,7 +411,7 @@ void jfs_truncate(struct inode *ip)
399411
{
400412
jfs_info("jfs_truncate: size = 0x%lx", (ulong) ip->i_size);
401413

402-
nobh_truncate_page(ip->i_mapping, ip->i_size, jfs_get_block);
414+
block_truncate_page(ip->i_mapping, ip->i_size, jfs_get_block);
403415

404416
IWRITE_LOCK(ip, RDWRLOCK_NORMAL);
405417
jfs_truncate_nolock(ip, ip->i_size);

0 commit comments

Comments
 (0)