Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs/ramfs: move ramfs_aops to inode.c

ramfs_aops is identical in file-mmu.c and file-nommu.c. Thus move it to
fs/ramfs/inode.c and make it static.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Axel Lin and committed by
Linus Torvalds
87e06aa3 0fa9aa20

+7 -15
-7
fs/ramfs/file-mmu.c
··· 30 30 31 31 #include "internal.h" 32 32 33 - const struct address_space_operations ramfs_aops = { 34 - .readpage = simple_readpage, 35 - .write_begin = simple_write_begin, 36 - .write_end = simple_write_end, 37 - .set_page_dirty = __set_page_dirty_no_writeback, 38 - }; 39 - 40 33 const struct file_operations ramfs_file_operations = { 41 34 .read = do_sync_read, 42 35 .aio_read = generic_file_aio_read,
-7
fs/ramfs/file-nommu.c
··· 34 34 unsigned long flags); 35 35 static int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma); 36 36 37 - const struct address_space_operations ramfs_aops = { 38 - .readpage = simple_readpage, 39 - .write_begin = simple_write_begin, 40 - .write_end = simple_write_end, 41 - .set_page_dirty = __set_page_dirty_no_writeback, 42 - }; 43 - 44 37 const struct file_operations ramfs_file_operations = { 45 38 .mmap = ramfs_nommu_mmap, 46 39 .get_unmapped_area = ramfs_nommu_get_unmapped_area,
+7
fs/ramfs/inode.c
··· 43 43 static const struct super_operations ramfs_ops; 44 44 static const struct inode_operations ramfs_dir_inode_operations; 45 45 46 + static const struct address_space_operations ramfs_aops = { 47 + .readpage = simple_readpage, 48 + .write_begin = simple_write_begin, 49 + .write_end = simple_write_end, 50 + .set_page_dirty = __set_page_dirty_no_writeback, 51 + }; 52 + 46 53 static struct backing_dev_info ramfs_backing_dev_info = { 47 54 .name = "ramfs", 48 55 .ra_pages = 0, /* No readahead */
-1
fs/ramfs/internal.h
··· 10 10 */ 11 11 12 12 13 - extern const struct address_space_operations ramfs_aops; 14 13 extern const struct inode_operations ramfs_file_inode_operations;