xfs: prepare xfs_break_layouts() for another layout type
[linux-2.6-microblaze.git] / fs / xfs / xfs_pnfs.c
index 6ea7b0b..f44c359 100644 (file)
  * rules in the page fault path we don't bother.
  */
 int
-xfs_break_layouts(
+xfs_break_leased_layouts(
        struct inode            *inode,
-       uint                    *iolock)
+       uint                    *iolock,
+       bool                    *did_unlock)
 {
        struct xfs_inode        *ip = XFS_I(inode);
        int                     error;
 
-       ASSERT(xfs_isilocked(ip, XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL));
-
        while ((error = break_layout(inode, false) == -EWOULDBLOCK)) {
                xfs_iunlock(ip, *iolock);
+               *did_unlock = true;
                error = break_layout(inode, true);
                *iolock &= ~XFS_IOLOCK_SHARED;
                *iolock |= XFS_IOLOCK_EXCL;
@@ -121,8 +121,8 @@ xfs_fs_map_blocks(
         * Lock out any other I/O before we flush and invalidate the pagecache,
         * and then hand out a layout to the remote system.  This is very
         * similar to direct I/O, except that the synchronization is much more
-        * complicated.  See the comment near xfs_break_layouts for a detailed
-        * explanation.
+        * complicated.  See the comment near xfs_break_leased_layouts
+        * for a detailed explanation.
         */
        xfs_ilock(ip, XFS_IOLOCK_EXCL);