+
+ case O(ASSEMBLE,'b'): /* here we simply set the bitmap file */
+ if (!optarg) {
+ fprintf(stderr, Name ": bitmap file needed with -b in --assemble mode\n");
+ exit(2);
+ }
+ if (strcmp(optarg, "internal")==0) {
+ fprintf(stderr, Name ": there is no need to specify --bitmap when assembling arrays with internal bitmaps\n");
+ continue;
+ }
+ bitmap_fd = open(optarg, O_RDWR);
+ if (!*optarg || bitmap_fd < 0) {
+ fprintf(stderr, Name ": cannot open bitmap file %s: %s\n", optarg, strerror(errno));
+ exit(2);
+ }
+ ident.bitmap_fd = bitmap_fd; /* for Assemble */
+ continue;
+
+ case O(GROW,'b'):
+ case O(BUILD,'b'):
+ case O(CREATE,'b'): /* here we create the bitmap */
+ bitmap_file = optarg;
+ continue;
+
+ case O(GROW,4):
+ case O(BUILD,4):
+ case O(CREATE,4): /* bitmap chunksize */
+ bitmap_chunk = strtol(optarg, &c, 10);
+ if (!optarg[0] || *c || bitmap_chunk < 0 ||
+ bitmap_chunk & (bitmap_chunk - 1)) {
+ fprintf(stderr, Name ": invalid bitmap chunksize: %s\n",
+ optarg);
+ exit(2);
+ }
+ /* convert K to B, chunk of 0K means 512B */
+ bitmap_chunk = bitmap_chunk ? bitmap_chunk * 1024 : 512;
+ continue;
+
+ case O(BUILD, 5):
+ case O(CREATE, 5): /* write-behind mode */
+ write_behind = DEFAULT_MAX_WRITE_BEHIND;
+ if (optarg) {
+ write_behind = strtol(optarg, &c, 10);
+ if (write_behind < 0 || *c ||
+ write_behind > 16383) {
+ fprintf(stderr, Name ": Invalid value for maximum outstanding write-behind writes: %s.\n\tMust be between 0 and 16383.\n", optarg);
+ exit(2);
+ }
+ }
+ continue;