[Cluster-devel] cluster/gfs-kernel/src/gfs incore.h inode.c op ...
rpeterso at sourceware.org
rpeterso at sourceware.org
Tue Oct 10 18:35:28 UTC 2006
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4
Changes by: rpeterso at sourceware.org 2006-10-10 18:35:28
Modified files:
gfs-kernel/src/gfs: incore.h inode.c ops_address.c ops_inode.c
Log message:
Fix for bugzilla bug 164499: Unable to mount loopback images
from mounted GFS partition.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/incore.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.17.2.6&r2=1.17.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/inode.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.20.2.2&r2=1.20.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_address.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.5.2.5&r2=1.5.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs-kernel/src/gfs/ops_inode.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.6.2.3&r2=1.6.2.4
--- cluster/gfs-kernel/src/gfs/incore.h 2006/09/15 21:42:05 1.17.2.6
+++ cluster/gfs-kernel/src/gfs/incore.h 2006/10/10 18:35:27 1.17.2.7
@@ -617,6 +617,7 @@
unsigned int i_greedy; /* The amount of time to be greedy */
unsigned long i_last_pfault; /* The time of the last page fault */
+ struct address_space_operations gfs_file_aops;
};
/*
--- cluster/gfs-kernel/src/gfs/inode.c 2005/08/16 17:10:41 1.20.2.2
+++ cluster/gfs-kernel/src/gfs/inode.c 2006/10/10 18:35:27 1.20.2.3
@@ -191,7 +191,9 @@
if (ip->i_di.di_type == GFS_FILE_REG) {
tmp->i_op = &gfs_file_iops;
tmp->i_fop = &gfs_file_fops;
- tmp->i_mapping->a_ops = &gfs_file_aops;
+ memcpy(&ip->gfs_file_aops, &gfs_file_aops,
+ sizeof(struct address_space_operations));
+ tmp->i_mapping->a_ops = &ip->gfs_file_aops;
} else if (ip->i_di.di_type == GFS_FILE_DIR) {
tmp->i_op = &gfs_dir_iops;
tmp->i_fop = &gfs_dir_fops;
--- cluster/gfs-kernel/src/gfs/ops_address.c 2006/02/20 15:34:05 1.5.2.5
+++ cluster/gfs-kernel/src/gfs/ops_address.c 2006/10/10 18:35:27 1.5.2.6
@@ -32,6 +32,8 @@
#include "quota.h"
#include "trans.h"
+static int gfs_commit_write(struct file *file, struct page *page,
+ unsigned from, unsigned to);
/**
* get_block - Fills in a buffer head with details about a block
* @inode: The inode
@@ -327,6 +329,13 @@
atomic_inc(&sdp->sd_ops_address);
+ /* We can't set commit_write in the structure in the declare */
+ /* because if we do, loopback (loop.c) will interpret that to mean */
+ /* it's okay to do buffered writes without locking through sendfile. */
+ /* This is a kludge to get around the problem with loop.c because */
+ /* the upstream community rejected my changes to loop.c. */
+ ip->gfs_file_aops.commit_write = gfs_commit_write;
+
if (gfs_assert_warn(sdp, gfs_glock_is_locked_by_me(ip->i_gl)))
return -ENOSYS;
@@ -395,6 +404,7 @@
goto fail;
}
+ ip->gfs_file_aops.commit_write = NULL;
return 0;
fail:
@@ -473,7 +483,6 @@
.readpage = gfs_readpage,
.sync_page = block_sync_page,
.prepare_write = gfs_prepare_write,
- .commit_write = gfs_commit_write,
.bmap = gfs_bmap,
.direct_IO = gfs_direct_IO,
};
--- cluster/gfs-kernel/src/gfs/ops_inode.c 2006/04/20 22:30:14 1.6.2.3
+++ cluster/gfs-kernel/src/gfs/ops_inode.c 2006/10/10 18:35:27 1.6.2.4
@@ -952,7 +952,7 @@
return 0;
}
- /* Make sure we aren't trying to move a dirctory into it's subdir */
+ /* Make sure we aren't trying to move a directory into its subdir */
if (ip->i_di.di_type == GFS_FILE_DIR && odip != ndip) {
dir_rename = TRUE;
More information about the Cluster-devel
mailing list