]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/xfs_vnodeops.c
[XFS] Remove unused argument to xfs_bmap_finish
[linux-2.6-omap-h63xx.git] / fs / xfs / xfs_vnodeops.c
index 2c79c367058929ae18cd289c639efe20d2134133..718e18c142a5f513183703701c67ca50cea57811 100644 (file)
@@ -1381,7 +1381,7 @@ xfs_inactive_symlink_rmt(
        /*
         * Commit the first transaction.  This logs the EFI and the inode.
         */
-       if ((error = xfs_bmap_finish(&tp, &free_list, first_block, &committed)))
+       if ((error = xfs_bmap_finish(&tp, &free_list, &committed)))
                goto error1;
        /*
         * The transaction must have been committed, since there were
@@ -1790,8 +1790,7 @@ xfs_inactive(
                 * Just ignore errors at this point.  There is
                 * nothing we can do except to try to keep going.
                 */
-               (void) xfs_bmap_finish(&tp,  &free_list, first_block,
-                                      &committed);
+               (void) xfs_bmap_finish(&tp,  &free_list, &committed);
                (void) xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL);
        }
        /*
@@ -2022,7 +2021,7 @@ xfs_create(
        IHOLD(ip);
        vp = XFS_ITOV(ip);
 
-       error = xfs_bmap_finish(&tp, &free_list, first_block, &committed);
+       error = xfs_bmap_finish(&tp, &free_list, &committed);
        if (error) {
                xfs_bmap_cancel(&free_list);
                goto abort_rele;
@@ -2507,7 +2506,7 @@ xfs_remove(
                xfs_trans_set_sync(tp);
        }
 
-       error = xfs_bmap_finish(&tp, &free_list, first_block, &committed);
+       error = xfs_bmap_finish(&tp, &free_list, &committed);
        if (error) {
                REMOVE_DEBUG_TRACE(__LINE__);
                goto error_rele;
@@ -2715,7 +2714,7 @@ xfs_link(
                xfs_trans_set_sync(tp);
        }
 
-       error = xfs_bmap_finish (&tp, &free_list, first_block, &committed);
+       error = xfs_bmap_finish (&tp, &free_list, &committed);
        if (error) {
                xfs_bmap_cancel(&free_list);
                goto abort_return;
@@ -2932,7 +2931,7 @@ xfs_mkdir(
                xfs_trans_set_sync(tp);
        }
 
-       error = xfs_bmap_finish(&tp, &free_list, first_block, &committed);
+       error = xfs_bmap_finish(&tp, &free_list, &committed);
        if (error) {
                IRELE(cdp);
                goto error2;
@@ -3183,7 +3182,7 @@ xfs_rmdir(
                xfs_trans_set_sync(tp);
        }
 
-       error = xfs_bmap_finish (&tp, &free_list, first_block, &committed);
+       error = xfs_bmap_finish (&tp, &free_list, &committed);
        if (error) {
                xfs_bmap_cancel(&free_list);
                xfs_trans_cancel(tp, (XFS_TRANS_RELEASE_LOG_RES |
@@ -3533,7 +3532,7 @@ xfs_symlink(
         */
        IHOLD(ip);
 
-       error = xfs_bmap_finish(&tp, &free_list, first_block, &committed);
+       error = xfs_bmap_finish(&tp, &free_list, &committed);
        if (error) {
                goto error2;
        }
@@ -3827,11 +3826,16 @@ xfs_reclaim(
         */
        xfs_synchronize_atime(ip);
 
-       /* If we have nothing to flush with this inode then complete the
-        * teardown now, otherwise break the link between the xfs inode
-        * and the linux inode and clean up the xfs inode later. This
-        * avoids flushing the inode to disk during the delete operation
-        * itself.
+       /*
+        * If we have nothing to flush with this inode then complete the
+        * teardown now, otherwise break the link between the xfs inode and the
+        * linux inode and clean up the xfs inode later. This avoids flushing
+        * the inode to disk during the delete operation itself.
+        *
+        * When breaking the link, we need to set the XFS_IRECLAIMABLE flag
+        * first to ensure that xfs_iunpin() will never see an xfs inode
+        * that has a linux inode being reclaimed. Synchronisation is provided
+        * by the i_flags_lock.
         */
        if (!ip->i_update_core && (ip->i_itemp == NULL)) {
                xfs_ilock(ip, XFS_ILOCK_EXCL);
@@ -3840,13 +3844,13 @@ xfs_reclaim(
        } else {
                xfs_mount_t     *mp = ip->i_mount;
 
-               /* Protect sync from us */
+               /* Protect sync and unpin from us */
                XFS_MOUNT_ILOCK(mp);
-               vn_bhv_remove(VN_BHV_HEAD(vp), XFS_ITOBHV(ip));
-               list_add_tail(&ip->i_reclaim, &mp->m_del_inodes);
                spin_lock(&ip->i_flags_lock);
-               ip->i_flags |= XFS_IRECLAIMABLE;
+               __xfs_iflags_set(ip, XFS_IRECLAIMABLE);
+               vn_bhv_remove(VN_BHV_HEAD(vp), XFS_ITOBHV(ip));
                spin_unlock(&ip->i_flags_lock);
+               list_add_tail(&ip->i_reclaim, &mp->m_del_inodes);
                XFS_MOUNT_IUNLOCK(mp);
        }
        return 0;
@@ -3872,8 +3876,8 @@ xfs_finish_reclaim(
         */
        write_lock(&ih->ih_lock);
        spin_lock(&ip->i_flags_lock);
-       if ((ip->i_flags & XFS_IRECLAIM) ||
-           (!(ip->i_flags & XFS_IRECLAIMABLE) && vp == NULL)) {
+       if (__xfs_iflags_test(ip, XFS_IRECLAIM) ||
+           (!__xfs_iflags_test(ip, XFS_IRECLAIMABLE) && vp == NULL)) {
                spin_unlock(&ip->i_flags_lock);
                write_unlock(&ih->ih_lock);
                if (locked) {
@@ -3882,7 +3886,7 @@ xfs_finish_reclaim(
                }
                return 1;
        }
-       ip->i_flags |= XFS_IRECLAIM;
+       __xfs_iflags_set(ip, XFS_IRECLAIM);
        spin_unlock(&ip->i_flags_lock);
        write_unlock(&ih->ih_lock);
 
@@ -4140,7 +4144,7 @@ retry:
                /*
                 * Complete the transaction
                 */
-               error = xfs_bmap_finish(&tp, &free_list, firstfsb, &committed);
+               error = xfs_bmap_finish(&tp, &free_list, &committed);
                if (error) {
                        goto error0;
                }
@@ -4447,7 +4451,7 @@ xfs_free_file_space(
                /*
                 * complete the transaction
                 */
-               error = xfs_bmap_finish(&tp, &free_list, firstfsb, &committed);
+               error = xfs_bmap_finish(&tp, &free_list, &committed);
                if (error) {
                        goto error0;
                }