linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] make <linux/blk.h> obsolete
@ 2003-05-04 18:30 Christoph Hellwig
  0 siblings, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2003-05-04 18:30 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

This file was _the_ header for block-device related stuff in earlier
Linux versions, but nowdays there's just a few prototypes left that
really belong into blkdev.h or genhd.h (and in one case elevator.h).

This patch moves them over and removes everything but including
blkdev.h from blk.h  Note that blkdev.h gets all the headers that
were included in blk.h inmplicitly too.  Now we can start removing
all references to it an maybe kill it off before 2.6.  *sniff*


--- 1.35/include/linux/blk.h	Sun Apr 20 19:22:00 2003
+++ edited/include/linux/blk.h	Thu May  1 17:20:09 2003
@@ -1,41 +1,2 @@
-#ifndef _BLK_H
-#define _BLK_H
-
+/* this file is obsolete, please use <linux/blkdev.h> instead */
 #include <linux/blkdev.h>
-#include <linux/elevator.h>
-#include <linux/config.h>
-#include <linux/spinlock.h>
-#include <linux/compiler.h>
-
-extern void set_device_ro(struct block_device *bdev, int flag);
-extern void set_disk_ro(struct gendisk *disk, int flag);
-extern void add_disk_randomness(struct gendisk *disk);
-extern void rand_initialize_disk(struct gendisk *disk);
-
-/*
- * end_request() and friends. Must be called with the request queue spinlock
- * acquired. All functions called within end_request() _must_be_ atomic.
- *
- * Several drivers define their own end_request and call
- * end_that_request_first() and end_that_request_last()
- * for parts of the original function. This prevents
- * code duplication in drivers.
- */
-
-extern int end_that_request_first(struct request *, int, int);
-extern int end_that_request_chunk(struct request *, int, int);
-extern void end_that_request_last(struct request *);
-extern void end_request(struct request *req, int uptodate);
-struct request *elv_next_request(request_queue_t *q);
-
-static inline void blkdev_dequeue_request(struct request *req)
-{
-	BUG_ON(list_empty(&req->queuelist));
-
-	list_del_init(&req->queuelist);
-
-	if (req->q)
-		elv_remove_request(req->q, req);
-}
-
-#endif /* _BLK_H */
--- 1.101/include/linux/blkdev.h	Thu Apr 24 06:23:09 2003
+++ edited/include/linux/blkdev.h	Thu May  1 17:21:03 2003
@@ -349,6 +349,30 @@
 }
 
 /*
+ * end_request() and friends. Must be called with the request queue spinlock
+ * acquired. All functions called within end_request() _must_be_ atomic.
+ *
+ * Several drivers define their own end_request and call
+ * end_that_request_first() and end_that_request_last()
+ * for parts of the original function. This prevents
+ * code duplication in drivers.
+ */
+extern int end_that_request_first(struct request *, int, int);
+extern int end_that_request_chunk(struct request *, int, int);
+extern void end_that_request_last(struct request *);
+extern void end_request(struct request *req, int uptodate);
+
+static inline void blkdev_dequeue_request(struct request *req)
+{
+	BUG_ON(list_empty(&req->queuelist));
+
+	list_del_init(&req->queuelist);
+
+	if (req->q)
+		elv_remove_request(req->q, req);
+}
+
+/*
  * get ready for proper ref counting
  */
 #define blk_put_queue(q)	do { } while (0)
--- 1.18/include/linux/elevator.h	Sun Jan 12 09:10:40 2003
+++ edited/include/linux/elevator.h	Thu May  1 17:21:24 2003
@@ -54,6 +54,7 @@
 extern void elv_merged_request(request_queue_t *, struct request *);
 extern void elv_remove_request(request_queue_t *, struct request *);
 extern int elv_queue_empty(request_queue_t *);
+extern struct request *elv_next_request(struct request_queue *q);
 extern struct request *elv_former_request(request_queue_t *, struct request *);
 extern struct request *elv_latter_request(request_queue_t *, struct request *);
 extern int elv_register_queue(struct gendisk *);
--- 1.51/include/linux/genhd.h	Fri Apr 25 18:16:28 2003
+++ edited/include/linux/genhd.h	Thu May  1 17:20:09 2003
@@ -190,6 +190,14 @@
 extern void del_gendisk(struct gendisk *gp);
 extern void unlink_gendisk(struct gendisk *gp);
 extern struct gendisk *get_gendisk(dev_t dev, int *part);
+
+extern void set_device_ro(struct block_device *bdev, int flag);
+extern void set_disk_ro(struct gendisk *disk, int flag);
+
+/* drivers/char/random.c */
+extern void add_disk_randomness(struct gendisk *disk);
+extern void rand_initialize_disk(struct gendisk *disk);
+
 static inline sector_t get_start_sect(struct block_device *bdev)
 {
 	return bdev->bd_offset;

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] make <linux/blk.h> obsolete
  2003-05-08  2:57 Perez-Gonzalez, Inaky
