Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932083AbXBSLFp (ORCPT ); Mon, 19 Feb 2007 06:05:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932082AbXBSLFp (ORCPT ); Mon, 19 Feb 2007 06:05:45 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:53959 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932083AbXBSLFo (ORCPT ); Mon, 19 Feb 2007 06:05:44 -0500 Date: Mon, 19 Feb 2007 11:05:43 +0000 From: Christoph Hellwig To: Artem Bityutskiy Cc: Linux Kernel Mailing List , Christoph Hellwig , Frank Haverkamp , Thomas Gleixner , David Woodhouse , Josh Boyer Subject: Re: [PATCH 16/44 take 2] [UBI] scanning unit implementation Message-ID: <20070219110543.GE16930@infradead.org> Mail-Followup-To: Christoph Hellwig , Artem Bityutskiy , Linux Kernel Mailing List , Frank Haverkamp , Thomas Gleixner , David Woodhouse , Josh Boyer References: <20070217165424.5845.4390.sendpatchset@localhost.localdomain> <20070217165545.5845.27214.sendpatchset@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070217165545.5845.27214.sendpatchset@localhost.localdomain> User-Agent: Mutt/1.4.2.2i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2184 Lines: 69 > + for (pnum = 0; pnum < io->peb_count; pnum++) { > + cond_resched(); > + > + err = process_eb(ubi, si, pnum); > + if (unlikely(err < 0)) > + goto out_vidh; > + } > + rb_for_each_entry(rb1, sv, &si->volumes, rb) { > + cond_resched(); > + rb_for_each_entry(rb2, seb, &sv->root, u.rb) > + if (seb->ec == NAND_SCAN_UNKNOWN_EC) > + seb->ec = si->mean_ec; > + } > + > + cond_resched(); > + list_for_each_entry(seb, &si->free, u.list) > + if (seb->ec == NAND_SCAN_UNKNOWN_EC) > + seb->ec = si->mean_ec; > + > + cond_resched(); > + list_for_each_entry(seb, &si->corr, u.list) > + if (seb->ec == NAND_SCAN_UNKNOWN_EC) > + seb->ec = si->mean_ec; > + > + cond_resched(); > + list_for_each_entry(seb, &si->erase, u.list) > + if (seb->ec == NAND_SCAN_UNKNOWN_EC) > + seb->ec = si->mean_ec; You really shouldn't need random cond_resched all over the place. > +static int vid_hdr_sanity_check(const struct ubi_info *ubi, > + const struct ubi_vid_hdr *vid_hdr, > + const struct ubi_scan_volume *sv, int pnum); > + > +static int add_to_erase(struct ubi_scan_info *si, int pnum, int ec); > + > +static struct ubi_scan_volume *add_volume(const struct ubi_info *ubi, > + struct ubi_scan_info *si, int vol_id, > + int pnum, > + const struct ubi_vid_hdr *vid_hdr); > + > +static int compare_lebs(const struct ubi_info *ubi, > + const struct ubi_scan_leb *seb, int pnum, > + const struct ubi_vid_hdr *vid_hdr); forward declarations in the middle of the file are really annoying. Please try to reorder the code to not need them at all if needed, and if needed add them to the top of the file. > +void ubi_scan_destroy_si(struct ubi_scan_info *si) > +{ > + struct ubi_scan_leb *seb, *seb_tmp; > + struct ubi_scan_volume *sv; > + struct rb_node *rb; > + > + list_for_each_entry_safe(seb, seb_tmp, &si->alien, u.list) { > + list_del(&seb->u.list); > + ubi_free_scan_leb(seb); > + } no locking needed here? - 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/