]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/linux-2.6/xfs_aops.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-2.6-omap-h63xx.git] / fs / xfs / linux-2.6 / xfs_aops.c
index d20df39186501ef6075115ab0633be7118a2ae75..a55c3b26d840e5e7d1be37fcb727dfd3c0f2686a 100644 (file)
@@ -113,7 +113,7 @@ xfs_find_bdev_for_inode(
 {
        struct xfs_mount        *mp = ip->i_mount;
 
-       if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME)
+       if (XFS_IS_REALTIME_INODE(ip))
                return mp->m_rtdev_targp->bt_bdev;
        else
                return mp->m_ddev_targp->bt_bdev;
@@ -163,7 +163,7 @@ xfs_destroy_ioend(
 /*
  * Update on-disk file size now that data has been written to disk.
  * The current in-memory file size is i_size.  If a write is beyond
- * eof io_new_size will be the intended file size until i_size is
+ * eof i_new_size will be the intended file size until i_size is
  * updated.  If this write does not extend all the way to the valid
  * file size then restrict this update to the end of the write.
  */
@@ -185,7 +185,7 @@ xfs_setfilesize(
 
        xfs_ilock(ip, XFS_ILOCK_EXCL);
 
-       isize = MAX(ip->i_size, ip->i_iocore.io_new_size);
+       isize = MAX(ip->i_size, ip->i_new_size);
        isize = MIN(isize, bsize);
 
        if (ip->i_d.di_size < isize) {
@@ -243,8 +243,12 @@ xfs_end_bio_unwritten(
        size_t                  size = ioend->io_size;
 
        if (likely(!ioend->io_error)) {
-               if (!XFS_FORCED_SHUTDOWN(ip->i_mount))
-                       xfs_iomap_write_unwritten(ip, offset, size);
+               if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) {
+                       int error;
+                       error = xfs_iomap_write_unwritten(ip, offset, size);
+                       if (error)
+                               ioend->io_error = error;
+               }
                xfs_setfilesize(ioend);
        }
        xfs_destroy_ioend(ioend);
@@ -1532,9 +1536,9 @@ xfs_vm_bmap(
        struct xfs_inode        *ip = XFS_I(inode);
 
        xfs_itrace_entry(XFS_I(inode));
-       xfs_rwlock(ip, VRWLOCK_READ);
+       xfs_ilock(ip, XFS_IOLOCK_SHARED);
        xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF);
-       xfs_rwunlock(ip, VRWLOCK_READ);
+       xfs_iunlock(ip, XFS_IOLOCK_SHARED);
        return generic_block_bmap(mapping, block, xfs_get_blocks);
 }