]> err.no Git - linux-2.6/blobdiff - fs/gfs2/ops_address.c
ocfs2/dlm: Create slabcaches for lock and lockres
[linux-2.6] / fs / gfs2 / ops_address.c
index 8f94e306c8626b5618faa8d89f84dcd5c192bc20..ac772b6d9dbbfa6cde57fb366fdd54e11dd68d5a 100644 (file)
@@ -446,7 +446,7 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct page *page)
         * so we need to supply one here. It doesn't happen often.
         */
        if (unlikely(page->index)) {
-               zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
+               zero_user(page, 0, PAGE_CACHE_SIZE);
                return 0;
        }
 
@@ -646,7 +646,6 @@ static int gfs2_write_begin(struct file *file, struct address_space *mapping,
        if (error)
                goto out_unlock;
 
-       ip->i_alloc.al_requested = 0;
        if (alloc_required) {
                al = gfs2_alloc_get(ip);
 
@@ -823,7 +822,7 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping,
        struct gfs2_inode *ip = GFS2_I(inode);
        struct gfs2_sbd *sdp = GFS2_SB(inode);
        struct buffer_head *dibh;
-       struct gfs2_alloc *al = &ip->i_alloc;
+       struct gfs2_alloc *al = ip->i_alloc;
        struct gfs2_dinode *di;
        unsigned int from = pos & (PAGE_CACHE_SIZE - 1);
        unsigned int to = from + len;
@@ -848,14 +847,11 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping,
 
        ret = generic_write_end(file, mapping, pos, len, copied, page, fsdata);
 
-       if (likely(ret >= 0)) {
-               copied = ret;
-               if  ((pos + copied) > inode->i_size) {
-                       di = (struct gfs2_dinode *)dibh->b_data;
-                       ip->i_di.di_size = inode->i_size;
-                       di->di_size = cpu_to_be64(inode->i_size);
-                       mark_inode_dirty(inode);
-               }
+       if (likely(ret >= 0) && (inode->i_size > ip->i_di.di_size)) {
+               di = (struct gfs2_dinode *)dibh->b_data;
+               ip->i_di.di_size = inode->i_size;
+               di->di_size = cpu_to_be64(inode->i_size);
+               mark_inode_dirty(inode);
        }
 
        if (inode == sdp->sd_rindex)
@@ -864,7 +860,7 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping,
        brelse(dibh);
        gfs2_trans_end(sdp);
 failed:
-       if (al->al_requested) {
+       if (al) {
                gfs2_inplace_release(ip);
                gfs2_quota_unlock(ip);
                gfs2_alloc_put(ip);
@@ -1098,6 +1094,7 @@ static const struct address_space_operations gfs2_writeback_aops = {
        .invalidatepage = gfs2_invalidatepage,
        .releasepage = gfs2_releasepage,
        .direct_IO = gfs2_direct_IO,
+       .migratepage = buffer_migrate_page,
 };
 
 static const struct address_space_operations gfs2_ordered_aops = {
@@ -1112,6 +1109,7 @@ static const struct address_space_operations gfs2_ordered_aops = {
        .invalidatepage = gfs2_invalidatepage,
        .releasepage = gfs2_releasepage,
        .direct_IO = gfs2_direct_IO,
+       .migratepage = buffer_migrate_page,
 };
 
 static const struct address_space_operations gfs2_jdata_aops = {