• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ del_gendisk函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中del_gendisk函数的典型用法代码示例。如果您正苦于以下问题:C++ del_gendisk函数的具体用法?C++ del_gendisk怎么用?C++ del_gendisk使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了del_gendisk函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: zvol_free

/*
 * Cleanup then free a zvol_state_t which was created by zvol_alloc().
 */
static void
zvol_free(zvol_state_t *zv)
{
	avl_destroy(&zv->zv_znode.z_range_avl);
	mutex_destroy(&zv->zv_znode.z_range_lock);

	del_gendisk(zv->zv_disk);
	blk_cleanup_queue(zv->zv_queue);
	put_disk(zv->zv_disk);

	kmem_free(zv, sizeof (zvol_state_t));
}
开发者ID:koplover,项目名称:zfs,代码行数:15,代码来源:zvol.c


示例2: tbio_exit

static void tbio_exit(void)
{
	if(Device.bdev) {
		invalidate_bdev(Device.bdev,1);
		bdput(Device.bdev);
	}

	del_gendisk(Device.gd);
	put_disk(Device.gd);
	unregister_blkdev(TBIO_MAJOR , "tbio");
	vfree(Device.data);
}
开发者ID:ystk,项目名称:debian-ltp,代码行数:12,代码来源:tbio.c


示例3: tc20

static void tc20(void)
{
	struct gendisk *gd_ptr;

	gd_ptr = alloc_disk(1);
	if (!gd_ptr) {
		return;
	}
	printk(KERN_DEBUG "gd_ptr after alloc=%p\n", gd_ptr);

	del_gendisk(gd_ptr);
}
开发者ID:1587,项目名称:ltp,代码行数:12,代码来源:test_genhd.c


示例4: null_del_dev

static void null_del_dev(struct nullb *nullb)
{
	list_del_init(&nullb->list);

	del_gendisk(nullb->disk);
	if (queue_mode == NULL_Q_MQ)
		blk_mq_free_queue(nullb->q);
	else
		blk_cleanup_queue(nullb->q);
	put_disk(nullb->disk);
	kfree(nullb);
}
开发者ID:ChenLiangyuX,项目名称:linux,代码行数:12,代码来源:null_blk.c


示例5: cleanup_device

static void cleanup_device(osprd_info_t *d)
{
	wake_up_all(&d->blockq);
	if (d->gd) {
		del_gendisk(d->gd);
		put_disk(d->gd);
	}
	if (d->queue)
		blk_cleanup_queue(d->queue);
	if (d->data)
		vfree(d->data);
}
开发者ID:zrnorth,项目名称:linux-kernel-module,代码行数:12,代码来源:osprd.c


示例6: aoedev_freedev

static void
aoedev_freedev(struct aoedev *d)
{
	if (d->gd) {
		aoedisk_rm_sysfs(d);
		del_gendisk(d->gd);
		put_disk(d->gd);
	}
	kfree(d->frames);
	if (d->bufpool)
		mempool_destroy(d->bufpool);
	kfree(d);
}
开发者ID:OpenHMR,项目名称:Open-HMR600,代码行数:13,代码来源:aoedev.c


示例7: sbd_exit

static void __exit sbd_exit(void)
{
	del_gendisk(Device.gd);
	put_disk(Device.gd);
	unregister_blkdev(major_num, "sbd");
	blk_cleanup_queue(Queue);
	crypto_free_cipher(tfm);

	device_remove_file(&rd_root_dev, &dev_attr_key);
	device_unregister(&rd_root_dev);

	vfree(Device.data);
}
开发者ID:anisimon,项目名称:cs444-008,代码行数:13,代码来源:cs444_project3_008.c


示例8: ramblock_exit

static void ramblock_exit(void)
{
	unregister_blkdev(major, "ramblock");
	del_gendisk(ramblock_gendisk);

	/*  put_disk(ramblock_gendisk);
	 *  视频里有这一句话,我这里注释掉貌似也没什么问题
	 *  应该是需要的,要把计数器减去1
	 */

	blk_cleanup_queue(ramblock_request_queue);
	kfree(ramblock_buf);
}
开发者ID:54shady,项目名称:mini2440_drv,代码行数:13,代码来源:ramblock.c


