rt2x00: Whitespace cleanup.
[safe/jmp/linux-2.6] / fs / ocfs2 / aops.c
index 9db9d64..deb2b13 100644 (file)
@@ -690,6 +690,10 @@ static ssize_t ocfs2_direct_IO(int rw,
        if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL)
                return 0;
 
+       /* Fallback to buffered I/O if we are appending. */
+       if (i_size_read(inode) <= offset)
+               return 0;
+
        ret = blockdev_direct_IO_no_locking(rw, iocb, inode,
                                            inode->i_sb->s_bdev, iov, offset,
                                            nr_segs, 
@@ -1712,7 +1716,7 @@ int ocfs2_write_begin_nolock(struct address_space *mapping,
                goto out;
        } else if (ret == 1) {
                ret = ocfs2_refcount_cow(inode, di_bh,
-                                        wc->w_cpos, wc->w_clen);
+                                        wc->w_cpos, wc->w_clen, UINT_MAX);
                if (ret) {
                        mlog_errno(ret);
                        goto out;
@@ -2018,4 +2022,5 @@ const struct address_space_operations ocfs2_aops = {
        .releasepage            = ocfs2_releasepage,
        .migratepage            = buffer_migrate_page,
        .is_partially_uptodate  = block_is_partially_uptodate,
+       .error_remove_page      = generic_error_remove_page,
 };