cluster/gfs-kernel/src/gfs incore.h inode.c op ...
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
gfs-kernel/src/gfs/incore.h +1 -0
@@ -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; };/*
gfs-kernel/src/gfs/inode.c +3 -1
@@ -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;
gfs-kernel/src/gfs/ops_address.c +10 -1
@@ -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, };
gfs-kernel/src/gfs/ops_inode.c +1 -1
@@ -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;