示例9: ramhd_exit

void ramhd_exit(void) {
    int i;

    for (i = 0; i < RAMHD_MAX_DEVICE; i++) {
        del_gendisk(rdev[i]->gd);
        put_disk(rdev[i]->gd);
        blk_cleanup_queue(rdev[i]->queue);
    }

    unregister_blkdev(ramhd_major, RAMHD_NAME);
    clean_ramdev();
    ramhd_space_clean();
}
开发者ID:0x1abin,项目名称:linux_kernel_driver,代码行数:13,代码来源:ramhd_req.c


示例10: ide_gd_remove

static void ide_gd_remove(ide_drive_t *drive)
{
	struct ide_disk_obj *idkp = drive->driver_data;
	struct gendisk *g = idkp->disk;

	ide_proc_unregister_driver(drive, idkp->driver);

	del_gendisk(g);

	drive->disk_ops->flush(drive);

	ide_disk_put(idkp);
}
开发者ID:embest-tech,项目名称:rowboat-kernel,代码行数:13,代码来源:ide-gd.c


示例11: slot_disable

LOCAL void slot_disable(int slot)
{
    struct ndas_slot* sd = NDAS_GET_SLOT_DEV(slot); 
    dbgl_blk(2, "ing slot=%d",slot);

    if ( sd == NULL ) {
        dbgl_blk(0, "ndas: fix me at slot_disable!!");
        goto out;
    }
    down(&sd->mutex);
    if ( !sd->enabled ) {
        dbgl_blk(1, "ed slot=%d is already disabled",slot);    
        up(&sd->mutex);
        goto out;
    }
#if LINUX_VERSION_25_ABOVE
    del_gendisk(sd->disk);
    put_disk(sd->disk);
    sd->disk = NULL;
    blk_cleanup_queue(sd->queue);
    sd->queue = NULL;   
#else    

    ndas_ops_set_blk_size(slot, 0, 0, 0, 0);
    ndas_ops_invalidate_slot(slot);
#endif   

#ifdef NDAS_DEVFS
//	devfs_unregister(sd->devfs_handle);
#endif

    sd->enabled = 0;
    up(&sd->mutex);
    module_put(THIS_MODULE);
    MOD_DEC_USE_COUNT;
    if ( sd ) {
#if LINUX_VERSION_25_ABOVE
        printk("ndas: /dev/%s is disabled\n", sd->devname);
#else
#ifdef NDAS_DEVFS
       printk("ndas: /dev/nd/disc%d is disabled\n", slot - NDAS_FIRST_SLOT_NR);
#else
	   printk("ndas: /dev/nd%c is disabled\n", slot + 'a' - NDAS_FIRST_SLOT_NR);
#endif	   
#endif
    }
    else
        printk("ndas: slot %d is disabled\n", slot);
out:    
    dbgl_blk(3, "ed");
}
开发者ID:dansdrivers,项目名称:ndas4linux,代码行数:51,代码来源:ctrldev.c


示例12: cleanup_module

void cleanup_module(void) 
{ 

    printk(KERN_ALERT "Exiting module and cleaning up \n");

    pm_unregister(ltp_pm_dev); 

    put_disk(gd_ptr);

    del_gendisk(gd_ptr);

    unregister_blkdev(ltp_fs_major, LTP_FS_DEV_NAME);

}
开发者ID:HackLinux,项目名称:device_driver_test,代码行数:14,代码来源:LtpfsCmds.c


示例13: ide_gd_remove

