]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Move-clusters-free-into-dealloc.patch
Move xen patchset to new version's subdir.
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.suse / ocfs2-xattr-Move-clusters-free-into-dealloc.patch
diff --git a/src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Move-clusters-free-into-dealloc.patch b/src/patches/suse-2.6.27.31/patches.suse/ocfs2-xattr-Move-clusters-free-into-dealloc.patch
new file mode 100644 (file)
index 0000000..bc04bb4
--- /dev/null
@@ -0,0 +1,62 @@
+From: Tao Ma <tao.ma@oracle.com>
+Date: Wed, 12 Nov 2008 08:26:59 +0800
+Subject: ocfs2/xattr: Move clusters free into dealloc.
+Patch-mainline: 2.6.29
+
+Move clusters free process into dealloc context so that
+they can be freed after the transaction.
+
+Signed-off-by: Tao Ma <tao.ma@oracle.com>
+Signed-off-by: Mark Fasheh <mfasheh@suse.com>
+---
+ fs/ocfs2/xattr.c |   14 +-------------
+ 1 files changed, 1 insertions(+), 13 deletions(-)
+
+diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
+index 4501c63..f1da381 100644
+--- a/fs/ocfs2/xattr.c
++++ b/fs/ocfs2/xattr.c
+@@ -457,7 +457,6 @@ static int __ocfs2_remove_xattr_range(struct inode *inode,
+       int ret;
+       u64 phys_blkno = ocfs2_clusters_to_blocks(inode->i_sb, phys_cpos);
+       struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
+-      struct inode *tl_inode = osb->osb_tl_inode;
+       handle_t *handle;
+       struct ocfs2_alloc_context *meta_ac = NULL;
+       struct ocfs2_extent_tree et;
+@@ -470,16 +469,6 @@ static int __ocfs2_remove_xattr_range(struct inode *inode,
+               return ret;
+       }
+-      mutex_lock(&tl_inode->i_mutex);
+-
+-      if (ocfs2_truncate_log_needs_flush(osb)) {
+-              ret = __ocfs2_flush_truncate_log(osb);
+-              if (ret < 0) {
+-                      mlog_errno(ret);
+-                      goto out;
+-              }
+-      }
+-
+       handle = ocfs2_start_trans(osb, OCFS2_REMOVE_EXTENT_CREDITS);
+       if (IS_ERR(handle)) {
+               ret = PTR_ERR(handle);
+@@ -509,14 +498,13 @@ static int __ocfs2_remove_xattr_range(struct inode *inode,
+               goto out_commit;
+       }
+-      ret = ocfs2_truncate_log_append(osb, handle, phys_blkno, len);
++      ret = ocfs2_cache_cluster_dealloc(dealloc, phys_blkno, len);
+       if (ret)
+               mlog_errno(ret);
+ out_commit:
+       ocfs2_commit_trans(osb, handle);
+ out:
+-      mutex_unlock(&tl_inode->i_mutex);
+       if (meta_ac)
+               ocfs2_free_alloc_context(meta_ac);
+-- 
+1.5.6
+