|
@@ -31,17 +31,17 @@
|
|
* rules in the page fault path we don't bother.
|
|
* rules in the page fault path we don't bother.
|
|
*/
|
|
*/
|
|
int
|
|
int
|
|
-xfs_break_layouts(
|
|
|
|
|
|
+xfs_break_leased_layouts(
|
|
struct inode *inode,
|
|
struct inode *inode,
|
|
- uint *iolock)
|
|
|
|
|
|
+ uint *iolock,
|
|
|
|
+ bool *did_unlock)
|
|
{
|
|
{
|
|
struct xfs_inode *ip = XFS_I(inode);
|
|
struct xfs_inode *ip = XFS_I(inode);
|
|
int error;
|
|
int error;
|
|
|
|
|
|
- ASSERT(xfs_isilocked(ip, XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL));
|
|
|
|
-
|
|
|
|
while ((error = break_layout(inode, false) == -EWOULDBLOCK)) {
|
|
while ((error = break_layout(inode, false) == -EWOULDBLOCK)) {
|
|
xfs_iunlock(ip, *iolock);
|
|
xfs_iunlock(ip, *iolock);
|
|
|
|
+ *did_unlock = true;
|
|
error = break_layout(inode, true);
|
|
error = break_layout(inode, true);
|
|
*iolock &= ~XFS_IOLOCK_SHARED;
|
|
*iolock &= ~XFS_IOLOCK_SHARED;
|
|
*iolock |= XFS_IOLOCK_EXCL;
|
|
*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,
|
|
* 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
|
|
* 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
|
|
* 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);
|
|
xfs_ilock(ip, XFS_IOLOCK_EXCL);
|
|
|
|
|