Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9e4... Commit: 9e4ac14c0c65116a05e8b6a7dfd5f7f8ce8f0742 Parent: 48194711384ab9a6af2701fd7313e05c8c0ce1d7 Author: Benjamin Marzinski bmarzins@redhat.com AuthorDate: Wed Jul 28 16:18:21 2010 -0500 Committer: Benjamin Marzinski bmarzins@redhat.com CommitterDate: Wed Jul 28 16:18:21 2010 -0500
Revert "gfs-kernel: assertion "!get_transaction" fails on mmaps between gfs filesystems"
This reverts commit 48194711384ab9a6af2701fd7313e05c8c0ce1d7. --- gfs-kernel/src/gfs/ops_file.c | 70 ++++++++++++++++++----------------------- 1 files changed, 31 insertions(+), 39 deletions(-)
diff --git a/gfs-kernel/src/gfs/ops_file.c b/gfs-kernel/src/gfs/ops_file.c index 44a73e5..150f328 100644 --- a/gfs-kernel/src/gfs/ops_file.c +++ b/gfs-kernel/src/gfs/ops_file.c @@ -192,37 +192,6 @@ walk_vm_hard(struct file *file, char *buf, size_t size, loff_t *offset, }
/** - * grope_mapping - feel up a mapping that needs to be written - * @buf: the start of the memory to be written - * @size: the size of the memory to be written - * - * We do this after acquiring the locks on the mapping, - * but before starting the write transaction. We need to make - * sure that we don't cause recursive transactions if blocks - * need to be allocated to the file backing the mapping. - * - * Returns: errno - */ - -static int -grope_mapping(char *buf, size_t size) -{ - unsigned long start = (unsigned long)buf; - unsigned long stop = start + size; - char c; - - while (start < stop) { - if (copy_from_user(&c, (char *)start, 1)) - return -EFAULT; - - start += PAGE_CACHE_SIZE; - start &= PAGE_CACHE_MASK; - } - - return 0; -} - -/** * walk_vm - Walk the vmas associated with a buffer for read or write. * If any of them are gfs, pass the gfs inode down to the read/write * worker function so that locks can be acquired in the correct order. @@ -242,11 +211,8 @@ walk_vm(struct file *file, char *buf, size_t size, loff_t *offset, struct kiocb *iocb, do_rw_t operation) { - int needs_groping = 0; - if (current->mm) { struct super_block *sb = file->f_dentry->d_inode->i_sb; - struct file_system_type *type = file->f_dentry->d_inode->i_sb->s_type; struct mm_struct *mm = current->mm; struct vm_area_struct *vma; unsigned long start = (unsigned long)buf; @@ -262,9 +228,6 @@ walk_vm(struct file *file, char *buf, size_t size, loff_t *offset, if (vma->vm_file && vma->vm_file->f_dentry->d_inode->i_sb == sb) goto do_locks; - else if (vma->vm_file && - vma->vm_file->f_dentry->d_inode->i_sb->s_type == type) - needs_groping = 1; }
if (!dumping) @@ -273,8 +236,6 @@ walk_vm(struct file *file, char *buf, size_t size, loff_t *offset,
{ struct gfs_holder gh; - if (needs_groping) - grope_mapping(buf, size); return operation(file, buf, size, offset, iocb, 0, &gh); }
@@ -323,6 +284,37 @@ do_read_readi(struct file *file, char *buf, size_t size, loff_t *offset, }
/** + * grope_mapping - feel up a mapping that needs to be written + * @buf: the start of the memory to be written + * @size: the size of the memory to be written + * + * We do this after acquiring the locks on the mapping, + * but before starting the write transaction. We need to make + * sure that we don't cause recursive transactions if blocks + * need to be allocated to the file backing the mapping. + * + * Returns: errno + */ + +static int +grope_mapping(char *buf, size_t size) +{ + unsigned long start = (unsigned long)buf; + unsigned long stop = start + size; + char c; + + while (start < stop) { + if (copy_from_user(&c, (char *)start, 1)) + return -EFAULT; + + start += PAGE_CACHE_SIZE; + start &= PAGE_CACHE_MASK; + } + + return 0; +} + +/** * do_read_direct - Read bytes from a file * @file: The file to read from * @buf: The buffer to copy into
cluster-commits@lists.fedorahosted.org