From: Jan Blunck <jblunck@suse.de>
To: linux-fsdevel@vger.kernel.org
Subject: [RFC 3/3] BKL: Remove default_llseek()
Date: Wed, 30 Sep 2009 17:30:04 +0200 [thread overview]
Message-ID: <1254324604-20243-4-git-send-email-jblunck@suse.de> (raw)
In-Reply-To: <1254324604-20243-1-git-send-email-jblunck@suse.de>
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@suse.de>
---
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
next prev parent reply other threads:[~2009-09-30 15:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-30 15:30 [RFC 0/3] Remove BKL from fs/ Jan Blunck
2009-09-30 15:30 ` [RFC 1/3] BKL pushdown from do_new_mount() to the filesystems Jan Blunck
2009-09-30 15:46 ` Matthew Wilcox
2009-10-01 18:05 ` Jan Blunck
2009-10-08 15:49 ` Boaz Harrosh
2009-10-31 12:26 ` Jan Blunck
2009-09-30 15:30 ` [RFC 2/3] BKL: remove from ext2 Jan Blunck
2009-10-01 18:01 ` Christoph Hellwig
2009-10-31 12:24 ` Jan Blunck
2009-10-07 5:44 ` Andi Kleen
2009-09-30 15:30 ` Jan Blunck [this message]
2009-10-01 18:06 ` [RFC 3/3] BKL: Remove default_llseek() Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1254324604-20243-4-git-send-email-jblunck@suse.de \
--to=jblunck@suse.de \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).