Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[muen/linux.git] / fs / xfs / xfs_aops.c
index 8233dd9..31f1f10 100644 (file)
@@ -209,7 +209,8 @@ xfs_setfilesize_trans_alloc(
        struct xfs_trans        *tp;
        int                     error;
 
-       error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp);
+       error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0,
+                               XFS_TRANS_NOFS, &tp);
        if (error)
                return error;
 
@@ -1330,21 +1331,20 @@ xfs_get_blocks(
        end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + size);
        offset_fsb = XFS_B_TO_FSBT(mp, offset);
 
-       error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb,
-                               &imap, &nimaps, XFS_BMAPI_ENTIRE);
+       error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap,
+                       &nimaps, 0);
        if (error)
                goto out_unlock;
-
-       if (nimaps) {
-               trace_xfs_get_blocks_found(ip, offset, size,
-                       imap.br_state == XFS_EXT_UNWRITTEN ?
-                               XFS_IO_UNWRITTEN : XFS_IO_OVERWRITE, &imap);
-               xfs_iunlock(ip, lockmode);
-       } else {
+       if (!nimaps) {
                trace_xfs_get_blocks_notfound(ip, offset, size);
                goto out_unlock;
        }
 
+       trace_xfs_get_blocks_found(ip, offset, size,
+               imap.br_state == XFS_EXT_UNWRITTEN ?
+                       XFS_IO_UNWRITTEN : XFS_IO_OVERWRITE, &imap);
+       xfs_iunlock(ip, lockmode);
+
        /* trim mapping down to size requested */
        xfs_map_trim_size(inode, iblock, bh_result, &imap, offset, size);