1 #ifndef _DRBD_WRAPPERS_H
2 #define _DRBD_WRAPPERS_H
4 #include <linux/ctype.h>
8 /* see get_sb_bdev and bd_claim */
9 extern char *drbd_sec_holder
;
11 /* sets the number of 512 byte sectors of our virtual device */
12 static inline void drbd_set_my_capacity(struct drbd_conf
*mdev
,
15 /* set_capacity(mdev->this_bdev->bd_disk, size); */
16 set_capacity(mdev
->vdisk
, size
);
17 mdev
->this_bdev
->bd_inode
->i_size
= (loff_t
)size
<< 9;
20 #define drbd_bio_uptodate(bio) bio_flagged(bio, BIO_UPTODATE)
22 /* bi_end_io handlers */
23 extern void drbd_md_io_complete(struct bio
*bio
, int error
);
24 extern void drbd_peer_request_endio(struct bio
*bio
, int error
);
25 extern void drbd_request_endio(struct bio
*bio
, int error
);
28 * used to submit our private bio
30 static inline void drbd_generic_make_request(struct drbd_conf
*mdev
,
31 int fault_type
, struct bio
*bio
)
35 printk(KERN_ERR
"drbd%d: drbd_generic_make_request: "
36 "bio->bi_bdev == NULL\n",
39 bio_endio(bio
, -ENODEV
);
43 if (drbd_insert_fault(mdev
, fault_type
))
46 generic_make_request(bio
);
51 # define __cond_lock(x,c) (c)