@ 2003-05-08  5:09 ` Christoph Hellwig
  0 siblings, 0 replies; 11+ messages in thread
From: Christoph Hellwig @ 2003-05-08  5:09 UTC (permalink / raw)
  To: Perez-Gonzalez, Inaky; +Cc: 'linux-kernel@vger.kernel.org'

On Wed, May 07, 2003 at 07:57:16PM -0700, Perez-Gonzalez, Inaky wrote:
> > +/* this file is obsolete, please use <linux/blkdev.h> instead */
> 
> #warning this file is obsolete, please use <linux/blkdev.h> instead
> 
> At least is kind of more noisy and easy to spot when compiling ...

See the postings earlier in this thread.  There's currently too many
users around in the tree (but Adrian has a patch he'll hopefully
submit soon)


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH] make <linux/blk.h> obsolete
@ 2003-05-08  2:57 Perez-Gonzalez, Inaky
  2003-05-08  5:09 ` Christoph Hellwig
  0 siblings, 1 reply; 11+ messages in thread
From: Perez-Gonzalez, Inaky @ 2003-05-08  2:57 UTC (permalink / raw)
  To: 'Christoph Hellwig'; +Cc: 'linux-kernel@vger.kernel.org'


> From: Christoph Hellwig [mailto:hch@lst.de]
> 
> --- 1.35/include/linux/blk.h	Sun Apr 20 19:22:00 2003
> +++ edited/include/linux/blk.h	Thu May  1 17:20:09 2003
> @@ -1,41 +1,2 @@
> -#ifndef _BLK_H
> -#define _BLK_H
> -
> +/* this file is obsolete, please use <linux/blkdev.h> instead */

#warning this file is obsolete, please use <linux/blkdev.h> instead

At least is kind of more noisy and easy to spot when compiling ...

Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own
(and my fault)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] make <linux/blk.h> obsolete
  2003-05-01 18:48       ` Christoph Hellwig
@ 2003-05-02 20:50         ` Adrian Bunk
  0 siblings, 0 replies; 11+ messages in thread
From: Adrian Bunk @ 2003-05-02 20:50 UTC (permalink / raw)
  To: Christoph Hellwig, torvalds, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1047 bytes --]

On Thu, May 01, 2003 at 08:48:18PM +0200, Christoph Hellwig wrote:
> On Thu, May 01, 2003 at 08:47:01PM +0200, Adrian Bunk wrote:
> > > Later.  First thing is to kill the content, next the users.
> > > Adding the warning now would make a normal compile very verbose..
> > 
> > Shall I prepare a patch removing all #include <linux/blk.h>'s?
> 
> Please do so.  That means I'll have less work to do :)

A patch against 2.5.68-bk11 plus your patch is attached.

I removed all references to blk.h and blk.h does now #error. If people 
want their drivers to run unmodified under 2.4 it might be necessary to 
do a
  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69)
  #include <linux/blk.h>
  #endif

I've tested the compilation with a .config that tries to compile as much 
drivers as possible.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


[-- Attachment #2: patch-cleanup-blk.gz --]
[-- Type: application/x-gunzip, Size: 11163 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] make <linux/blk.h> obsolete
  2003-05-01 18:40   ` Christoph Hellwig
  2003-05-01 18:47     ` Adrian Bunk
  2003-05-01 18:52     ` Andreas Dilger
@ 2003-05-01 20:00     ` H. Peter Anvin
  2 siblings, 0 replies; 11+ messages in thread
From: H. Peter Anvin @ 2003-05-01 20:00 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <20030501204012.A16641@lst.de>
By author:    Christoph Hellwig <hch@lst.de>
In newsgroup: linux.dev.kernel
>  
> Later.  First thing is to kill the content, next the users.
> 

I'm not using it!  I promise!

	-hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] make <linux/blk.h> obsolete
  2003-05-01 18:40   ` Christoph Hellwig
  2003-05-01 18:47     ` Adrian Bunk
@ 2003-05-01 18:52     ` Andreas Dilger
  2003-05-01 20:00     ` H. Peter Anvin
  2 siblings, 0 replies; 11+ messages in thread
From: Andreas Dilger @ 2003-05-01 18:52 UTC (permalink / raw)
  To: Christoph Hellwig, Adrian Bunk, torvalds, linux-kernel

On May 01, 2003  20:40 +0200, Christoph Hellwig wrote:
> On Thu, May 01, 2003 at 08:38:04PM +0200, Adrian Bunk wrote:
> > #warning linux/blk.h is deprecated, use linux/blkdev.h instead.
> > #include <linux/blkdev.h>
> > 
> > or simply remove the blk.h and fix all files trying to include it?
> 
> Later.  First thing is to kill the content, next the users.
> Adding the warning now would make a normal compile very verbose..

And if you leave it around for a while (with warning) after you remove
the in-kernel users, people who have out-of-tree users of that header
at least have an idea of what to do to fix their code.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] make <linux/blk.h> obsolete
  2003-05-01 18:47     ` Adrian Bunk
@ 2003-05-01 18:48       ` Christoph Hellwig
  2003-05-02 20:50         ` Adrian Bunk
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Hellwig @ 2003-05-01 18:48 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: torvalds, linux-kernel

On Thu, May 01, 2003 at 08:47:01PM +0200, Adrian Bunk wrote:
> > Later.  First thing is to kill the content, next the users.
> > Adding the warning now would make a normal compile very verbose..
> 
> Shall I prepare a patch removing all #include <linux/blk.h>'s?

Please do so.  That means I'll have less work to do :)


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] make <linux/blk.h> obsolete
  2003-05-01 18:40   ` Christoph Hellwig
@ 2003-05-01 18:47     ` Adrian Bunk
  2003-05-01 18:48       ` Christoph Hellwig
  2003-05-01 18:52     ` Andreas Dilger
  2003-05-01 20:00     ` H. Peter Anvin
  2 siblings, 1 reply; 11+ messages in thread
From: Adrian Bunk @ 2003-05-01 18:47 UTC (permalink / raw)
  To: Christoph Hellwig, torvalds, linux-kernel

On Thu, May 01, 2003 at 08:40:12PM +0200, Christoph Hellwig wrote:
> On Thu, May 01, 2003 at 08:38:04PM +0200, Adrian Bunk wrote:
> > On Thu, May 01, 2003 at 08:07:19PM +0200, Christoph Hellwig wrote:
> > >...
> > > +/* this file is obsolete, please use <linux/blkdev.h> instead */
> > >...
> > 
> > #warning linux/blk.h is deprecated, use linux/blkdev.h instead.
> > #include <linux/blkdev.h>
> > 
> > or simply remove the blk.h and fix all files trying to include it?
> 
> Later.  First thing is to kill the content, next the users.
> Adding the warning now would make a normal compile very verbose..

Shall I prepare a patch removing all #include <linux/blk.h>'s?

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] make <linux/blk.h> obsolete
  2003-05-01 18:38 ` Adrian Bunk
@ 2003-05-01 18:40   ` Christoph Hellwig
  2003-05-01 18:47     ` Adrian Bunk
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Christoph Hellwig @ 2003-05-01 18:40 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: torvalds, linux-kernel

On Thu, May 01, 2003 at 08:38:04PM +0200, Adrian Bunk wrote:
> On Thu, May 01, 2003 at 08:07:19PM +0200, Christoph Hellwig wrote:
> >...
> > +/* this file is obsolete, please use <linux/blkdev.h> instead */
> >...
> 
> #warning linux/blk.h is deprecated, use linux/blkdev.h instead.
> #include <linux/blkdev.h>
> 
> or simply remove the blk.h and fix all files trying to include it?

Later.  First thing is to kill the content, next the users.
Adding the warning now would make a normal compile very verbose..


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] make <linux/blk.h> obsolete
  2003-05-01 18:07 Christoph Hellwig
@ 2003-05-01 18:38 ` Adrian Bunk
  2003-05-01 18:40   ` Christoph Hellwig
  0 siblings, 1 reply; 11+ messages in thread
From: Adrian Bunk @ 2003-05-01 18:38 UTC (permalink / raw)
  To: Christoph Hellwig, torvalds, linux-kernel

On Thu, May 01, 2003 at 08:07:19PM +0200, Christoph Hellwig wrote:
>...
> +/* this file is obsolete, please use <linux/blkdev.h> instead */
>...

#warning linux/blk.h is deprecated, use linux/blkdev.h instead.
#include <linux/blkdev.h>

or simply remove the blk.h and fix all files trying to include it?

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] make <linux/blk.h> obsolete
@ 2003-05-01 18:07 Christoph Hellwig
  2003-05-01 18:38 ` Adrian Bunk
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Hellwig @ 2003-05-01 18:07 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

This file was _the_ header for block-device related stuff in earlier
Linux versions, but nowdays there's just a few prototypes left that
really belong into blkdev.h or genhd.h (and in one case elevator.h).

This patch moves them over and removes everything but including
blkdev.h from blk.h  Note that blkdev.h gets all the headers that
were included in blk.h inmplicitly too.  Now we can start removing
all references to it an maybe kill it off before 2.6.  *sniff*


--- 1.35/include/linux/blk.h	Sun Apr 20 19:22:00 2003
+++ edited/include/linux/blk.h	Thu May  1 17:20:09 2003
@@ -1,41 +1,2 @@
-#ifndef _BLK_H
-#define _BLK_H
-
+/* this file is obsolete, please use <linux/blkdev.h> instead */
 #include <linux/blkdev.h>
-#include <linux/elevator.h>
-#include <linux/config.h>
-#include <linux/spinlock.h>
-#include <linux/compiler.h>
-
-extern void set_device_ro(struct block_device *bdev, int flag);
-extern void set_disk_ro(struct gendisk *disk, int flag);
-extern void add_disk_randomness(struct gendisk *disk);
-extern void rand_initialize_disk(struct gendisk *disk);
-
-/*
- * end_request() and friends. Must be called with the request queue spinlock
- * acquired. All functions called within end_request() _must_be_ atomic.
- *
- * Several drivers define their own end_request and call
- * end_that_request_first() and end_that_request_last()
- * for parts of the original function. This prevents
- * code duplication in drivers.
- */
-
-extern int end_that_request_first(struct request *, int, int);
-extern int end_that_request_chunk(struct request *, int, int);
-extern void end_that_request_last(struct request *);
-extern void end_request(struct request *req, int uptodate);
-struct request *elv_next_request(request_queue_t *q);
-
-static inline void blkdev_dequeue_request(struct request *req)
-{
-	BUG_ON(list_empty(&req->queuelist));
-
-	list_del_init(&req->queuelist);
-
-	if (req->q)
-		elv_remove_request(req->q, req);
-}
-
-#endif /* _BLK_H */
--- 1.101/include/linux/blkdev.h	Thu Apr 24 06:23:09 2003
+++ edited/include/linux/blkdev.h	Thu May  1 17:21:03 2003
@@ -349,6 +349,30 @@
 }
 
 /*
+ * end_request() and friends. Must be called with the request queue spinlock
+ * acquired. All functions called within end_request() _must_be_ atomic.
+ *
+ * Several drivers define their own end_request and call
+ * end_that_request_first() and end_that_request_last()
+ * for parts of the original function. This prevents
+ * code duplication in drivers.
+ */
+extern int end_that_request_first(struct request *, int, int);
+extern int end_that_request_chunk(struct request *, int, int);
+extern void end_that_request_last(struct request *);
+extern void end_request(struct request *req, int uptodate);
+
+static inline void blkdev_dequeue_request(struct request *req)
+{
+	BUG_ON(list_empty(&req->queuelist));
+
+	list_del_init(&req->queuelist);
+
+	if (req->q)
+		elv_remove_request(req->q, req);
+}
+
+/*
  * get ready for proper ref counting
  */
 #define blk_put_queue(q)	do { } while (0)
--- 1.18/include/linux/elevator.h	Sun Jan 12 09:10:40 2003
+++ edited/include/linux/elevator.h	Thu May  1 17:21:24 2003
@@ -54,6 +54,7 @@
 extern void elv_merged_request(request_queue_t *, struct request *);
 extern void elv_remove_request(request_queue_t *, struct request *);
 extern int elv_queue_empty(request_queue_t *);
+extern struct request *elv_next_request(struct request_queue *q);
 extern struct request *elv_former_request(request_queue_t *, struct request *);
 extern struct request *elv_latter_request(request_queue_t *, struct request *);
 extern int elv_register_queue(struct gendisk *);
--- 1.51/include/linux/genhd.h	Fri Apr 25 18:16:28 2003
+++ edited/include/linux/genhd.h	Thu May  1 17:20:09 2003
@@ -190,6 +190,14 @@
 extern void del_gendisk(struct gendisk *gp);
 extern void unlink_gendisk(struct gendisk *gp);
 extern struct gendisk *get_gendisk(dev_t dev, int *part);
+
+extern void set_device_ro(struct block_device *bdev, int flag);
+extern void set_disk_ro(struct gendisk *disk, int flag);
+
+/* drivers/char/random.c */
+extern void add_disk_randomness(struct gendisk *disk);
+extern void rand_initialize_disk(struct gendisk *disk);
+
 static inline sector_t get_start_sect(struct block_device *bdev)
 {
 	return bdev->bd_offset;

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-05-08  4:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-04 18:30 [PATCH] make <linux/blk.h> obsolete Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2003-05-08  2:57 Perez-Gonzalez, Inaky
2003-05-08  5:09 ` Christoph Hellwig
2003-05-01 18:07 Christoph Hellwig
2003-05-01 18:38 ` Adrian Bunk
2003-05-01 18:40   ` Christoph Hellwig
2003-05-01 18:47     ` Adrian Bunk
2003-05-01 18:48       ` Christoph Hellwig
2003-05-02 20:50         ` Adrian Bunk
2003-05-01 18:52     ` Andreas Dilger
2003-05-01 20:00     ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).