]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge tag 'xfs-pnfs-for-linus-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 21 Feb 2015 22:09:38 +0000 (14:09 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 21 Feb 2015 22:09:38 +0000 (14:09 -0800)
Pull xfs pnfs block layout support from Dave Chinner:
 "This contains the changes to XFS needed to support the PNFS block
  layout server that you pulled in through Bruce's NFS server tree
  merge.

  I originally thought that I'd need to merge changes into the NFS
  server side, but Bruce had already picked them up and so this is
  purely changes to the fs/xfs/ codebase.

  Summary:

  This update contains the implementation of the PNFS server export
  methods that enable use of XFS filesystems as a block layout target"

* tag 'xfs-pnfs-for-linus-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs:
  xfs: recall pNFS layouts on conflicting access
  xfs: implement pNFS export operations

1  2 
fs/xfs/xfs_file.c

diff --combined fs/xfs/xfs_file.c
index 1cdba95c78cb3e2475de29e0b6d88df3604e4cdf,56dcfce8d7d67a291457daaf0f150e1e48e9c8fe..ce615d12fb44cfae0d6bf344cbf0b3d2e4f43e1d
@@@ -36,6 -36,7 +36,7 @@@
  #include "xfs_trace.h"
  #include "xfs_log.h"
  #include "xfs_icache.h"
+ #include "xfs_pnfs.h"
  
  #include <linux/aio.h>
  #include <linux/dcache.h>
@@@ -554,6 -555,10 +555,10 @@@ restart
        if (error)
                return error;
  
+       error = xfs_break_layouts(inode, iolock);
+       if (error)
+               return error;
        /*
         * If the offset is beyond the size of the file, we need to zero any
         * blocks that fall between the existing EOF and the start of this
@@@ -735,7 -740,7 +740,7 @@@ xfs_file_buffered_aio_write
  
        iov_iter_truncate(from, count);
        /* We can write back this queue in page reclaim */
 -      current->backing_dev_info = mapping->backing_dev_info;
 +      current->backing_dev_info = inode_to_bdi(inode);
  
  write_retry:
        trace_xfs_file_buffered_write(ip, count, iocb->ki_pos, 0);
@@@ -822,6 -827,7 +827,7 @@@ xfs_file_fallocate
        struct xfs_inode        *ip = XFS_I(inode);
        long                    error;
        enum xfs_prealloc_flags flags = 0;
+       uint                    iolock = XFS_IOLOCK_EXCL;
        loff_t                  new_size = 0;
  
        if (!S_ISREG(inode->i_mode))
                     FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_ZERO_RANGE))
                return -EOPNOTSUPP;
  
-       xfs_ilock(ip, XFS_IOLOCK_EXCL);
+       xfs_ilock(ip, iolock);
+       error = xfs_break_layouts(inode, &iolock);
+       if (error)
+               goto out_unlock;
        if (mode & FALLOC_FL_PUNCH_HOLE) {
                error = xfs_free_file_space(ip, offset, len);
                if (error)
        }
  
  out_unlock:
-       xfs_iunlock(ip, XFS_IOLOCK_EXCL);
+       xfs_iunlock(ip, iolock);
        return error;
  }
  
@@@ -1404,4 -1414,5 +1414,4 @@@ static const struct vm_operations_struc
        .fault          = filemap_fault,
        .map_pages      = filemap_map_pages,
        .page_mkwrite   = xfs_vm_page_mkwrite,
 -      .remap_pages    = generic_file_remap_pages,
  };