aboutsummaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-01-08 20:14:59 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-08 20:14:59 -0500
commit2150edc6c5cf00f7adb54538b9ea2a3e9cedca3f (patch)
treef72a0d85e66f500b4cead348a231e3d3b9f357bc /fs/block_dev.c
parentcd764695b67386a81964f68e9c66efd9f13f4d29 (diff)
parent4b905671d2ea09fd48fed72c581df17e40823f39 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (57 commits) jbd2: Fix oops in jbd2_journal_init_inode() on corrupted fs ext4: Remove "extents" mount option block: Add Kconfig help which notes that ext4 needs CONFIG_LBD ext4: Make printk's consistently prefixed with "EXT4-fs: " ext4: Add sanity checks for the superblock before mounting the filesystem ext4: Add mount option to set kjournald's I/O priority jbd2: Submit writes to the journal using WRITE_SYNC jbd2: Add pid and journal device name to the "kjournald2 starting" message ext4: Add markers for better debuggability ext4: Remove code to create the journal inode ext4: provide function to release metadata pages under memory pressure ext3: provide function to release metadata pages under memory pressure add releasepage hooks to block devices which can be used by file systems ext4: Fix s_dirty_blocks_counter if block allocation failed with nodelalloc ext4: Init the complete page while building buddy cache ext4: Don't allow new groups to be added during block allocation ext4: mark the blocks/inode bitmap beyond end of group as used ext4: Use new buffer_head flag to check uninit group bitmaps initialization ext4: Fix the race between read_inode_bitmap() and ext4_new_inode() ext4: code cleanup ...
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 8ebbfdf708c2..ac7031f12ea5 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1234,6 +1234,20 @@ static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg)
1234 return blkdev_ioctl(bdev, mode, cmd, arg); 1234 return blkdev_ioctl(bdev, mode, cmd, arg);
1235} 1235}
1236 1236
1237/*
1238 * Try to release a page associated with block device when the system
1239 * is under memory pressure.
1240 */
1241static int blkdev_releasepage(struct page *page, gfp_t wait)
1242{
1243 struct super_block *super = BDEV_I(page->mapping->host)->bdev.bd_super;
1244
1245 if (super && super->s_op->bdev_try_to_free_page)
1246 return super->s_op->bdev_try_to_free_page(super, page, wait);
1247
1248 return try_to_free_buffers(page);
1249}
1250
1237static const struct address_space_operations def_blk_aops = { 1251static const struct address_space_operations def_blk_aops = {
1238 .readpage = blkdev_readpage, 1252 .readpage = blkdev_readpage,
1239 .writepage = blkdev_writepage, 1253 .writepage = blkdev_writepage,
@@ -1241,6 +1255,7 @@ static const struct address_space_operations def_blk_aops = {
1241 .write_begin = blkdev_write_begin, 1255 .write_begin = blkdev_write_begin,
1242 .write_end = blkdev_write_end, 1256 .write_end = blkdev_write_end,
1243 .writepages = generic_writepages, 1257 .writepages = generic_writepages,
1258 .releasepage = blkdev_releasepage,
1244 .direct_IO = blkdev_direct_IO, 1259 .direct_IO = blkdev_direct_IO,
1245}; 1260};
1246 1261