[PATCH 4/6] udf: Replace BKL

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alessio Igor Bogani
Date: Saturday, October 23, 2010 - 4:37 am

Replace BKL with i_mutex in udf_symlink_filler function.

This work was supported by a hardware donation from the CE Linux Forum.

Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
---
 fs/udf/symlink.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/udf/symlink.c b/fs/udf/symlink.c
index 1606478..cdf4492 100644
--- a/fs/udf/symlink.c
+++ b/fs/udf/symlink.c
@@ -27,7 +27,7 @@
 #include <linux/mm.h>
 #include <linux/stat.h>
 #include <linux/pagemap.h>
-#include <linux/smp_lock.h>
+#include <linux/mutex.h>
 #include <linux/buffer_head.h>
 #include "udf_i.h"
 
@@ -79,8 +79,8 @@ static int udf_symlink_filler(struct file *file, struct page *page)
 	unsigned char *p = kmap(page);
 	struct udf_inode_info *iinfo;
 
-	lock_kernel();
 	iinfo = UDF_I(inode);
+	mutex_lock(&inode->i_mutex);
 	if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
 		symlink = iinfo->i_ext.i_data + iinfo->i_lenEAttr;
 	} else {
@@ -95,14 +95,14 @@ static int udf_symlink_filler(struct file *file, struct page *page)
 	udf_pc_to_char(inode->i_sb, symlink, inode->i_size, p);
 	brelse(bh);
 
-	unlock_kernel();
+	mutex_unlock(&inode->i_mutex);
 	SetPageUptodate(page);
 	kunmap(page);
 	unlock_page(page);
 	return 0;
 
 out:
-	unlock_kernel();
+	mutex_unlock(&inode->i_mutex);
 	SetPageError(page);
 	kunmap(page);
 	unlock_page(page);
-- 
1.7.0.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/6] udf: Replace BKL with superblock's mutex s_lock, Alessio Igor Bogani, (Sat Oct 23, 4:37 am)
[PATCH 2/6] udf: Remove BKL, Alessio Igor Bogani, (Sat Oct 23, 4:37 am)
[PATCH 3/6] udf: Remove BKL, Alessio Igor Bogani, (Sat Oct 23, 4:37 am)
[PATCH 4/6] udf: Replace BKL, Alessio Igor Bogani, (Sat Oct 23, 4:37 am)
[PATCH 5/6] udf: Remove BKL, Alessio Igor Bogani, (Sat Oct 23, 4:37 am)
[PATCH 6/6] udf: Replace BKL, Alessio Igor Bogani, (Sat Oct 23, 4:37 am)
Re: [PATCH 1/6] udf: Replace BKL with superblock's mutex s ..., Christoph Hellwig, (Sat Oct 23, 4:46 am)