static void ide_gd_remove(ide_drive_t *drive)
{
	struct ide_disk_obj *idkp = drive->driver_data;
	struct gendisk *g = idkp->disk;

	ide_proc_unregister_driver(drive, idkp->driver);
	device_del(&idkp->dev);
	del_gendisk(g);
	drive->disk_ops->flush(drive);

	mutex_lock(&ide_disk_ref_mutex);
	put_device(&idkp->dev);
	mutex_unlock(&ide_disk_ref_mutex);
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:14,代码来源:ide-gd.c


示例14: pt_exit

static void pt_exit(void)
{
	if (passthrough->gd) {
		del_gendisk(passthrough->gd);
		put_disk(passthrough->gd);
	}
	if (passthrough->queue)
		blk_cleanup_queue(passthrough->queue);

	blkdev_put(passthrough->target_dev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);

	unregister_blkdev(passthrough->major, "passthrough");
	kfree(passthrough);
}
开发者ID:Dolbysh,项目名称:gestion_projet,代码行数:14,代码来源:passthrough.c


示例15: null_del_dev

static void null_del_dev(struct nullb *nullb)
{
	list_del_init(&nullb->list);

	if (use_lightnvm)
		null_nvm_unregister(nullb);
	else
		del_gendisk(nullb->disk);
	blk_cleanup_queue(nullb->q);
	if (queue_mode == NULL_Q_MQ)
		blk_mq_free_tag_set(&nullb->tag_set);
	if (!use_lightnvm)
		put_disk(nullb->disk);
	cleanup_queues(nullb);
	kfree(nullb);
}
开发者ID:acton393,项目名称:linux,代码行数:16,代码来源:null_blk.c


示例16: free_dev

static void free_dev(struct mapped_device *md)
{
	unsigned int minor = md->disk->first_minor;

	if (md->suspended_bdev) {
		thaw_bdev(md->suspended_bdev, NULL);
		bdput(md->suspended_bdev);
	}
	mempool_destroy(md->tio_pool);
	mempool_destroy(md->io_pool);
	del_gendisk(md->disk);
	free_minor(minor);
	put_disk(md->disk);
	blk_put_queue(md->queue);
	kfree(md);
}
开发者ID:ena30,项目名称:snake-os,代码行数:16,代码来源:dm.c


示例17: stackbd_exit

static void __exit stackbd_exit(void)
{
    printk("stackbd: exit\n");

    if (stackbd.is_active)
    {
        kthread_stop(stackbd.thread);
        blkdev_put(stackbd.bdev_raw, STACKBD_BDEV_MODE);
        bdput(stackbd. bdev_raw);
    }

	del_gendisk(stackbd.gd);
	put_disk(stackbd.gd);
	unregister_blkdev(major_num, STACKBD_NAME);
	blk_cleanup_queue(stackbd.queue);
}
开发者ID:rosrez,项目名称:drv2,代码行数:16,代码来源:stackbd-orig.c


示例18: cleanup_device

static void cleanup_device(osprd_info_t *d)
{
	wake_up_all(&d->blockq);
	if (d->gd) {
		del_gendisk(d->gd);
		put_disk(d->gd);
	}
	if (d->queue)
		blk_cleanup_queue(d->queue);
	if (d->data)
		vfree(d->data);

	linked_list_free(&d->read_locking_pids);
	linked_list_free(&d->invalid_tickets);
	d->passwd_hash = 0;
}
开发者ID:m1c0l,项目名称:ramdisk,代码行数:16,代码来源:osprd.c


示例19: sbd_exit

static void __exit sbd_exit(void)
{


	if (clientsocket)
		sock_release(clientsocket);

        del_gendisk(Device.gd);
        put_disk(Device.gd);
        unregister_blkdev(major_num, "sbd");
        blk_cleanup_queue(Queue);
        vfree(Device.data);

	printk("EXIT MODULE\n");

}
开发者ID:sciciliani,项目名称:sbdtcp,代码行数:16,代码来源:sbd.c


示例20: zvol_free

/*
 * Cleanup then free a zvol_state_t which was created by zvol_alloc().
 */
static void
zvol_free(zvol_state_t *zv)
{
	ASSERT(MUTEX_HELD(&zvol_state_lock));
	ASSERT(zv->zv_open_count == 0);

	zfs_rlock_destroy(&zv->zv_range_lock);

	zv->zv_disk->private_data = NULL;

	del_gendisk(zv->zv_disk);
	blk_cleanup_queue(zv->zv_queue);
	put_disk(zv->zv_disk);

	kmem_free(zv, sizeof (zvol_state_t));
}
开发者ID:alek-p,项目名称:zfs,代码行数:19,代码来源:zvol.c



注:本文中的del_gendisk函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ del_lump函数代码示例发布时间:2022-05-30
下一篇:
C++ del_fvec函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap