[DRBD-cvs] drbd by phil; Some work to deal with x390 boxes.
drbd-user@lists.linbit.com
drbd-user@lists.linbit.com
Fri, 25 Jun 2004 15:19:55 +0200 (CEST)
DRBD CVS committal
Author : phil
Module : drbd
Dir : drbd/drbd
Modified Files:
Tag: rel-0_7-branch
drbd_actlog.c drbd_int.h drbd_main.c
Log Message:
Some work to deal with x390 boxes.
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/Attic/drbd_actlog.c,v
retrieving revision 1.1.2.110
retrieving revision 1.1.2.111
diff -u -3 -r1.1.2.110 -r1.1.2.111
--- drbd_actlog.c 18 Jun 2004 12:45:05 -0000 1.1.2.110
+++ drbd_actlog.c 25 Jun 2004 13:19:50 -0000 1.1.2.111
@@ -60,7 +60,7 @@
bh.b_rdev = mdev->md_bdev;
bh.b_rsector = sector;
bh.b_state = (1 << BH_Req) | (1 << BH_Mapped) | (1 << BH_Lock);
- bh.b_size = 512; // THINK: always? well, we can add an other parameter
+ bh.b_size = MD_HARDSECT;
bh.b_page = mdev->md_io_page;
bh.b_reqnext = NULL;
bh.b_data = page_address(mdev->md_io_page);
@@ -106,7 +106,7 @@
vec.bv_page = mdev->md_io_page;
vec.bv_offset = 0;
vec.bv_len =
- bio.bi_size = 512; // THINK: always? well, we can add an other parameter
+ bio.bi_size = MD_HARDSECT;
bio.bi_vcnt = 1;
bio.bi_idx = 0;
bio.bi_bdev = mdev->md_bdev;
@@ -145,11 +145,11 @@
}
#endif
-struct al_transaction {
+struct __attribute__((packed)) al_transaction {
u32 magic;
u32 tr_number;
// u32 tr_generation; //TODO
- struct {
+ struct __attribute__((packed)) {
u32 pos;
u32 extent; } updates[1 + AL_EXTENTS_PT];
u32 xor_sum;
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/drbd_int.h,v
retrieving revision 1.58.2.176
retrieving revision 1.58.2.177
diff -u -3 -r1.58.2.176 -r1.58.2.177
--- drbd_int.h 25 Jun 2004 09:44:20 -0000 1.58.2.176
+++ drbd_int.h 25 Jun 2004 13:19:50 -0000 1.58.2.177
@@ -808,8 +808,16 @@
#define MD_AL_MAX_SIZE 64 // = 32 kb LOG ~ 3776 extents ~ 14 GB Storage
#define MD_BM_OFFSET (MD_AL_OFFSET + MD_AL_MAX_SIZE) //Allows up to about 3.8TB
+// All metadata IO is done in units of MD_HARDSECT
+#if defined(CONFIG_ARCH_S390) | defined(CONFIG_ARCH_S390X)
+#define MD_HARDSECT_B 12 // Necessary for s390
+#else
+#define MD_HARDSECT_B 9 // Nice for "small" hardware.
+#endif
+#define MD_HARDSECT (1<<MD_HARDSECT_B)
+
// activity log
-#define AL_EXTENTS_PT 61 // Extents per 512B sector (AKA transaction)
+#define AL_EXTENTS_PT (MD_HARDSECT-12)/8-1 // 61 ; Extents per 512B sector
#define AL_EXTENT_SIZE_B 22 // One extent represents 4M Storage
#define AL_EXTENT_SIZE (1<<AL_EXTENT_SIZE_B)
@@ -826,7 +834,7 @@
#endif
// resync bitmap
-// 16MB sized 'bitmap extent' to track syncer usage
+// 16MB sized 'bitmap extent' to track syncer usage [128MB on the x390]
struct bm_extent {
struct lc_element lce;
int rs_left; //number of bits set (out of sync) in this extent.
@@ -848,7 +856,7 @@
#define BM_BLOCK_SIZE (1<<BM_BLOCK_SIZE_B)
/* (9+3) : 512 bytes @ 8 bits; representing 16M storage
* per sector of on disk bitmap */
-#define BM_EXT_SIZE_B (BM_BLOCK_SIZE_B + 9+3) // = 24
+#define BM_EXT_SIZE_B (BM_BLOCK_SIZE_B + MD_HARDSECT_B + 3 ) // = 24
#define BM_EXT_SIZE (1<<BM_EXT_SIZE_B)
/* thus many _storage_ sectors are described by one bit */
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/drbd_main.c,v
retrieving revision 1.73.2.190
retrieving revision 1.73.2.191
diff -u -3 -r1.73.2.190 -r1.73.2.191
--- drbd_main.c 24 Jun 2004 15:17:33 -0000 1.73.2.190
+++ drbd_main.c 25 Jun 2004 13:19:50 -0000 1.73.2.191
@@ -1603,6 +1603,8 @@
int __init drbd_init(void)
{
+ int i,err;
+
#if 0
/* I am too lazy to calculate this by hand -lge
*/
@@ -1618,10 +1620,9 @@
SZO(struct bio);
SZO(wait_queue_head_t);
SZO(spinlock_t);
+ printk(KERN_ERR "AL_EXTENTS_PT = %d\n",AL_EXTENTS_PT);
return -EBUSY;
#endif
-
- int i,err;
if (1 > minor_count||minor_count > 255) {
printk(KERN_ERR DEVICE_NAME