Skip to content

Commit 87e06aa

Browse files
AxelLintorvalds
authored andcommitted
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>
1 parent 0fa9aa2 commit 87e06aa

4 files changed

Lines changed: 7 additions & 15 deletions

File tree

‎fs/ramfs/file-mmu.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@
3030

3131
#include "internal.h"
3232

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-
4033
const struct file_operations ramfs_file_operations = {
4134
.read = do_sync_read,
4235
.aio_read = generic_file_aio_read,

‎fs/ramfs/file-nommu.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ static unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
3434
unsigned long flags);
3535
static int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma);
3636

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-
4437
const struct file_operations ramfs_file_operations = {
4538
.mmap = ramfs_nommu_mmap,
4639
.get_unmapped_area = ramfs_nommu_get_unmapped_area,

‎fs/ramfs/inode.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343
static const struct super_operations ramfs_ops;
4444
static const struct inode_operations ramfs_dir_inode_operations;
4545

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+
4653
static struct backing_dev_info ramfs_backing_dev_info = {
4754
.name = "ramfs",
4855
.ra_pages = 0, /* No readahead */

‎fs/ramfs/internal.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@
1010
*/
1111

1212

13-
extern const struct address_space_operations ramfs_aops;
1413
extern const struct inode_operations ramfs_file_inode_operations;

0 commit comments

Comments
 (0)