Skip to contentSkip to conversation

ramfs: move ramfs_aops to inode.c

PATCH New Axel Lin 1 participant 1 message Nov 22, 2013

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 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.

---
 fs/ramfs/file-mmu.c   | 7 -------
 fs/ramfs/file-nommu.c | 7 -------
 fs/ramfs/inode.c      | 7 +++++++
 fs/ramfs/internal.h   | 1 -
 4 files changed, 7 insertions(+), 15 deletions(-)
fs/ramfs/file-mmu.c +0 -7
index 4884ac5..1e56a4e 100644
@@ -30,13 +30,6 @@
 
 #include "internal.h"
 
-const struct address_space_operations ramfs_aops = {
-	.readpage	= simple_readpage,
-	.write_begin	= simple_write_begin,
-	.write_end	= simple_write_end,
-	.set_page_dirty = __set_page_dirty_no_writeback,
-};
-
 const struct file_operations ramfs_file_operations = {
 	.read		= do_sync_read,
 	.aio_read	= generic_file_aio_read,
fs/ramfs/file-nommu.c +0 -7
index 80862b1..0b3d8e4 100644
@@ -34,13 +34,6 @@ static unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
 						   unsigned long flags);
 static int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma);
 
-const struct address_space_operations ramfs_aops = {
-	.readpage		= simple_readpage,
-	.write_begin		= simple_write_begin,
-	.write_end		= simple_write_end,
-	.set_page_dirty		= __set_page_dirty_no_writeback,
-};
-
 const struct file_operations ramfs_file_operations = {
 	.mmap			= ramfs_nommu_mmap,
 	.get_unmapped_area	= ramfs_nommu_get_unmapped_area,
fs/ramfs/inode.c +7 -0
index 39d1465..6eadc96 100644
@@ -43,6 +43,13 @@
 static const struct super_operations ramfs_ops;
 static const struct inode_operations ramfs_dir_inode_operations;
 
+static const struct address_space_operations ramfs_aops = {
+	.readpage	= simple_readpage,
+	.write_begin	= simple_write_begin,
+	.write_end	= simple_write_end,
+	.set_page_dirty	= __set_page_dirty_no_writeback,
+};
+
 static struct backing_dev_info ramfs_backing_dev_info = {
 	.name		= "ramfs",
 	.ra_pages	= 0,	/* No readahead */
fs/ramfs/internal.h +0 -1
index 6b33063..a9d8ae8 100644
@@ -10,5 +10,4 @@
  */
 
 
-extern const struct address_space_operations ramfs_aops;
 extern const struct inode_operations ramfs_file_inode_operations;
Signature · 1 line
1.8.1.2