--- disk-io.c.orig 2009-02-15 13:35:46.000000000 +0100
+++ disk-io.c 2009-02-14 20:41:42.000000000 +0100
device = multi->stripes[0].dev;
blocksize = min(blocksize, (u32)(64 * 1024));
+ read(device->fd, &multi->stripes[0].physical, blocksize);
readahead(device->fd, multi->stripes[0].physical, blocksize);
if (sb_bytenr != BTRFS_SUPER_INFO_OFFSET) {
+ ret = pread(fd, &buf, sizeof(buf), sb_bytenr);
ret = pread64(fd, &buf, sizeof(buf), sb_bytenr);
for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
bytenr = btrfs_sb_offset(i);
+ ret = pread(fd, &buf, sizeof(buf), bytenr);
ret = pread64(fd, &buf, sizeof(buf), bytenr);
BTRFS_SUPER_INFO_SIZE - BTRFS_CSUM_SIZE);
btrfs_csum_final(crc, (char *)&sb->csum[0]);
+ ret = pwrite(device->fd, sb, BTRFS_SUPER_INFO_SIZE,
+ root->fs_info->super_bytenr);
ret = pwrite64(device->fd, sb, BTRFS_SUPER_INFO_SIZE,
root->fs_info->super_bytenr);
BUG_ON(ret != BTRFS_SUPER_INFO_SIZE);
BTRFS_SUPER_INFO_SIZE - BTRFS_CSUM_SIZE);
btrfs_csum_final(crc, (char *)&sb->csum[0]);
+ ret = pwrite(device->fd, sb, BTRFS_SUPER_INFO_SIZE, bytenr);
ret = pwrite64(device->fd, sb, BTRFS_SUPER_INFO_SIZE, bytenr);
BUG_ON(ret != BTRFS_SUPER_INFO_SIZE);