From owner-freebsd-geom@FreeBSD.ORG Wed Jun 6 12:35:27 2007 Return-Path: X-Original-To: freebsd-geom@freebsd.org Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1CB5516A400 for ; Wed, 6 Jun 2007 12:35:27 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.freebsd.org (Postfix) with ESMTP id AEA9613C45D for ; Wed, 6 Jun 2007 12:35:26 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id CFD8A48809; Wed, 6 Jun 2007 14:35:24 +0200 (CEST) Received: from localhost (pjd.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 0084B48801; Wed, 6 Jun 2007 14:35:16 +0200 (CEST) Date: Wed, 6 Jun 2007 14:34:55 +0200 From: Pawel Jakub Dawidek To: Takanori Watanabe Message-ID: <20070606123455.GE1121@garage.freebsd.pl> References: <200706061155.l56BtHSY019405@sana.init-main.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AjmyJqqohANyBN/e" Content-Disposition: inline In-Reply-To: <200706061155.l56BtHSY019405@sana.init-main.com> X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 User-Agent: mutt-ng/devel-r804 (FreeBSD) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-geom@freebsd.org Subject: Re: Flash memory like geom class. X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2007 12:35:27 -0000 --AjmyJqqohANyBN/e Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 06, 2007 at 08:55:17PM +0900, Takanori Watanabe wrote: > Hi, I wrote flash memory like geom class backed > by kernel memory. >=20 > It emulates 4MB capacity, 512bytes block size and 16KB erase size flash m= emory. > The device is initialized with 0xff. > When you write a sector to the device, the content will be gets and opera= tion=20 > with current sector content and the data provided. >=20 > When BIO_DELETE operation is issued, the times is counted per region > and fill the erase region with 0xff. >=20 > http://www.init-main.com/geom_pflash.tar.gz > Current issues I have is as follows. >=20 > 1.How can I issue BIO_DELETE from userland? > I convice BIO_DELETE is used to perform erase operation to flash, > but I could not find a way to issue BIO_DELETE from userland. > Or BIO_DELETE is not suitable request for it? I recently exteneded libgeom to support g_delete() function, which does what you want. You may also use DIOCGDELETE directly (also added recently). > 2.How can I export statistic information? > I record the count of erase operation, but there is no way to > export the information for now, other than poking with=20 > debugger. How shall I do with it? I'd guess sysctl or if you want them to be per-provider you should geom geom_ctl. Check out g_nop.c and how it exports various statistics in g_nop_dumpconf() function. > 3.Do you think it something useful? > I think it can be used to develop flash file system. > How do think about this? I haven't looked at the code yet, not thought about this, just wanted to provide some info, so I can't comment on its usefulness yet. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --AjmyJqqohANyBN/e Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGZqnvForvXbEpPzQRAlUzAKCPgX51QzgB4JVFFonSvli6AChMFgCeLu9c meAzjxOXUWhRxw/2zvB5HxI= =iZsS -----END PGP SIGNATURE----- --AjmyJqqohANyBN/e--