From: Hugo Mills Subject: Re: [PATCH 4/5][REPOST][BTRFS-PROGS] Avoid to scan cdrom and floppy Date: Sun, 12 Jun 2011 22:52:45 +0100 Message-ID: <20110612215245.GD832@carfax.org.uk> References: <201012051847.15633.kreijack@libero.it> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hoZxPH4CaxYzWscb" Cc: linux-btrfs@vger.kernel.org To: Goffredo Baroncelli Return-path: In-Reply-To: <201012051847.15633.kreijack@libero.it> List-ID: --hoZxPH4CaxYzWscb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Goffredo -=20 As with the other patch, this is missing S-o-B, and has some damage =66rom line wrapping. If you fix and re-send, I'll pull into my integration branch. Hugo. On Sun, Dec 05, 2010 at 06:47:15PM +0100, Goffredo Baroncelli wrote: > Hi all, >=20 > the commands "btrfs filesystem show" and "btrfs device scan" look at the = /dev > directory (and it subdirectories) for every block devices. > This is a slow process because floppy and cdrom are also checked. Moreove= r, > as highlighted by Helmut, if udev is not used, the /dev directory is popu= lated > by high number of non-existant devices, which slow the process. >=20 > My patch changes the behaviour of these commands. The list of the devices= are > extracted from /proc/partitions, and on the basis of the file=20 > /etc/btrfs.devices some devices may be skipped. >=20 > The file /etc/btrfs.devices contains a list of devices which have to be s= kipped=20 > (if the line starts with '!') or to be evaluated. Shell wildcard may be u= sed. >=20 > If the file doesn't exists the default is to skip cdroms (/dev/cdrom*) an= d=20 > floppies (/dev/fd*). >=20 > To revert to the old behaviour use the switch '--all-devices'. >=20 > Below the patch, but it is possible to pull the changes from: >=20 > http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git >=20 > branch >=20 > device-checklist >=20 > Comment are welcome. >=20 > Regards > G.Baroncelli >=20 >=20 > btrfs.c | 10 +- > btrfs.devices | 24 ++++++ > btrfs_cmds.c | 39 +++++++++-- > man/btrfs.8.in | 22 ++++-- > utils.c | 196 ++++++++++++++++++++++++++++++++++++++++++++++++++= +- > utils.h | 5 + > 6 files changed, 279 insertions(+), 17 deletions(-) >=20 >=20 >=20 > diff --git a/btrfs.c b/btrfs.c > index 46314cf..d850e60 100644 > --- a/btrfs.c > +++ b/btrfs.c > @@ -83,9 +83,10 @@ static struct Command commands[] =3D { > "will occupe all available space on the device." > }, > { do_show_filesystem, 999, > - "filesystem show", "[|