nbd.c (a782483cc1f875355690625d8253a232f2581418) nbd.c (977115c0f664e016a6b2774d4f97116ade23d732)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Network block device - make block devices work over TCP
4 *
5 * Note that you can not swap over this thing, yet. Seems to work but
6 * deadlocks sometimes - you can not swap over TCP in general.
7 *
8 * Copyright 1997-2000, 2008 Pavel Machek <pavel@ucw.cz>

--- 1474 unchanged lines hidden (view full) ---

1483out:
1484 mutex_unlock(&nbd_index_mutex);
1485 return ret;
1486}
1487
1488static void nbd_release(struct gendisk *disk, fmode_t mode)
1489{
1490 struct nbd_device *nbd = disk->private_data;
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Network block device - make block devices work over TCP
4 *
5 * Note that you can not swap over this thing, yet. Seems to work but
6 * deadlocks sometimes - you can not swap over TCP in general.
7 *
8 * Copyright 1997-2000, 2008 Pavel Machek <pavel@ucw.cz>

--- 1474 unchanged lines hidden (view full) ---

1483out:
1484 mutex_unlock(&nbd_index_mutex);
1485 return ret;
1486}
1487
1488static void nbd_release(struct gendisk *disk, fmode_t mode)
1489{
1490 struct nbd_device *nbd = disk->private_data;
1491 struct block_device *bdev = bdget_disk(disk, 0);
1492
1493 if (test_bit(NBD_RT_DISCONNECT_ON_CLOSE, &nbd->config->runtime_flags) &&
1491
1492 if (test_bit(NBD_RT_DISCONNECT_ON_CLOSE, &nbd->config->runtime_flags) &&
1494 bdev->bd_openers == 0)
1493 disk->part0->bd_openers == 0)
1495 nbd_disconnect_and_put(nbd);
1494 nbd_disconnect_and_put(nbd);
1496 bdput(bdev);
1497
1498 nbd_config_put(nbd);
1499 nbd_put(nbd);
1500}
1501
1502static const struct block_device_operations nbd_fops =
1503{
1504 .owner = THIS_MODULE,

--- 928 unchanged lines hidden ---
1495
1496 nbd_config_put(nbd);
1497 nbd_put(nbd);
1498}
1499
1500static const struct block_device_operations nbd_fops =
1501{
1502 .owner = THIS_MODULE,

--- 928 unchanged lines hidden ---