From patchwork Mon Jan 28 19:41:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 2058031 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id F418ADF2A1 for ; Mon, 28 Jan 2013 19:41:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751166Ab3A1Tlj (ORCPT ); Mon, 28 Jan 2013 14:41:39 -0500 Received: from mail-gg0-f177.google.com ([209.85.161.177]:45530 "EHLO mail-gg0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750906Ab3A1Tli (ORCPT ); Mon, 28 Jan 2013 14:41:38 -0500 Received: by mail-gg0-f177.google.com with SMTP id q1so471932gge.36 for ; Mon, 28 Jan 2013 11:41:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=TV4uIi4fFoBYybT+wNIYLPftiNOMnosEzNbo8JfF/l8=; b=BVqXj6JSwyeEdC0iG56yv5rr6ffz0TXNrD6mIZjPgzw/6qmef9Dvhb8MfJloWskygw 7sg3xgTnUf59VPxsHyFI29DMls7WLSdADLbkmbyUS655R1boj3Tqf51sUxd4yy4Kef3y 5hdEtZBdc+J5mY57jszai40wkBqmR0HWjLnF5EKRTsoHNx4zwXDmeqf721z0OV1fLQbK 7hddgBK93p9IorbHP06xef1ueJp6z8iOYHmD8hFWUtyEYJ9wY0p6XKPZhH2Obik4ZpxI lvJhO0eCsvK2sDFLPCr2HNuhhyhsZRCABT1RnsEB3OdugPGK8MyIME8K89Unya5s5Ak5 XgjQ== X-Received: by 10.100.209.15 with SMTP id h15mr4595000ang.30.1359402098138; Mon, 28 Jan 2013 11:41:38 -0800 (PST) Received: from salusa.poochiereds.net (cpe-107-015-113-143.nc.res.rr.com. [107.15.113.143]) by mx.google.com with ESMTPS id i24sm9712873ann.16.2013.01.28.11.41.35 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 28 Jan 2013 11:41:36 -0800 (PST) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH v1 02/16] nfsd: remove unneeded spinlock in nfsd_cache_update Date: Mon, 28 Jan 2013 14:41:08 -0500 Message-Id: <1359402082-29195-3-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1359402082-29195-1-git-send-email-jlayton@redhat.com> References: <1359402082-29195-1-git-send-email-jlayton@redhat.com> X-Gm-Message-State: ALoCoQm4Mt4iPpiVB2Y4vulhq6jYSXVUmBIqcd8MA4BtQnK6WUvvtJDw9Ub3Am2A/LxYN4SDen3O Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org The locking rules for cache entries say that locking the cache_lock isn't needed if you're just touching the current entry. Earlier in this function we set rp->c_state to RC_UNUSED without any locking, so I believe it's ok to do the same here. Signed-off-by: Jeff Layton --- fs/nfsd/nfscache.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c index 5dd9ec2..972c14a 100644 --- a/fs/nfsd/nfscache.c +++ b/fs/nfsd/nfscache.c @@ -286,9 +286,7 @@ nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp) cachv = &rp->c_replvec; cachv->iov_base = kmalloc(len << 2, GFP_KERNEL); if (!cachv->iov_base) { - spin_lock(&cache_lock); rp->c_state = RC_UNUSED; - spin_unlock(&cache_lock); return; } cachv->iov_len = len << 2;