dcssblk_shared_store(struct device *dev, const char *inbuf, size_t count) 
dcssblk_shared_store(struct device *dev, struct device_attribute *attr, const char *inbuf, size_t count) 
dcssblk_shared_store(struct device *dev, const char *inbuf, size_t count){	struct dcssblk_dev_info *dev_info;	int rc;	if ((count > 1) && (inbuf[1] != '\n') && (inbuf[1] != '\0')) {		PRINT_WARN("Invalid value, must be 0 or 1\n");		return -EINVAL;	}	down_write(&dcssblk_devices_sem);	dev_info = container_of(dev, struct dcssblk_dev_info, dev);	if (atomic_read(&dev_info->use_count)) {		PRINT_ERR("share: segment %s is busy!\n",			  dev_info->segment_name);		rc = -EBUSY;		goto out;	}	if (inbuf[0] == '1') {		// reload segment in shared mode		rc = segment_modify_shared(dev_info->segment_name,					   SEGMENT_SHARED);		if (rc < 0) {			BUG_ON(rc == -EINVAL);			if (rc == -EIO || rc == -ENOENT)				goto removeseg;		} else {			dev_info->is_shared = 1;			switch (dev_info->segment_type) {				case SEG_TYPE_SR:				case SEG_TYPE_ER:				case SEG_TYPE_SC:					set_disk_ro(dev_info->gd,1);			}		}	} else if (inbuf[0] == '0') {		// reload segment in exclusive mode		if (dev_info->segment_type == SEG_TYPE_SC) {			PRINT_ERR("Segment type SC (%s) cannot be loaded in "				  "non-shared mode\n", dev_info->segment_name);			rc = -EINVAL;			goto out;		}		rc = segment_modify_shared(dev_info->segment_name,					   SEGMENT_EXCLUSIVE);		if (rc < 0) {			BUG_ON(rc == -EINVAL);			if (rc == -EIO || rc == -ENOENT)				goto removeseg;		} else {			dev_info->is_shared = 0;			set_disk_ro(dev_info->gd, 0);		}	} else {		PRINT_WARN("Invalid value, must be 0 or 1\n");		rc = -EINVAL;		goto out;	}	rc = count;	goto out;removeseg:	PRINT_ERR("Could not reload segment %s, removing it now!\n",			dev_info->segment_name);	list_del(&dev_info->lh);	del_gendisk(dev_info->gd);	blk_put_queue(dev_info->dcssblk_queue);	dev_info->gd->queue = NULL;	put_disk(dev_info->gd);	device_unregister(dev);	put_device(dev);out:	up_write(&dcssblk_devices_sem);	return rc;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/e404e274f62665f3333d6a539d0d3701f678a598/dcssblk.c/clean/drivers/s390/block/dcssblk.c