From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.fh-wedel.de ([213.39.232.198] helo=moskovskaya.fh-wedel.de) by canuck.infradead.org with esmtps (Exim 4.43 #1 (Red Hat Linux)) id 1CrHoy-0001xZ-A8 for linux-mtd@lists.infradead.org; Wed, 19 Jan 2005 10:32:37 -0500 Date: Wed, 19 Jan 2005 16:32:33 +0100 From: =?iso-8859-1?Q?J=F6rn?= Engel To: "Artem B. Bityuckiy" Message-ID: <20050119153233.GD26711@wohnheim.fh-wedel.de> References: <20050119152427.GB26711@wohnheim.fh-wedel.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Cc: MTD List , Joakim Tjernlund Subject: Re: JFFS3 & performance List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 19 January 2005 15:27:53 +0000, Artem B. Bityuckiy wrote: > > > > Something like this? > > > > int jffs3_write_with_checksum(void *data, ...) > > { > > ... > > if (mtd->write_with_checksum) > > return mtd->write_with_checksum(data, ...); > > mtd->write(data, ...); > > mtd->write(checksum(data), ...); > > } > > > > Jörn > Can't get it - What is the goal? Some advandages? As you explained, Joakim's proposal doesn't always make sense. Basically, if the underlying drives uses DMA, there is no point. If it does memcpy(), then it's faster to checksum/copy in a single loop, rather than do both things individually. With the above code, an mtd driver can supply a converged checksum/copy method, but doesn't have to. If it doesn't, we do regular copy (through mtd->write) and checksum instead. Jörn -- The wise man seeks everything in himself; the ignorant man tries to get everything from somebody else. -- unknown