From patchwork Wed Jan 15 09:46:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13940169 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7F14248171; Wed, 15 Jan 2025 09:47:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934431; cv=none; b=qhyoF0Td6XzWiEDGHTCkH9jDAs2wBFjVPv5Krme4c5dYDC8bnD3IKCrPGPXVFN5hwU6aUJqkatAtPaHmevpTdxZnesmpcDFO4jC4o52slLWR2xzHN2gSISsQaEsQze/KW8shZRwnvvE9hlylDQ7VbqH6WStqR+RGcSjObNzpY3Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934431; c=relaxed/simple; bh=jHM4aD/gL1ggtNvB9ByEUsCGU88B5c3rVl9gfN6z0Kw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mSNdFmKmz3xV7Ubg4xnAVVFO5crkucp+6YCoxAJ0AdVIug8Q2lbiX5oxk1nT5nvCcXvd+DBBIFZZDAVYuBF6nW8282wfhcjItZzMC9TJ78wIrFwwqaIk/tqMy5FLmjtUR3I3dOBISIxAHhFPunsARSkKDMstBiKVOz0BTwHqkA8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=g+5BuL+c; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="g+5BuL+c" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=2emN2ZekPl9pUS8HrHL111sEmJvGZ8RKJUw7xW8tiZU=; b=g+5BuL+cWMKlkPq2h1gfpxLmjj rywUnEu6MLP81WJIXN0CxJ3brcQ8Fja26vBn45gYLf5UPcaz+Mkjd8xR7XkSjCIruNVND/0pxuP2d h4b+V2eX2CWFv7JUC/c24Zm565irmjyEeDFdYLVnSZZ2iFp2X2D4NjaGSPWms3998+G1D66YrZi9c +JLYCK6Upy02luduPiZO2tB9WxIkXVGpUMexecOaZL9Ozn/q4RgIgOBmVaD5aSVvlLbha55jDIYpk EKiV5yC5q1AXqGcmt0JUDE28B8UQqw0Qd4/3l82cCnojKvEmz4wbLBsT0kHJORBeUOfh24SodK03M +3jlm7uQ==; Received: from 2a02-8389-2341-5b80-7ef2-fcbf-2bb2-bbdf.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:7ef2:fcbf:2bb2:bbdf] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tXzzQ-0000000BOcl-1dG1; Wed, 15 Jan 2025 09:47:08 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Al Viro , Christian Brauner , Gao Xiang , Chao Yu , Andreas Gruenbacher , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-erofs@lists.ozlabs.org, gfs2@lists.linux.dev Subject: [PATCH 1/8] lockref: remove lockref_put_not_zero Date: Wed, 15 Jan 2025 10:46:37 +0100 Message-ID: <20250115094702.504610-2-hch@lst.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250115094702.504610-1-hch@lst.de> References: <20250115094702.504610-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html lockref_put_not_zero is not used anywhere, and unless I'm missing something didn't end up being used used at all. Remove it. Signed-off-by: Christoph Hellwig --- include/linux/lockref.h | 1 - lib/lockref.c | 28 ---------------------------- 2 files changed, 29 deletions(-) diff --git a/include/linux/lockref.h b/include/linux/lockref.h index c3a1f78bc884..e5aa0347f274 100644 --- a/include/linux/lockref.h +++ b/include/linux/lockref.h @@ -37,7 +37,6 @@ struct lockref { extern void lockref_get(struct lockref *); extern int lockref_put_return(struct lockref *); extern int lockref_get_not_zero(struct lockref *); -extern int lockref_put_not_zero(struct lockref *); extern int lockref_put_or_lock(struct lockref *); extern void lockref_mark_dead(struct lockref *); diff --git a/lib/lockref.c b/lib/lockref.c index 2afe4c5d8919..a68192c979b3 100644 --- a/lib/lockref.c +++ b/lib/lockref.c @@ -81,34 +81,6 @@ int lockref_get_not_zero(struct lockref *lockref) } EXPORT_SYMBOL(lockref_get_not_zero); -/** - * lockref_put_not_zero - Decrements count unless count <= 1 before decrement - * @lockref: pointer to lockref structure - * Return: 1 if count updated successfully or 0 if count would become zero - */ -int lockref_put_not_zero(struct lockref *lockref) -{ - int retval; - - CMPXCHG_LOOP( - new.count--; - if (old.count <= 1) - return 0; - , - return 1; - ); - - spin_lock(&lockref->lock); - retval = 0; - if (lockref->count > 1) { - lockref->count--; - retval = 1; - } - spin_unlock(&lockref->lock); - return retval; -} -EXPORT_SYMBOL(lockref_put_not_zero); - /** * lockref_put_return - Decrement reference count if possible * @lockref: pointer to lockref structure From patchwork Wed Jan 15 09:46:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13940170 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 614101DB14D; Wed, 15 Jan 2025 09:47:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934433; cv=none; b=UtDXMtd47WZZUVBDMYaDM7l5GaWTsWR6SI3W6xEw+tAz+u6WoH411XMmAaMBS/eTp14Ay/q34Gx6MzxS1qe3BYaVbqHSwgn8pRRoVIbMatTB55ZYUDfj5c4W5psviIw0n7CoSmSI0iZvlTAz32hooFUuMsK7f7n2UAYL7DcPsWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934433; c=relaxed/simple; bh=xIEJNhy01PyOCKKGkI59VhkRuTKgjGtGxL8Zxx1tU3o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CZDjH8BLWW7q93JNaapoeD6LUUoG3ZUnP0kyEsBNeeEwjK4UgfbNX3XKOc4PiX8Ua65aXMFRJ8ypDHoGzvbPPtT0mHiM91vmbJEFVnQk4zawIvuH5CCCcP1IclffAwA1NWoFPe6q5px3Xcwn1mgOPmgb84JVjVCcc+LAnIAULbM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=vnWbtQWr; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="vnWbtQWr" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=JLpZrvaMc6GV46XbuHZJmt3meVmUGd1vvv0MgNmLkC4=; b=vnWbtQWrrFbO8X0TgMRPAb3tVY 2brCcEi1EjC/IEN5Xsm0cmRxzMpRg0Me95z04VjUJTfhoGUxgkc6rtgyCkdSRg+3U0O0D1uCWlZx4 2noVjW6ZSw1ew2Fd0Buq0vq6B/oKRzzZOeSWtkb2zJBcY+c/7pZkPksFZ6ah8B2Fq2Jr1G5VflSJO 77OftBY7nev+P89M32xt+VzoLXQxKgjhiJC7+JqZ/H1Oqs8NmDecshwkBsCcM/kNQqhBfVvUmLJbE hh2hDAz9CNKsT+1PBSp9p9CuEWRUs6zihfOmiTLkm+CIEW9h9Ch7qHw5l775qXw2QsqrNhHWW4Etx loKVmrIQ==; Received: from 2a02-8389-2341-5b80-7ef2-fcbf-2bb2-bbdf.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:7ef2:fcbf:2bb2:bbdf] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tXzzS-0000000BOdo-3nru; Wed, 15 Jan 2025 09:47:11 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Al Viro , Christian Brauner , Gao Xiang , Chao Yu , Andreas Gruenbacher , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-erofs@lists.ozlabs.org, gfs2@lists.linux.dev Subject: [PATCH 2/8] lockref: improve the lockref_get_not_zero description Date: Wed, 15 Jan 2025 10:46:38 +0100 Message-ID: <20250115094702.504610-3-hch@lst.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250115094702.504610-1-hch@lst.de> References: <20250115094702.504610-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html lockref_put_return returns exactly -1 and not "an error" when the lockref is dead or locked. Signed-off-by: Christoph Hellwig --- lib/lockref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lockref.c b/lib/lockref.c index a68192c979b3..b1b042a9a6c8 100644 --- a/lib/lockref.c +++ b/lib/lockref.c @@ -86,7 +86,7 @@ EXPORT_SYMBOL(lockref_get_not_zero); * @lockref: pointer to lockref structure * * Decrement the reference count and return the new value. - * If the lockref was dead or locked, return an error. + * If the lockref was dead or locked, return -1. */ int lockref_put_return(struct lockref *lockref) { From patchwork Wed Jan 15 09:46:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13940171 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA5AC23F280; Wed, 15 Jan 2025 09:47:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934436; cv=none; b=lA5TOeCk5RbbZMK/BxzDqL0xDDupORWu90ECrNQGW9XXq3rWGOiaXDGcEFSRoQ7JIgFmhsYy65D3h5Yy5FSnA9HwTLL9n295v0IL2GtzdvT0C/lb2bQ0dHdYWjPYlglPOCQ3DiObKHIyFbCfwOEEzkrwLUK74EjbeUl9e+z/3zI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934436; c=relaxed/simple; bh=n811duFVKAkIfWm5Z6B/zhieoS2ASsCsFji31GJzTjU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=adpMcX+y0Dor3e+RB8qBiwfa67AejD3RyJs9ymLl/7HWkQdeaCmtMom6uAz0r5zWF9dVOIT72MrshsFMStaSgfr1T9nxH12fRwDZk5bRunMeMFauYSfaNBgbFitTDLfhZI4enu498fARJWPEOKJ3aaXuPqltCA6B73zFduAu2Gg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=h8dpluIR; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="h8dpluIR" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=hPOnhSQ0mVQSxdqd9+OXmMe6Ci3iABOIejHsGxfpgNc=; b=h8dpluIRfwDN/s/F80wti5ojXn 5K6j6iAa+Y1Ss0dCC8pdGnHsR8V8WqiIOUb/KDp2Qod3fGSjLTa8xPYuEPrDdxRJQ3DKHBjd7Dh1g OvI1poxJMckuc++FXPSjpY3tdBh1iYBeD2kav7hWUyspMp8ib/zxMfCf17Xjn6rTl89Hr7Ok9ZL+o RHZkq5gKn48IjS6N23bDigYEZjCQFyPn4Iibj6UQuvT0jaEmo/9QITCWt/8jZqGe8foa8FB13z7Xj Lxz3opalR6o8vDFRp3hRsfX5pNWVV13yKwXiQMVGve6izyO96gJCCJC1MePDG3EvqgTfKc/epzBly cZFUYf/g==; Received: from 2a02-8389-2341-5b80-7ef2-fcbf-2bb2-bbdf.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:7ef2:fcbf:2bb2:bbdf] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tXzzV-0000000BOec-1gaW; Wed, 15 Jan 2025 09:47:13 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Al Viro , Christian Brauner , Gao Xiang , Chao Yu , Andreas Gruenbacher , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-erofs@lists.ozlabs.org, gfs2@lists.linux.dev Subject: [PATCH 3/8] lockref: use bool for false/true returns Date: Wed, 15 Jan 2025 10:46:39 +0100 Message-ID: <20250115094702.504610-4-hch@lst.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250115094702.504610-1-hch@lst.de> References: <20250115094702.504610-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Replace int used as bool with the actual bool type for return values that can only be true or false. Signed-off-by: Christoph Hellwig --- include/linux/lockref.h | 6 +++--- lib/lockref.c | 30 ++++++++++++++---------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/include/linux/lockref.h b/include/linux/lockref.h index e5aa0347f274..3d770e1bdbad 100644 --- a/include/linux/lockref.h +++ b/include/linux/lockref.h @@ -36,11 +36,11 @@ struct lockref { extern void lockref_get(struct lockref *); extern int lockref_put_return(struct lockref *); -extern int lockref_get_not_zero(struct lockref *); -extern int lockref_put_or_lock(struct lockref *); +bool lockref_get_not_zero(struct lockref *lockref); +bool lockref_put_or_lock(struct lockref *lockref); extern void lockref_mark_dead(struct lockref *); -extern int lockref_get_not_dead(struct lockref *); +bool lockref_get_not_dead(struct lockref *lockref); /* Must be called under spinlock for reliable results */ static inline bool __lockref_is_dead(const struct lockref *l) diff --git a/lib/lockref.c b/lib/lockref.c index b1b042a9a6c8..5d8e3ef3860e 100644 --- a/lib/lockref.c +++ b/lib/lockref.c @@ -58,23 +58,22 @@ EXPORT_SYMBOL(lockref_get); * @lockref: pointer to lockref structure * Return: 1 if count updated successfully or 0 if count was zero */ -int lockref_get_not_zero(struct lockref *lockref) +bool lockref_get_not_zero(struct lockref *lockref) { - int retval; + bool retval = false; CMPXCHG_LOOP( new.count++; if (old.count <= 0) - return 0; + return false; , - return 1; + return true; ); spin_lock(&lockref->lock); - retval = 0; if (lockref->count > 0) { lockref->count++; - retval = 1; + retval = true; } spin_unlock(&lockref->lock); return retval; @@ -106,22 +105,22 @@ EXPORT_SYMBOL(lockref_put_return); * @lockref: pointer to lockref structure * Return: 1 if count updated successfully or 0 if count <= 1 and lock taken */ -int lockref_put_or_lock(struct lockref *lockref) +bool lockref_put_or_lock(struct lockref *lockref) { CMPXCHG_LOOP( new.count--; if (old.count <= 1) break; , - return 1; + return true; ); spin_lock(&lockref->lock); if (lockref->count <= 1) - return 0; + return false; lockref->count--; spin_unlock(&lockref->lock); - return 1; + return true; } EXPORT_SYMBOL(lockref_put_or_lock); @@ -141,23 +140,22 @@ EXPORT_SYMBOL(lockref_mark_dead); * @lockref: pointer to lockref structure * Return: 1 if count updated successfully or 0 if lockref was dead */ -int lockref_get_not_dead(struct lockref *lockref) +bool lockref_get_not_dead(struct lockref *lockref) { - int retval; + bool retval = false; CMPXCHG_LOOP( new.count++; if (old.count < 0) - return 0; + return false; , - return 1; + return true; ); spin_lock(&lockref->lock); - retval = 0; if (lockref->count >= 0) { lockref->count++; - retval = 1; + retval = true; } spin_unlock(&lockref->lock); return retval; From patchwork Wed Jan 15 09:46:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13940172 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17704240236; Wed, 15 Jan 2025 09:47:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934438; cv=none; b=gv/D7Xvc8DJV1iNw7iK9yZnSHF9ohU+Vl5jKqcKz2Opa+q2gqRBsdcD4PM4+KDJOzKGryGUNtxkdSSTInRV9Ng/a7wy6c29961Dxj2fzrAZ73V/heKbLnglUk9R7Rid6CRuign+PGX19V2brWeM8mU9o4w5QSi6DKM8bB3VgUo8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934438; c=relaxed/simple; bh=IAXBC4NsvtqDtM3nwM97Eq8GWUMsR+akBkMhgU3Bef0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZYAXjMjatxGqApt6RMDz/+2Ogu8/ai6QVlCnN+QUhchMEp3+mMYdb1f2XSOQGxbTnBVRTMrrgVAo8k635fs/UNWt2q8yZX5XCJ+abO7xpA/p18ekIFLA/CaYkBlNMfQo3j7deaYROZXqRCZuPKkDRa+lZCOosHpJIvJG5JDGagc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=4iDLRR/G; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="4iDLRR/G" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=ohLiAdYSUOhMrwWdrrwT+bNxgt2i6mB7od5qyPwAJhc=; b=4iDLRR/GW8kspoqoiyDTuPao8Y WIozGp4pjDbQ2H8yjOVwxYmknSOFPaJ6ob/dBmRjS+k4aJQN1oK2txhY6VdW6M/RMF3WaxJQKbBii QQYfCRR6Wb+w1z48a6o+zs8H7qyzlKg5uo/Zy0Z0FRzKH5ZcMHnRDfGL0qQbGLA9MMdc9q68b6jlP vrcMY1G+9FtoFApiVT/H0yS0jqe4FeLLN4u7HANOflLA/4WWISoK18iZltCo4B0f9Jb2YpxSiTzyA zn9IAV1dhLtlogt3nrNBCpTqzClssInH/vQWcUccM3Ph9cv0JnPWx1G0bwYIAkwmp3rVMjBqonbz9 6OdXLL3g==; Received: from 2a02-8389-2341-5b80-7ef2-fcbf-2bb2-bbdf.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:7ef2:fcbf:2bb2:bbdf] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tXzzX-0000000BOfO-3ZBc; Wed, 15 Jan 2025 09:47:16 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Al Viro , Christian Brauner , Gao Xiang , Chao Yu , Andreas Gruenbacher , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-erofs@lists.ozlabs.org, gfs2@lists.linux.dev Subject: [PATCH 4/8] lockref: drop superfluous externs Date: Wed, 15 Jan 2025 10:46:40 +0100 Message-ID: <20250115094702.504610-5-hch@lst.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250115094702.504610-1-hch@lst.de> References: <20250115094702.504610-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Drop the superfluous externs from the remaining prototypes in lockref.h. Signed-off-by: Christoph Hellwig --- include/linux/lockref.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/lockref.h b/include/linux/lockref.h index 3d770e1bdbad..f821f46e9fb4 100644 --- a/include/linux/lockref.h +++ b/include/linux/lockref.h @@ -34,12 +34,12 @@ struct lockref { }; }; -extern void lockref_get(struct lockref *); -extern int lockref_put_return(struct lockref *); +void lockref_get(struct lockref *lockref); +int lockref_put_return(struct lockref *lockref); bool lockref_get_not_zero(struct lockref *lockref); bool lockref_put_or_lock(struct lockref *lockref); -extern void lockref_mark_dead(struct lockref *); +void lockref_mark_dead(struct lockref *lockref); bool lockref_get_not_dead(struct lockref *lockref); /* Must be called under spinlock for reliable results */ From patchwork Wed Jan 15 09:46:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13940173 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CFFB62416A6; Wed, 15 Jan 2025 09:47:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934442; cv=none; b=KFiihRYdI2nM4X7RJmgTzvYAuIPYXogX38FhtPT6kvMujhfuxgF5k8HLaoRRgETbmHXHPth1NrAixUikaiMYvMqvjRGBV70qTCuuAsDtD0D7rNHyhHn7Qtrq8Z9k6wgppC64GSti6+0YxsCXb8i89WgP717CQH/A5XIqJnfMkAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934442; c=relaxed/simple; bh=HyjG5UK1y+Ssb9PWULtP3S6Vhrk48RBP4LyTbTPipzs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TFOWwwmGZ74p5P44TtEP/4ZEcj5GTQ7JWka4F/H5X6AC7RkSuXn/YUXeJjDJiB/M/ivtLhUdQBkXIHLR8lVHBpwi92GPYXKveM/fgTNQeYLtdHG4WSqT47kAvl9PBOXGxFfIs/Jh2StFQTqGarOUm2kCpkOd1emCRux6gUjMpSU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=bR2RAmVo; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="bR2RAmVo" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=JfHT3r6a2waLQ1axcUyumnw0jeW+jo8FKvycKmaGzeY=; b=bR2RAmVoqBnTJJ2YjwFXzYJR3U wNZZV35kNGFHfNZacudPz7xszFWix1gdKTjZTPxLSeK97IE17UGtRGRAbDyvop3kJN1fEiKG72+Lu +l1bvKMfgmmQrz/ePRwV8qALTqndGRaXYkZaHSx3pw0iIS/ndhjU+BcpJbzbGylHRTMCW5h++FlyM GiAmCzdjcI7EbJiPk1juaqXkUHqh9nlnl1aM/xl1RmCrxxyayMfp5IlIpODjH2ZM8cRsdBda/LF6x +kCJ8v3jSLdDzzeAwwnFSYNuElC7/JQ91uitQkor/sC0XC+gtjoHpcSrnKFmFyxxfSJwwZ91tJ3Uo HzPkhZvA==; Received: from 2a02-8389-2341-5b80-7ef2-fcbf-2bb2-bbdf.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:7ef2:fcbf:2bb2:bbdf] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tXzza-0000000BOgI-1TUG; Wed, 15 Jan 2025 09:47:18 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Al Viro , Christian Brauner , Gao Xiang , Chao Yu , Andreas Gruenbacher , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-erofs@lists.ozlabs.org, gfs2@lists.linux.dev Subject: [PATCH 5/8] lockref: add a lockref_init helper Date: Wed, 15 Jan 2025 10:46:41 +0100 Message-ID: <20250115094702.504610-6-hch@lst.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250115094702.504610-1-hch@lst.de> References: <20250115094702.504610-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Add a helper to initialize the lockdep, that is initialize the spinlock and set a value. Having to open code them isn't a big deal, but having an initializer feels right for a proper primitive. Signed-off-by: Christoph Hellwig --- include/linux/lockref.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/lockref.h b/include/linux/lockref.h index f821f46e9fb4..c39f119659ba 100644 --- a/include/linux/lockref.h +++ b/include/linux/lockref.h @@ -34,6 +34,17 @@ struct lockref { }; }; +/** + * lockref_init - Initialize a lockref + * @lockref: pointer to lockref structure + * @count: initial count + */ +static inline void lockref_init(struct lockref *lockref, unsigned int count) +{ + spin_lock_init(&lockref->lock); + lockref->count = count; +} + void lockref_get(struct lockref *lockref); int lockref_put_return(struct lockref *lockref); bool lockref_get_not_zero(struct lockref *lockref); From patchwork Wed Jan 15 09:46:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13940174 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66EC82416AD; Wed, 15 Jan 2025 09:47:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934444; cv=none; b=AFlORFpWqAsISXaYxb5UYWm8/bDDCbKCBp/7XcbkD3ESfzFm2Sq0FBOFZSCypixavM24WZQtTmgeoAbhOAwj6+wP5GuEOfTpy5URh/vMQOQc/gctuBb/8FKXblMWWK2HvYNpGIrsLoE5um2modhAvrgQik/YglsIK3ZN4L+y6ho= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934444; c=relaxed/simple; bh=qR093yDhuLESpr8M4pLPhZWyQX6Hk9TUAiBtJ1tsrdc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RYE2y8mZKWGLmZJNf12MBxSXDhLg4hHSeEKsDL+q+hru9W1kXH2iCu//4o2oJBlpEC5qFTwDQTTMqFg6rjcsXTrUHN6rHpnEzAzd4Ks6icrSn9nQWx6MhMVQ4ExT3SJajZxItKuL02qoeKXPuXLziW5fvdNgQnrJX6eCMvvDMoo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=TEcVQuCB; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="TEcVQuCB" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=ExehWvHtv/dE+gm9ctBRtigxAXDYJyzO6NdGxVTaePM=; b=TEcVQuCBrtuxpbbGwt6sZya1tu euTd+T6inBKAGmmi2u3vsBYnZAMN42UtOxfDQbtcaQY+y4YlogzvG+ik5Z3fK6g6hWY49bOafbOGk vYdwQHhIbCq2HxTzWHQGstbvvu89Yi2f69H3/1xE/Fn9b+KU1Y6SQaOx2LceSGdunyhOdkRsM3AzS G7csU4LgFummki3Fw0E7K67xdCtq2vdgxq/ySgQI3gw6PknJIX9ZvLOdLEOHL6gwIQQaVX4S8hhHH b36fAJWyXzTQg04kE6Ul4Kyp3COkQxOz8WXCC+hGiLF920+djQ7z6tvkROeYhQcp5aEeqce5gIpzN bTUGT7TA==; Received: from 2a02-8389-2341-5b80-7ef2-fcbf-2bb2-bbdf.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:7ef2:fcbf:2bb2:bbdf] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tXzzc-0000000BOhl-3P8y; Wed, 15 Jan 2025 09:47:21 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Al Viro , Christian Brauner , Gao Xiang , Chao Yu , Andreas Gruenbacher , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-erofs@lists.ozlabs.org, gfs2@lists.linux.dev Subject: [PATCH 6/8] dcache: use lockref_init for d_lockref Date: Wed, 15 Jan 2025 10:46:42 +0100 Message-ID: <20250115094702.504610-7-hch@lst.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250115094702.504610-1-hch@lst.de> References: <20250115094702.504610-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Signed-off-by: Christoph Hellwig --- fs/dcache.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index b4d5e9e1e43d..1a01d7a6a7a9 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1681,9 +1681,8 @@ static struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name) /* Make sure we always see the terminating NUL character */ smp_store_release(&dentry->d_name.name, dname); /* ^^^ */ - dentry->d_lockref.count = 1; dentry->d_flags = 0; - spin_lock_init(&dentry->d_lock); + lockref_init(&dentry->d_lockref, 1); seqcount_spinlock_init(&dentry->d_seq, &dentry->d_lock); dentry->d_inode = NULL; dentry->d_parent = dentry; From patchwork Wed Jan 15 09:46:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13940175 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 921272419EA; Wed, 15 Jan 2025 09:47:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934445; cv=none; b=Sa/zBpeIq4+mjLEPDdnh/5CcEIjASp04SVMJRxA/ao7Cp5vQLiVHV8KBs1OWJCOkPep/7ttSsMIeIySI/i/c3Pb+WF56qGVvTcQVgQKB05eTWSykYukJrkdx7cgpRx/iB4kQdhTUVsnODCtQrUJ9V9TMWXQhZSkIeoLYMRhQLSI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934445; c=relaxed/simple; bh=KiyXs8tJMrR7Nul27PjQn4qNHqrjKqhAR+bmlc26GME=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VKsvqDupoMItKYVpSYV6m5W2MdC9M3SxHInAi0P0O+5jkX6ZBx5kLG8vTXHCPKOx5ZX7swjMFgzn4THIcldveDXHAMEW19dlTUFStY1TaTgYqX+OZGka1hqe3M3LcObKB3BTXCn0zPKsL9S5hEuI+h7mPs7kLTmHX/OhqX4Ic/4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=2i2h1J9W; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="2i2h1J9W" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=easVSrQ5eMjG5N5DCivClgnlxU07C0jtlUyU9+xSgOg=; b=2i2h1J9Wdt8M088Q+u5JEaevWW cig673kf18t+fTojaEjdQziAxcx+drGWauAClKDHT/UuGsaAC5jUPljm6lj3FiI/ZT2R+fnfrFosl T/5m9TTME/hTxgWyO2chfKfuxJJk9ibiNysBmGHOlUY9yFzH+A9P3g0yHcWmORuBvaVpV2gXZGa/H 8qHYA9jBGMk5O7uN7N2ZELltAQ+wZQeN01nT+lGegyy9gNmRjAC3Sd3BsGsIBpfeg5mvQVojnpVRs jZ5PmkdpTl2fBcXol1sj7Hb2I5UxZph9NH5rpTLu/MJjIf4WjiDW09ksJ1wFvJXTJMv0O7ArCMqEq Hbdh76Ag==; Received: from 2a02-8389-2341-5b80-7ef2-fcbf-2bb2-bbdf.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:7ef2:fcbf:2bb2:bbdf] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tXzzf-0000000BOiV-15i5; Wed, 15 Jan 2025 09:47:23 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Al Viro , Christian Brauner , Gao Xiang , Chao Yu , Andreas Gruenbacher , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-erofs@lists.ozlabs.org, gfs2@lists.linux.dev Subject: [PATCH 7/8] erofs: use lockref_init for pcl->lockref Date: Wed, 15 Jan 2025 10:46:43 +0100 Message-ID: <20250115094702.504610-8-hch@lst.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250115094702.504610-1-hch@lst.de> References: <20250115094702.504610-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Signed-off-by: Christoph Hellwig Reviewed-by: Gao Xiang --- fs/erofs/zdata.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 19ef4ff2a134..254f6ad2c336 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -747,8 +747,7 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe) if (IS_ERR(pcl)) return PTR_ERR(pcl); - spin_lock_init(&pcl->lockref.lock); - pcl->lockref.count = 1; /* one ref for this request */ + lockref_init(&pcl->lockref, 1); /* one ref for this request */ pcl->algorithmformat = map->m_algorithmformat; pcl->length = 0; pcl->partial = true; From patchwork Wed Jan 15 09:46:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13940176 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FA9E241A16; Wed, 15 Jan 2025 09:47:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934448; cv=none; b=fVF3E30UVACxc4SPa/2Xiu2ZvBIki9/iBRa2fUuUA0qdMldZygS8JALd+n27l0XU0jGEgbD4sXeRv6HhDKdnS7iWVPB+pvgARl+c6z1mjwUfaD/339QnKj1xxhKIH7ZtgiNAWxMSYOiQVlEhSaNLGahAHVWtMg+CzNlSQGV1NsM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736934448; c=relaxed/simple; bh=KpwZLymFawxvtkG9c0dF+EwKcjQ6kkYvXIu+z8ws6F4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MGKh12v79bf9p3frFVMVTwVGG8JgdHypyCXvZHqoXXztTeA12eoyYsJm/+2C77wuaTe4/aKJaX3RvSOkluGUiqCMNoy1NjCozf71AFva4gr2cMLwpdSmDgnHV1l4hiVivE/6BOJssXHGRaJ55Xh/HWpNVP9uPUKefrtf4vei2wQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=4i06VkcB; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="4i06VkcB" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=ZxUBne0G/XLQFQ1URg54UYUl7/jIy/7Nitz9EvG+UdI=; b=4i06VkcBgTv80wC9jlhm43uqnO SaUx2axJyzLuuZJGQBiyDXV1vofYcQjlFJnj7cYgeDFqyQaOtE5mVpKa6/qZTddTupg0T1sA/B3YG JviSj4bfuy/TLsuAjQqWzp7SOi3Zk4BHMjOg8n67V+ZXWNY9DPskD2bD/phwb8U2LD7s3AXPmluve tHoCxb6OG6SMmfrLMJ7fFdxATHVOA3ESfbSqTewWczUs5t/bY2lGj73c90AY3V4PbkLYmMBe84NnL ycArGN4LQ16VZXaTzElrFip+NrifMaEI3704kr0Q6o1QnSRxRZcUq416AhTrt5OZ+TqCSxQcIlKmm 5CxTkYLw==; Received: from 2a02-8389-2341-5b80-7ef2-fcbf-2bb2-bbdf.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:7ef2:fcbf:2bb2:bbdf] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tXzzh-0000000BOjb-31T0; Wed, 15 Jan 2025 09:47:26 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Al Viro , Christian Brauner , Gao Xiang , Chao Yu , Andreas Gruenbacher , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-erofs@lists.ozlabs.org, gfs2@lists.linux.dev Subject: [PATCH 8/8] gfs2: use lockref_init for qd_lockref Date: Wed, 15 Jan 2025 10:46:44 +0100 Message-ID: <20250115094702.504610-9-hch@lst.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250115094702.504610-1-hch@lst.de> References: <20250115094702.504610-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Signed-off-by: Christoph Hellwig --- fs/gfs2/quota.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 72b48f6f5561..58bc5013ca49 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -236,8 +236,7 @@ static struct gfs2_quota_data *qd_alloc(unsigned hash, struct gfs2_sbd *sdp, str return NULL; qd->qd_sbd = sdp; - qd->qd_lockref.count = 0; - spin_lock_init(&qd->qd_lockref.lock); + lockref_init(&qd->qd_lockref, 0); qd->qd_id = qid; qd->qd_slot = -1; INIT_LIST_HEAD(&qd->qd_lru);