Skip to contentSkip to conversation

v9fs: add readpage support

PATCH RESEND New Eric Van Hensbergen 1 participant 1 message Jan 16, 2006 9P file system

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 v9fs: add readpage support

v9fs mmap support was originally removed from v9fs at Al Viro's request, but recently there have been requests from folks who want readpage functionality (primarily to enable execution of files mounted via 9P). This patch adds readpage support (but not writepage which contained most of the objectionable code). It passes fsx-linux (and other regressions) so it should be relatively safe.

---

 fs/9p/Makefile    |    1 
 fs/9p/v9fs_vfs.h  |    1 
 fs/9p/vfs_addr.c  |  109 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 fs/9p/vfs_file.c  |    4 ++
 fs/9p/vfs_inode.c |    1 
 5 files changed, 116 insertions(+), 0 deletions(-)
 create mode 100644 fs/9p/vfs_addr.c

6a03e904a798fd5665bd484fcbcb4da5a3d0cfed

fs/9p/Makefile +1 -0
index 3d02308..2f4ce43 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_9P_FS) := 9p2000.o
 	conv.o \
 	vfs_super.o \
 	vfs_inode.o \
+	vfs_addr.o \
 	vfs_file.o \
 	vfs_dir.o \
 	vfs_dentry.o \
fs/9p/v9fs_vfs.h +1 -0
index c78502a..69cf290 100644
@@ -39,6 +39,7 @@
  */
 
 extern struct file_system_type v9fs_fs_type;
+extern struct address_space_operations v9fs_addr_operations;
 extern struct file_operations v9fs_file_operations;
 extern struct file_operations v9fs_dir_operations;
 extern struct dentry_operations v9fs_dentry_operations;
fs/9p/vfs_addr.c new file +109 -0

109 lines not on this page · raw message

fs/9p/vfs_file.c +4 -0
index 6852f0e..c7e14d9 100644
@@ -289,6 +289,9 @@ v9fs_file_write(struct file *filp, const
 		total += result;
 	} while (count);
 
+	if(inode->i_mapping->nrpages)
+		invalidate_inode_pages2(inode->i_mapping);
+
 	return total;
 }
 
@@ -299,4 +302,5 @@ struct file_operations v9fs_file_operati
 	.open = v9fs_file_open,
 	.release = v9fs_dir_release,
 	.lock = v9fs_file_lock,
+	.mmap = generic_file_mmap,
 };
fs/9p/vfs_inode.c +1 -0
index a17b288..91f5524 100644
@@ -177,6 +177,7 @@ struct inode *v9fs_get_inode(struct supe
 		inode->i_blocks = 0;
 		inode->i_rdev = 0;
 		inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+		inode->i_mapping->a_ops = &v9fs_addr_operations;
 
 		switch (mode & S_IFMT) {
 		case S_IFIFO:
Signature · 1 line
1.0.GIT