/* * Since the matching fput() call to the * bdev_file_open_by_path() in this function is not called before * dasd_destroy_partitions the offline open_count limit needs to be * increased from 0 to 1. This is done by setting device->bdev_file * (see dasd_generic_set_offline). As long as the partition detection * is running no offline should be allowed. That is why the assignment * to block->bdev_file is done AFTER the BLKRRPART ioctl.
*/
block->bdev_file = bdev_file; return 0;
}
/* * Remove all inodes in the system for a device, delete the * partitions and make device unusable by setting its size to zero.
*/ void dasd_destroy_partitions(struct dasd_block *block)
{ struct file *bdev_file;
/* * Get the bdev_file pointer from the device structure and clear * device->bdev_file to lower the offline open_count limit again.
*/
bdev_file = block->bdev_file;
block->bdev_file = NULL;
/* Matching blkdev_put to the blkdev_get in dasd_scan_partitions. */
fput(bdev_file);
}
int dasd_gendisk_init(void)
{ int rc;
/* Register to static dasd major 94 */
rc = register_blkdev(DASD_MAJOR, "dasd"); if (rc != 0) {
pr_warn("Registering the device driver with major number %d failed\n",
DASD_MAJOR); return rc;
} return 0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.