From: Jan Blunck Subject: [RFC 3/3] BKL: Remove default_llseek() Date: Wed, 30 Sep 2009 17:30:04 +0200 Message-ID: <1254324604-20243-4-git-send-email-jblunck@suse.de> References: <1254324604-20243-1-git-send-email-jblunck@suse.de> To: linux-fsdevel@vger.kernel.org Return-path: Received: from cantor.suse.de ([195.135.220.2]:41942 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754518AbZI3PaB (ORCPT ); Wed, 30 Sep 2009 11:30:01 -0400 Received: from relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 1856E8D893 for ; Wed, 30 Sep 2009 17:30:05 +0200 (CEST) In-Reply-To: <1254324604-20243-1-git-send-email-jblunck@suse.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 --- 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