Ticket #18502: patch-btrfs-image.c.diff
File patch-btrfs-image.c.diff, 879 bytes (added by 0xffea@…, 16 years ago) |
---|
-
btrfs-image.c
old new 249 249 static int metadump_init(struct metadump_struct *md, struct btrfs_root *root, 250 250 FILE *out, int num_threads, int compress_level) 251 251 { 252 int i, ret ;252 int i, ret = 0; 253 253 254 254 memset(md, 0, sizeof(*md)); 255 255 pthread_cond_init(&md->cond, NULL); … … 608 608 if (async->start == BTRFS_SUPER_INFO_OFFSET) 609 609 update_super(outbuf); 610 610 611 #ifdef __APPLE__ 612 ret = pwrite(outfd, outbuf, size, async->start); 613 #else 611 614 ret = pwrite64(outfd, outbuf, size, async->start); 615 #endif 612 616 BUG_ON(ret != size); 613 617 614 618 pthread_mutex_lock(&mdres->mutex); … … 834 838 } 835 839 836 840 if (num_threads == 0 && compress_level > 0) { 841 #ifdef _SC_NPROCESSORS_ONLN 837 842 num_threads = sysconf(_SC_NPROCESSORS_ONLN); 843 #endif 838 844 if (num_threads <= 0) 839 845 num_threads = 1; 840 846 }