From: maximilian attems Subject: [patch] use list_for_each() in fs/dquot.c Date: Wed, 10 Sep 2003 16:32:45 +0200 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030910143245.GC24711@mail.sternwelten.at> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="raC6veAxrt5nqIoY" Cc: linux-fsdevel@vger.kernel.org, matthew@wil.cx Return-path: Received: from M981P012.adsl.highway.telekom.at ([62.47.154.140]:36225 "EHLO stallburg.dyndns.org") by vger.kernel.org with ESMTP id S264801AbTIJOcy (ORCPT ); Wed, 10 Sep 2003 10:32:54 -0400 To: kj Content-Disposition: inline List-Id: linux-fsdevel.vger.kernel.org --raC6veAxrt5nqIoY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Use list_for_each() where applicable From: Domen Puncer - for (list =3D ymf_devs.next; list !=3D &ymf_devs; list =3D list->next) { + list_for_each(list, &ymf_devs) { pure cosmetic change, defined as a preprocessor macro in: include/linux/list.h please apply maks --- linux-2.6.0-test5/fs/dquot.c Mon Sep 8 21:50:16 2003 +++ linux/fs/dquot.c Wed Sep 10 12:13:24 2003 @@ -215,7 +215,7 @@ struct list_head *head; struct dquot *dquot; =20 - for (head =3D dquot_hash[hashent].next; head !=3D dquot_hash+hashent; hea= d =3D head->next) { + list_for_each(head, &dquot_hash[hashent]) { dquot =3D list_entry(head, struct dquot, dq_hash); if (dquot->dq_sb =3D=3D sb && dquot->dq_id =3D=3D id && dquot->dq_type = =3D=3D type) return dquot; @@ -289,12 +289,11 @@ static void invalidate_dquots(struct super_block *sb, int type) { struct dquot *dquot; - struct list_head *head; + struct list_head *head, *next; =20 spin_lock(&dq_list_lock); - for (head =3D inuse_list.next; head !=3D &inuse_list;) { + list_for_each_safe(head, next, &inuse_list) { dquot =3D list_entry(head, struct dquot, dq_inuse); - head =3D head->next; if (dquot->dq_sb !=3D sb) continue; if (dquot->dq_type !=3D type) --raC6veAxrt5nqIoY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE/XzYN6//kSTNjoX0RAlvFAJ4qAlDY5XJvmWY3EFU3Yk4ttnzdwACfccnN HB2AInmuxLIXPibglDShwVk= =LRTC -----END PGP SIGNATURE----- --raC6veAxrt5nqIoY--