diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/Makefile | 2 | ||||
-rw-r--r-- | mm/filemap.c | 4 | ||||
-rw-r--r-- | mm/migrate.c | 2 | ||||
-rw-r--r-- | mm/page-writeback.c | 8 | ||||
-rw-r--r-- | mm/truncate.c | 2 |
5 files changed, 14 insertions, 4 deletions
diff --git a/mm/Makefile b/mm/Makefile index 4f2166a833b9..12b3a4eee88d 100644 --- a/mm/Makefile +++ b/mm/Makefile | |||
@@ -12,7 +12,7 @@ obj-y := bootmem.o filemap.o mempool.o oom_kill.o fadvise.o \ | |||
12 | readahead.o swap.o truncate.o vmscan.o \ | 12 | readahead.o swap.o truncate.o vmscan.o \ |
13 | prio_tree.o util.o mmzone.o vmstat.o $(mmu-y) | 13 | prio_tree.o util.o mmzone.o vmstat.o $(mmu-y) |
14 | 14 | ||
15 | ifeq ($(CONFIG_MMU),y) | 15 | ifeq ($(CONFIG_MMU)$(CONFIG_BLOCK),yy) |
16 | obj-y += bounce.o | 16 | obj-y += bounce.o |
17 | endif | 17 | endif |
18 | obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o thrash.o | 18 | obj-$(CONFIG_SWAP) += page_io.o swap_state.o swapfile.o thrash.o |
diff --git a/mm/filemap.c b/mm/filemap.c index d6846de08887..c4fe97f5ace0 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -2020,6 +2020,7 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i | |||
2020 | if (unlikely(*pos + *count > inode->i_sb->s_maxbytes)) | 2020 | if (unlikely(*pos + *count > inode->i_sb->s_maxbytes)) |
2021 | *count = inode->i_sb->s_maxbytes - *pos; | 2021 | *count = inode->i_sb->s_maxbytes - *pos; |
2022 | } else { | 2022 | } else { |
2023 | #ifdef CONFIG_BLOCK | ||
2023 | loff_t isize; | 2024 | loff_t isize; |
2024 | if (bdev_read_only(I_BDEV(inode))) | 2025 | if (bdev_read_only(I_BDEV(inode))) |
2025 | return -EPERM; | 2026 | return -EPERM; |
@@ -2031,6 +2032,9 @@ inline int generic_write_checks(struct file *file, loff_t *pos, size_t *count, i | |||
2031 | 2032 | ||
2032 | if (*pos + *count > isize) | 2033 | if (*pos + *count > isize) |
2033 | *count = isize - *pos; | 2034 | *count = isize - *pos; |
2035 | #else | ||
2036 | return -EPERM; | ||
2037 | #endif | ||
2034 | } | 2038 | } |
2035 | return 0; | 2039 | return 0; |
2036 | } | 2040 | } |
diff --git a/mm/migrate.c b/mm/migrate.c index 7f50e3ff54cd..ba2453f9483d 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -409,6 +409,7 @@ int migrate_page(struct address_space *mapping, | |||
409 | } | 409 | } |
410 | EXPORT_SYMBOL(migrate_page); | 410 | EXPORT_SYMBOL(migrate_page); |
411 | 411 | ||
412 | #ifdef CONFIG_BLOCK | ||
412 | /* | 413 | /* |
413 | * Migration function for pages with buffers. This function can only be used | 414 | * Migration function for pages with buffers. This function can only be used |
414 | * if the underlying filesystem guarantees that no other references to "page" | 415 | * if the underlying filesystem guarantees that no other references to "page" |
@@ -466,6 +467,7 @@ int buffer_migrate_page(struct address_space *mapping, | |||
466 | return 0; | 467 | return 0; |
467 | } | 468 | } |
468 | EXPORT_SYMBOL(buffer_migrate_page); | 469 | EXPORT_SYMBOL(buffer_migrate_page); |
470 | #endif | ||
469 | 471 | ||
470 | /* | 472 | /* |
471 | * Writeback a page to clean the dirty state | 473 | * Writeback a page to clean the dirty state |
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index ecf27839c203..c0d4ce144dec 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -807,9 +807,11 @@ int fastcall set_page_dirty(struct page *page) | |||
807 | 807 | ||
808 | if (likely(mapping)) { | 808 | if (likely(mapping)) { |
809 | int (*spd)(struct page *) = mapping->a_ops->set_page_dirty; | 809 | int (*spd)(struct page *) = mapping->a_ops->set_page_dirty; |
810 | if (spd) | 810 | #ifdef CONFIG_BLOCK |
811 | return (*spd)(page); | 811 | if (!spd) |
812 | return __set_page_dirty_buffers(page); | 812 | spd = __set_page_dirty_buffers; |
813 | #endif | ||
814 | return (*spd)(page); | ||
813 | } | 815 | } |
814 | if (!PageDirty(page)) { | 816 | if (!PageDirty(page)) { |
815 | if (!TestSetPageDirty(page)) | 817 | if (!TestSetPageDirty(page)) |
diff --git a/mm/truncate.c b/mm/truncate.c index cd3e34b816db..8fde6580657e 100644 --- a/mm/truncate.c +++ b/mm/truncate.c | |||
@@ -35,8 +35,10 @@ void do_invalidatepage(struct page *page, unsigned long offset) | |||
35 | { | 35 | { |
36 | void (*invalidatepage)(struct page *, unsigned long); | 36 | void (*invalidatepage)(struct page *, unsigned long); |
37 | invalidatepage = page->mapping->a_ops->invalidatepage; | 37 | invalidatepage = page->mapping->a_ops->invalidatepage; |
38 | #ifdef CONFIG_BLOCK | ||
38 | if (!invalidatepage) | 39 | if (!invalidatepage) |
39 | invalidatepage = block_invalidatepage; | 40 | invalidatepage = block_invalidatepage; |
41 | #endif | ||
40 | if (invalidatepage) | 42 | if (invalidatepage) |
41 | (*invalidatepage)(page, offset); | 43 | (*invalidatepage)(page, offset); |
42 | } | 44 | } |