/* Functions to lock and unlock any filesystem running on the device.  */
static int lock_fs(struct mapped_device *md)
/* Functions to lock and unlock any filesystem running on the device.  */
static int lock_fs(struct mapped_device *md)
{
	int r;
	WARN_ON(md->frozen_sb);
	md->frozen_sb = freeze_bdev(md->bdev);
	if (IS_ERR(md->frozen_sb)) {
		r = PTR_ERR(md->frozen_sb);
		md->frozen_sb = NULL;
		return r;
	}
	set_bit(DMF_FROZEN, &md->flags);
	return 0;
}