err = deny_bitmap_write_access(mddev->bitmap_file); if (err) { printk(KERN_ERR "%s: error: bitmap file is already in use\n", mdname(mddev)); fput(mddev->bitmap_file);
if (fd >= 0) { if (mddev->bitmap) return -EEXIST;  mddev->bitmap_file = fget(fd);  if (mddev->bitmap_file == NULL) { printk(KERN_ERR "%s: error: failed to get bitmap file\n", mdname(mddev)); return -EBADF; }  err = deny_bitmap_write_access(mddev->bitmap_file); if (err) { printk(KERN_ERR "%s: error: bitmap file is already in use\n", mdname(mddev)); fput(mddev->bitmap_file); mddev->bitmap_file = NULL; return err; } mddev->bitmap_offset = 0;  } else if (mddev->bitmap == NULL) return -ENOENT;  err = 0; if (mddev->pers) { mddev->pers->quiesce(mddev, 1); if (fd >= 0) err = bitmap_create(mddev); if (fd < 0 || err) bitmap_destroy(mddev); mddev->pers->quiesce(mddev, 0); } else if (fd < 0) { if (mddev->bitmap_file) fput(mddev->bitmap_file);
static int set_bitmap_file(mddev_t *mddev, int fd){	int err;	if (mddev->pers || mddev->bitmap_file)		return -EBUSY;	mddev->bitmap_file = fget(fd);	if (mddev->bitmap_file == NULL) {		printk(KERN_ERR "%s: error: failed to get bitmap file\n",			mdname(mddev));		return -EBADF;	}	err = deny_bitmap_write_access(mddev->bitmap_file);	if (err) {		printk(KERN_ERR "%s: error: bitmap file is already in use\n",			mdname(mddev));		fput(mddev->bitmap_file);		mddev->bitmap_file = NULL;	} else		mddev->bitmap_offset = 0; /* file overrides offset */	return err;}