Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934358AbZJJPid (ORCPT ); Sat, 10 Oct 2009 11:38:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761973AbZJJPiJ (ORCPT ); Sat, 10 Oct 2009 11:38:09 -0400 Received: from www.tglx.de ([62.245.132.106]:55466 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761974AbZJJPiG (ORCPT ); Sat, 10 Oct 2009 11:38:06 -0400 Message-Id: <20091010153349.499835683@linutronix.de> User-Agent: quilt/0.47-1 Date: Sat, 10 Oct 2009 15:36:16 -0000 From: Thomas Gleixner To: LKML Cc: Andrew Morton , Ingo Molnar , Peter Zijlstra , Frederic Weisbecker , Vincent Sanders , John Kacur , Jonathan Corbet , Christoph Hellwig , Sven-Thorsten Dietrich , Alessio Igor Bogani , Benjamin Herrenschmidt , Greg KH Subject: [patch 11/28] nvram: Drop the bkl from nvram_llseek() References: <20091010153314.827301943@linutronix.de> Content-Disposition: inline; filename=nvram-drop-the-bkl-from-nvram_llseek.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1852 Lines: 62 There is nothing to protect inside nvram_llseek(), the file offset doesn't need to be protected and nvram_len is only initialized from an __init path. It's safe to remove the big kernel lock there. Signed-off-by: Frederic Weisbecker Cc: John Kacur Cc: Sven-Thorsten Dietrich Cc: Jonathan Corbet Cc: Alessio Igor Bogani Cc: Benjamin Herrenschmidt Cc: Greg KH LKML-Reference: <1255116030-6929-1-git-send-email-fweisbec@gmail.com> Signed-off-by: Thomas Gleixner --- drivers/char/generic_nvram.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) Index: linux-2.6-tip/drivers/char/generic_nvram.c =================================================================== --- linux-2.6-tip.orig/drivers/char/generic_nvram.c +++ linux-2.6-tip/drivers/char/generic_nvram.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #ifdef CONFIG_PPC_PMAC @@ -32,7 +31,6 @@ static ssize_t nvram_len; static loff_t nvram_llseek(struct file *file, loff_t offset, int origin) { - lock_kernel(); switch (origin) { case 1: offset += file->f_pos; @@ -41,12 +39,11 @@ static loff_t nvram_llseek(struct file * offset += nvram_len; break; } - if (offset < 0) { - unlock_kernel(); + if (offset < 0) return -EINVAL; - } + file->f_pos = offset; - unlock_kernel(); + return file->f_pos; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/