Subject: struct buf's b_flags B_XXX
To: None <tech-kern@NetBSD.org>
From: Reinoud Zandijk <reinoud@netbsd.org>
List: tech-kern
Date: 02/15/2007 17:06:55
--tjCHc7DPkfUGtrlw
Content-Type: multipart/mixed; boundary="YiEDa0DAkWCtVeE4"
Content-Disposition: inline


--YiEDa0DAkWCtVeE4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Dear folks,

i'd like to change the confusing B_XXX flag to be called B_DEVUSE since 
only tape and floppy devices use this flag to mark buffers that are not 
mormal data buffers.

If noone objects i'll commit it later. See attached complete patch.

With regards,
Reinoud

--YiEDa0DAkWCtVeE4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=B_XXX-diffs

Index: sys/buf.h
===================================================================
RCS file: /cvsroot/src/sys/sys/buf.h,v
retrieving revision 1.90
diff -u -p -r1.90 buf.h
--- sys/buf.h	14 Nov 2006 15:50:00 -0000	1.90
+++ sys/buf.h	15 Feb 2007 16:05:21 -0000
@@ -211,7 +211,7 @@ do {									\
 #define	B_TAPE		0x00200000	/* Magnetic tape I/O. */
 #define	B_WANTED	0x00800000	/* Process wants this buffer. */
 #define	B_WRITE		0x00000000	/* Write buffer (pseudo flag). */
-#define	B_XXX		0x02000000	/* Debugging flag. */
+#define	B_DEVUSE	0x02000000	/* Device use flag. */
 #define	B_VFLUSH	0x04000000	/* Buffer is being synced. */
 
 #define BUF_FLAGBITS \
Index: dev/gpib/mt.c
===================================================================
RCS file: /cvsroot/src/sys/dev/gpib/mt.c,v
retrieving revision 1.7
diff -u -p -r1.7 mt.c
--- dev/gpib/mt.c	13 Jan 2007 18:46:37 -0000	1.7
+++ dev/gpib/mt.c	15 Feb 2007 16:05:21 -0000
@@ -178,7 +178,7 @@ struct	mt_softc {
 
 #define	MTUNIT(x)	(minor(x) & 0x03)
 
-#define B_CMD		B_XXX		/* command buf instead of data */
+#define B_CMD		B_DEVUSE	/* command buf instead of data */
 #define	b_cmd		b_blkno		/* blkno holds cmd when B_CMD */
 
 int	mtmatch(struct device *, struct cfdata *, void *);
Index: dev/isa/fd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/fd.c,v
retrieving revision 1.70
diff -u -p -r1.70 fd.c
--- dev/isa/fd.c	16 Nov 2006 01:33:00 -0000	1.70
+++ dev/isa/fd.c	15 Feb 2007 16:05:21 -0000
@@ -169,8 +169,8 @@ __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.70 
 #define FDUNIT(dev)	(minor(dev) / 8)
 #define FDTYPE(dev)	(minor(dev) % 8)
 
-/* XXX misuse a flag to identify format operation */
-#define B_FORMAT B_XXX
+/* (mis)use device use flag to identify format operation */
+#define B_FORMAT B_DEVUSE
 
 /* controller driver configuration */
 int fdprint(void *, const char *);
Index: arch/acorn32/mainbus/fd.c
===================================================================
RCS file: /cvsroot/src/sys/arch/acorn32/mainbus/fd.c,v
retrieving revision 1.26
diff -u -p -r1.26 fd.c
--- arch/acorn32/mainbus/fd.c	14 Apr 2006 13:09:05 -0000	1.26
+++ arch/acorn32/mainbus/fd.c	15 Feb 2007 16:05:21 -0000
@@ -135,8 +135,8 @@ __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.26 
 #define FDUNIT(dev)	(minor(dev) / 8)
 #define FDTYPE(dev)	(minor(dev) % 8)
 
-/* XXX misuse a flag to identify format operation */
-#define B_FORMAT B_XXX
+/* (mis)use device use flag to identify format operation */
+#define B_FORMAT B_DEVUSE
 
 enum fdc_state {
 	DEVIDLE = 0,
Index: arch/atari/dev/hdfd.c
===================================================================
RCS file: /cvsroot/src/sys/arch/atari/dev/hdfd.c,v
retrieving revision 1.51
diff -u -p -r1.51 hdfd.c
--- arch/atari/dev/hdfd.c	24 Jan 2007 13:08:13 -0000	1.51
+++ arch/atari/dev/hdfd.c	15 Feb 2007 16:05:22 -0000
@@ -163,8 +163,8 @@ static void	*intr_arg = NULL; /* XXX: ar
 #define FDUNIT(dev)	(minor(dev) / 8)
 #define FDTYPE(dev)	(minor(dev) % 8)
 
-/* XXX misuse a flag to identify format operation */
-#define B_FORMAT B_XXX
+/* (mis)use device use flag to identify format operation */
+#define B_FORMAT B_DEVUSE
 
 enum fdc_state {
 	DEVIDLE = 0,
Index: arch/hp300/dev/mt.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hp300/dev/mt.c,v
retrieving revision 1.35
diff -u -p -r1.35 mt.c
--- arch/hp300/dev/mt.c	21 Jul 2006 10:01:39 -0000	1.35
+++ arch/hp300/dev/mt.c	15 Feb 2007 16:05:22 -0000
@@ -133,7 +133,7 @@ int	mtdebug = 0;
 
 #define	UNIT(x)		(minor(x) & 3)
 
-#define B_CMD		B_XXX		/* command buf instead of data */
+#define B_CMD		B_DEVUSE	/* command buf instead of data */
 #define	b_cmd		b_blkno		/* blkno holds cmd when B_CMD */
 
 static int	mtmatch(struct device *, struct cfdata *, void *);
Index: arch/sparc/dev/fd.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/dev/fd.c,v
retrieving revision 1.126
diff -u -p -r1.126 fd.c
--- arch/sparc/dev/fd.c	14 Apr 2006 13:09:05 -0000	1.126
+++ arch/sparc/dev/fd.c	15 Feb 2007 16:05:22 -0000
@@ -147,8 +147,8 @@ __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.126
 #define FDUNIT(dev)	(minor(dev) / 8)
 #define FDTYPE(dev)	(minor(dev) % 8)
 
-/* XXX misuse a flag to identify format operation */
-#define B_FORMAT B_XXX
+/* (mis)use device use flag to identify format operation */
+#define B_FORMAT B_DEVUSE
 
 #define FD_DEBUG
 #ifdef FD_DEBUG
Index: arch/sparc64/dev/fdc.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/dev/fdc.c,v
retrieving revision 1.1
diff -u -p -r1.1 fdc.c
--- arch/sparc64/dev/fdc.c	6 Oct 2006 08:44:59 -0000	1.1
+++ arch/sparc64/dev/fdc.c	15 Feb 2007 16:05:22 -0000
@@ -161,8 +161,8 @@ __KERNEL_RCSID(0, "$NetBSD: fdc.c,v 1.1 
 #define FTC_FLIP
 #endif
 
-/* XXX misuse a flag to identify format operation */
-#define B_FORMAT B_XXX
+/* (mis)use device use flag to identify format operation */
+#define B_FORMAT B_DEVUSE
 
 #define FD_DEBUG
 #ifdef FD_DEBUG
Index: arch/sun3/dev/fd.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sun3/dev/fd.c,v
retrieving revision 1.52
diff -u -p -r1.52 fd.c
--- arch/sun3/dev/fd.c	14 Oct 2006 08:11:16 -0000	1.52
+++ arch/sun3/dev/fd.c	15 Feb 2007 16:05:22 -0000
@@ -122,8 +122,8 @@ __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.52 
 #define FDUNIT(dev)	(minor(dev) / 8)
 #define FDTYPE(dev)	(minor(dev) % 8)
 
-/* XXX misuse a flag to identify format operation */
-#define B_FORMAT B_XXX
+/* (mis)use device use flag to identify format operation */
+#define B_FORMAT B_DEVUSE
 
 #ifdef FD_DEBUG
 int	fdc_debug = 0;

--YiEDa0DAkWCtVeE4--

--tjCHc7DPkfUGtrlw
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (NetBSD)

iQEVAwUBRdSFF4KcNwBDyKpoAQJTFAf/bwJz4rHHSxAjClNF8t3yhlEUtZ5HJZ4V
qPoHttnlBxQl4ecRBiEFqxn/A59c8L01U27LLXy5T0dVic2awCszwFJiPEsYm3mf
+cdgoxpq8twZ1e2Pqi/nWQ0eLZWT4X7Sq4i4FAy7v00Xg3+FZ8RK9ellzDrF3ITM
ub7DzWF1qcJJyDD4W6JqZmsrr7+rWq/LN06FRfgeQ1vXM0AfGAmuc3BGb5abk0UI
YWqrNkEazILfR9uVUmLTzL6SNQqTyMz/s4+0FFcMc7NXfiKdMJOpuij2VhRMiFAi
nPRw06VUGRUL8444bm31CKoQ8jdztn4GHeyBewxKxs8ExG948oGDcw==
=vbGn
-----END PGP SIGNATURE-----

--tjCHc7DPkfUGtrlw--