This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: RHEL5 - Remove sendfile file op for jdata files.


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=1761a11c1f659482caf24a9131b091b030c938bd
Commit:        1761a11c1f659482caf24a9131b091b030c938bd
Parent:        3e1c8fac2bf8eeb113628a621a2e3724ee0302c3
Author:        Bob Peterson <rpeterso@redhat.com>
AuthorDate:    Mon Dec 15 15:42:19 2008 -0600
Committer:     Bob Peterson <rpeterso@redhat.com>
CommitterDate: Mon Dec 15 15:42:19 2008 -0600

Remove sendfile file op for jdata files.

bz 436811 - Some files with inherit_jdata flag will not allow reads from apache

The sendfile op is supported for normal files but not
journaled files.  Rather than return a bad return code
when invoked, this removes the sendfile op from the
file ops for jdata files.  That enables callers to find
an alternative method of accessing the jdata file rather
than failing the operation.
---
 gfs-kernel/src/gfs/inode.c    |   15 +++++++++++----
 gfs-kernel/src/gfs/ops_file.c |   34 ++++++++++++++++++++++++++++++++++
 gfs-kernel/src/gfs/ops_file.h |    2 ++
 3 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/gfs-kernel/src/gfs/inode.c b/gfs-kernel/src/gfs/inode.c
index 3e2c601..454366a 100644
--- a/gfs-kernel/src/gfs/inode.c
+++ b/gfs-kernel/src/gfs/inode.c
@@ -193,10 +193,17 @@ gfs_iget(struct gfs_inode *ip, int create)
 		memcpy(&ip->gfs_file_aops, &gfs_file_aops,
 			   sizeof(struct address_space_operations));
 		tmp->i_mapping->a_ops = &ip->gfs_file_aops;
-		if (sdp->sd_args.ar_localflocks)
-			tmp->i_fop = &gfs_file_fops_nolock;
-		else
-			tmp->i_fop = &gfs_file_fops;
+		if (sdp->sd_args.ar_localflocks) {
+			if (gfs_is_jdata(ip))
+				tmp->i_fop = &gfs_file_fops_nolock_jdata;
+			else
+				tmp->i_fop = &gfs_file_fops_nolock;
+		} else {
+			if (gfs_is_jdata(ip))
+				tmp->i_fop = &gfs_file_fops_jdata;
+			else
+				tmp->i_fop = &gfs_file_fops;
+		}
 	} else if (ip->i_di.di_type == GFS_FILE_DIR) {
 		tmp->i_op = &gfs_dir_iops;
 		if (sdp->sd_args.ar_localflocks)
diff --git a/gfs-kernel/src/gfs/ops_file.c b/gfs-kernel/src/gfs/ops_file.c
index 5da1ad0..bdeb3be 100644
--- a/gfs-kernel/src/gfs/ops_file.c
+++ b/gfs-kernel/src/gfs/ops_file.c
@@ -1834,6 +1834,24 @@ struct file_operations gfs_file_fops = {
 	.flock = gfs_flock,
 };
 
+struct file_operations gfs_file_fops_jdata = {
+	.llseek = gfs_llseek,
+	.read = gfs_read,
+	.write = gfs_write,
+        .aio_read = gfs_aio_read,
+        .aio_write = gfs_aio_write,
+	.ioctl = gfs_ioctl,
+#ifdef CONFIG_COMPAT
+        .compat_ioctl   = gfs_compat_ioctl,
+#endif
+	.mmap = gfs_mmap,
+	.open = gfs_open,
+	.release = gfs_close,
+	.fsync = gfs_fsync,
+	.lock = gfs_lock,
+	.flock = gfs_flock,
+};
+
 struct file_operations gfs_dir_fops = {
 	.readdir = gfs_readdir,
 	.ioctl = gfs_ioctl,
@@ -1864,6 +1882,22 @@ struct file_operations gfs_file_fops_nolock = {
 	.sendfile = gfs_sendfile,
 };
 
+struct file_operations gfs_file_fops_nolock_jdata = {
+	.llseek = gfs_llseek,
+	.read = gfs_read,
+	.write = gfs_write,
+        .aio_read = gfs_aio_read,
+        .aio_write = gfs_aio_write,
+	.ioctl = gfs_ioctl,
+#ifdef CONFIG_COMPAT
+        .compat_ioctl   = gfs_compat_ioctl,
+#endif
+	.mmap = gfs_mmap,
+	.open = gfs_open,
+	.release = gfs_close,
+	.fsync = gfs_fsync,
+};
+
 struct file_operations gfs_dir_fops_nolock = {
 	.readdir = gfs_readdir,
 	.ioctl = gfs_ioctl,
diff --git a/gfs-kernel/src/gfs/ops_file.h b/gfs-kernel/src/gfs/ops_file.h
index e7f6c26..59283d2 100644
--- a/gfs-kernel/src/gfs/ops_file.h
+++ b/gfs-kernel/src/gfs/ops_file.h
@@ -15,8 +15,10 @@
 #define __OPS_FILE_DOT_H__
 
 extern struct file_operations gfs_file_fops;
+extern struct file_operations gfs_file_fops_jdata;
 extern struct file_operations gfs_dir_fops;
 extern struct file_operations gfs_file_fops_nolock;
+extern struct file_operations gfs_file_fops_nolock_jdata;
 extern struct file_operations gfs_dir_fops_nolock;
 
 #endif /* __OPS_FILE_DOT_H__ */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]