brd.c (448cc2fb3a7b327823a9afd374808c37b8e6194f) brd.c (1ebe2e5f9d68e94c524aba876f27b945669a7879)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Ram backed block device driver.
4 *
5 * Copyright (C) 2007 Nick Piggin
6 * Copyright (C) 2007 Novell Inc.
7 *
8 * Parts derived from drivers/block/rd.c, and drivers/block/loop.c, copyright

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

400 if (!disk)
401 goto out_free_dev;
402
403 disk->major = RAMDISK_MAJOR;
404 disk->first_minor = i * max_part;
405 disk->minors = max_part;
406 disk->fops = &brd_fops;
407 disk->private_data = brd;
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Ram backed block device driver.
4 *
5 * Copyright (C) 2007 Nick Piggin
6 * Copyright (C) 2007 Novell Inc.
7 *
8 * Parts derived from drivers/block/rd.c, and drivers/block/loop.c, copyright

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

400 if (!disk)
401 goto out_free_dev;
402
403 disk->major = RAMDISK_MAJOR;
404 disk->first_minor = i * max_part;
405 disk->minors = max_part;
406 disk->fops = &brd_fops;
407 disk->private_data = brd;
408 disk->flags = GENHD_FL_EXT_DEVT;
409 strlcpy(disk->disk_name, buf, DISK_NAME_LEN);
410 set_capacity(disk, rd_size * 2);
411
412 /*
413 * This is so fdisk will align partitions on 4k, because of
414 * direct_access API needing 4k alignment, returning a PFN
415 * (This is only a problem on very small devices <= 4M,
416 * otherwise fdisk will align on 1M. Regardless this call

--- 121 unchanged lines hidden ---
408 strlcpy(disk->disk_name, buf, DISK_NAME_LEN);
409 set_capacity(disk, rd_size * 2);
410
411 /*
412 * This is so fdisk will align partitions on 4k, because of
413 * direct_access API needing 4k alignment, returning a PFN
414 * (This is only a problem on very small devices <= 4M,
415 * otherwise fdisk will align on 1M. Regardless this call

--- 121 unchanged lines hidden ---