From nobody Sat Feb 7 21:35:19 2026 Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) (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 47C8519CC3A for ; Mon, 23 Sep 2024 14:47:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727102877; cv=none; b=LaFbC5CR9mSaiNNtcdP6TyyFpBtUrm0cGZ7XwSyIoBmnFtR8NfKnoOKKe44jMOgm3Rh9HEg49OEAS2Q2jdjsN/rZTRJZcUlaXIew3qXKGFIwmBFHAQlUh2/CRu/fr3WltHPVkZhEojevtYPS3JoQaJ5BDXoscc+zlB/Nfw/Qy+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727102877; c=relaxed/simple; bh=Bk0fNQRsh28mlTF+N79aeZ/0DJFr8w85c0CjH9t0gtI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=P+vHQ8ZAiED/XGvHUhEgInOm+dyDgy2b3A2iJDlE3JgmVr1H3Zr6J2kfZdzqgKc9NG3DK2Gxw5TpgWaXdXQ578lerndlYBamsOeMA1B/rU9I9glwE/TysVDnNudCWURa9+TfQz8hSupOM2rmVa9lZO0e1swNpElIg0uNfgERkGU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=KXlsyNKS; arc=none smtp.client-ip=95.215.58.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="KXlsyNKS" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1727102871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=wxyecHP0DQb9yEgGdekn4EqQ2Tgs0JnWo2dsEC0la5w=; b=KXlsyNKSZZE8+Cm9rTlGTCi5mj1z84IPRzzqcxCmh2+/xQALL0hzKtFflItnWmhiAVPzMJ ASjufaJkbsoYQgv4Gw2VHhQB5+5BQGI4GIHZbLS5F2U0MTp3h0SYq4FVHQWVIjhE5nioKL i/8dvVUQ/k5hYpi9Pg4hgejh+G9ILfk= From: Thorsten Blum To: Kent Overstreet Cc: Thorsten Blum , linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] bcachefs: Use FOREACH_ACL_ENTRY() macro to iterate over acl entries Date: Mon, 23 Sep 2024 16:44:53 +0200 Message-ID: <20240923144452.233096-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Use the existing FOREACH_ACL_ENTRY() macro to iterate over POSIX acl entries and remove the custom acl_for_each_entry() macro. Signed-off-by: Thorsten Blum --- fs/bcachefs/acl.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/fs/bcachefs/acl.c b/fs/bcachefs/acl.c index 1def61875a6f..56b160e71a53 100644 --- a/fs/bcachefs/acl.c +++ b/fs/bcachefs/acl.c @@ -184,11 +184,6 @@ static struct posix_acl *bch2_acl_from_disk(struct btr= ee_trans *trans, return ERR_PTR(-EINVAL); } =20 -#define acl_for_each_entry(acl, acl_e) \ - for (acl_e =3D acl->a_entries; \ - acl_e < acl->a_entries + acl->a_count; \ - acl_e++) - /* * Convert from in-memory to filesystem representation. */ @@ -199,11 +194,11 @@ bch2_acl_to_xattr(struct btree_trans *trans, { struct bkey_i_xattr *xattr; bch_acl_header *acl_header; - const struct posix_acl_entry *acl_e; + const struct posix_acl_entry *acl_e, *pe; void *outptr; unsigned nr_short =3D 0, nr_long =3D 0, acl_len, u64s; =20 - acl_for_each_entry(acl, acl_e) { + FOREACH_ACL_ENTRY(acl_e, acl, pe) { switch (acl_e->e_tag) { case ACL_USER: case ACL_GROUP: @@ -241,7 +236,7 @@ bch2_acl_to_xattr(struct btree_trans *trans, =20 outptr =3D (void *) acl_header + sizeof(*acl_header); =20 - acl_for_each_entry(acl, acl_e) { + FOREACH_ACL_ENTRY(acl_e, acl, pe) { bch_acl_entry *entry =3D outptr; =20 entry->e_tag =3D cpu_to_le16(acl_e->e_tag); --=20 2.46.1