[RFC 3/3] BKL: Remove default_llseek()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



default_llseek() is using the big kernel lock. There are only two users of
that function that can both can be converted to use generic_file_llseek(). So
get rid of default_llseek() completely.

Signed-off-by: Jan Blunck <jblunck@xxxxxxx>
---
 fs/hppfs/hppfs.c |    2 +-
 fs/proc/inode.c  |    2 +-
 fs/read_write.c  |   32 +-------------------------------
 3 files changed, 3 insertions(+), 33 deletions(-)

diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c
index 6263973..c833f8a 100644
--- a/fs/hppfs/hppfs.c
+++ b/fs/hppfs/hppfs.c
@@ -537,7 +537,7 @@ static loff_t hppfs_llseek(struct file *file, loff_t off, int where)
 			return ret;
 	}
 
-	return default_llseek(file, off, where);
+	return generic_file_llseek(file, off, where);
 }
 
 static const struct file_operations hppfs_file_fops = {
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index d78ade3..4e57906 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -159,7 +159,7 @@ static loff_t proc_reg_llseek(struct file *file, loff_t offset, int whence)
 	spin_unlock(&pde->pde_unload_lock);
 
 	if (!llseek)
-		llseek = default_llseek;
+		llseek = generic_file_llseek;
 	rv = llseek(file, offset, whence);
 
 	pde_users_dec(pde);
diff --git a/fs/read_write.c b/fs/read_write.c
index 3ac2898..acfb4bb 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -103,43 +103,13 @@ loff_t no_llseek(struct file *file, loff_t offset, int origin)
 }
 EXPORT_SYMBOL(no_llseek);
 
-loff_t default_llseek(struct file *file, loff_t offset, int origin)
-{
-	loff_t retval;
-
-	lock_kernel();
-	switch (origin) {
-		case SEEK_END:
-			offset += i_size_read(file->f_path.dentry->d_inode);
-			break;
-		case SEEK_CUR:
-			if (offset == 0) {
-				retval = file->f_pos;
-				goto out;
-			}
-			offset += file->f_pos;
-	}
-	retval = -EINVAL;
-	if (offset >= 0) {
-		if (offset != file->f_pos) {
-			file->f_pos = offset;
-			file->f_version = 0;
-		}
-		retval = offset;
-	}
-out:
-	unlock_kernel();
-	return retval;
-}
-EXPORT_SYMBOL(default_llseek);
-
 loff_t vfs_llseek(struct file *file, loff_t offset, int origin)
 {
 	loff_t (*fn)(struct file *, loff_t, int);
 
 	fn = no_llseek;
 	if (file->f_mode & FMODE_LSEEK) {
-		fn = default_llseek;
+		fn = generic_file_llseek;
 		if (file->f_op && file->f_op->llseek)
 			fn = file->f_op->llseek;
 	}
-- 
1.6.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux