patch-2.4.13 linux/include/linux/blkdev.h
Next file: linux/include/linux/console_struct.h
Previous file: linux/include/linux/b1pcmcia.h
Back to the patch index
Back to the overall index
- Lines: 37
- Date:
Tue Oct 23 22:01:01 2001
- Orig file:
v2.4.12/linux/include/linux/blkdev.h
- Orig date:
Thu Oct 18 13:49:40 2001
diff -u --recursive --new-file v2.4.12/linux/include/linux/blkdev.h linux/include/linux/blkdev.h
@@ -19,7 +19,6 @@
struct request {
struct list_head queue;
int elevator_sequence;
- struct list_head table;
volatile int rq_status; /* should split this into a few status bits */
#define RQ_INACTIVE (-1)
@@ -202,5 +201,28 @@
#define blk_finished_io(nsects) do { } while (0)
#define blk_started_io(nsects) do { } while (0)
+
+static inline unsigned int blksize_bits(unsigned int size)
+{
+ unsigned int bits = 8;
+ do {
+ bits++;
+ size >>= 1;
+ } while (size > 256);
+ return bits;
+}
+
+static inline unsigned int block_size(kdev_t dev)
+{
+ int retval = BLOCK_SIZE;
+ int major = MAJOR(dev);
+
+ if (blksize_size[major]) {
+ int minor = MINOR(dev);
+ if (blksize_size[major][minor])
+ retval = blksize_size[major][minor];
+ }
+ return retval;
+}
#endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)