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

C++ queue_var_store函数代码示例

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

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



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

示例1: queue_rq_affinity_store

static ssize_t
queue_rq_affinity_store(struct request_queue *q, const char *page, size_t count)
{
    ssize_t ret = -EINVAL;
#ifdef CONFIG_SMP
    unsigned long val;

    ret = queue_var_store(&val, page, count);
    if (ret < 0)
        return ret;

    spin_lock_irq(q->queue_lock);
    if (val == 2) {
        queue_flag_set(QUEUE_FLAG_SAME_COMP, q);
        queue_flag_set(QUEUE_FLAG_SAME_FORCE, q);
    } else if (val == 1) {
        queue_flag_set(QUEUE_FLAG_SAME_COMP, q);
        queue_flag_clear(QUEUE_FLAG_SAME_FORCE, q);
    } else if (val == 0) {
        queue_flag_clear(QUEUE_FLAG_SAME_COMP, q);
        queue_flag_clear(QUEUE_FLAG_SAME_FORCE, q);
    }
    spin_unlock_irq(q->queue_lock);
#endif
    return ret;
}
开发者ID:gmujica,项目名称:ubuntu-fixes,代码行数:26,代码来源:blk-sysfs.c


示例2: queue_requests_store

static ssize_t
queue_requests_store(struct request_queue *q, const char *page, size_t count)
{
    unsigned long nr;
    int ret, err;

    if (!q->request_fn && !q->mq_ops)
        return -EINVAL;

    ret = queue_var_store(&nr, page, count);
    if (ret < 0)
        return ret;

    if (nr < BLKDEV_MIN_RQ)
        nr = BLKDEV_MIN_RQ;

    if (q->request_fn)
        err = blk_update_nr_requests(q, nr);
    else
        err = blk_mq_update_nr_requests(q, nr);

    if (err)
        return err;

    return ret;
}
开发者ID:gmujica,项目名称:ubuntu-fixes,代码行数:26,代码来源:blk-sysfs.c


示例3: queue_ra_store

static ssize_t
queue_ra_store(struct request_queue *q, const char *page, size_t count)
{
	unsigned long ra_kb;
	ssize_t ret = queue_var_store(&ra_kb, page, count);

	q->backing_dev_info.ra_pages = ra_kb >> (PAGE_CACHE_SHIFT - 10);

	return ret;
}
开发者ID:AndroidDeveloperAlliance,项目名称:ZenKernel_Grouper,代码行数:10,代码来源:blk-sysfs.c


示例4: queue_requests_store

static ssize_t
queue_requests_store(struct request_queue *q, const char *page, size_t count)
{
	struct request_list *rl;
	unsigned long nr;
	int ret;

	if (!q->request_fn)
		return -EINVAL;

	ret = queue_var_store(&nr, page, count);
	if (ret < 0)
		return ret;

	if (nr < BLKDEV_MIN_RQ)
		nr = BLKDEV_MIN_RQ;

	spin_lock_irq(q->queue_lock);
	q->nr_requests = nr;
	blk_queue_congestion_threshold(q);

	/* congestion isn't cgroup aware and follows root blkcg for now */
	rl = &q->root_rl;

	if (rl->count[BLK_RW_SYNC] >= queue_congestion_on_threshold(q))
		blk_set_queue_congested(q, BLK_RW_SYNC);
	else if (rl->count[BLK_RW_SYNC] < queue_congestion_off_threshold(q))
		blk_clear_queue_congested(q, BLK_RW_SYNC);

	if (rl->count[BLK_RW_ASYNC] >= queue_congestion_on_threshold(q))
		blk_set_queue_congested(q, BLK_RW_ASYNC);
	else if (rl->count[BLK_RW_ASYNC] < queue_congestion_off_threshold(q))
		blk_clear_queue_congested(q, BLK_RW_ASYNC);

	blk_queue_for_each_rl(rl, q) {
		if (rl->count[BLK_RW_SYNC] >= q->nr_requests) {
			blk_set_rl_full(rl, BLK_RW_SYNC);
		} else {
			blk_clear_rl_full(rl, BLK_RW_SYNC);
			wake_up(&rl->wait[BLK_RW_SYNC]);
		}

		if (rl->count[BLK_RW_ASYNC] >= q->nr_requests) {
			blk_set_rl_full(rl, BLK_RW_ASYNC);
		} else {
			blk_clear_rl_full(rl, BLK_RW_ASYNC);
			wake_up(&rl->wait[BLK_RW_ASYNC]);
		}
	}

	spin_unlock_irq(q->queue_lock);
	return ret;
}
开发者ID:1ee7,项目名称:linux_l4t_tx1,代码行数:53,代码来源:blk-sysfs.c


示例5: queue_iostats_store

static ssize_t queue_iostats_store(struct request_queue *q, const char *page,
				   size_t count)
{
	unsigned long stats;
	ssize_t ret = queue_var_store(&stats, page, count);

	spin_lock_irq(q->queue_lock);
	if (stats)
		queue_flag_set(QUEUE_FLAG_IO_STAT, q);
	else
		queue_flag_clear(QUEUE_FLAG_IO_STAT, q);
	spin_unlock_irq(q->queue_lock);

	return ret;
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:15,代码来源:blk-sysfs.c


示例6: queue_nomerges_store

static ssize_t queue_nomerges_store(struct request_queue *q, const char *page,
				    size_t count)
{
	unsigned long nm;
	ssize_t ret = queue_var_store(&nm, page, count);

	spin_lock_irq(q->queue_lock);
	if (nm)
		queue_flag_set(QUEUE_FLAG_NOMERGES, q);
	else
		queue_flag_clear(QUEUE_FLAG_NOMERGES, q);
	spin_unlock_irq(q->queue_lock);

	return ret;
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:15,代码来源:blk-sysfs.c


示例7: queue_random_store

static ssize_t queue_random_store(struct request_queue *q, const char *page,
				  size_t count)
{
	unsigned long val;
	ssize_t ret = queue_var_store(&val, page, count);

	spin_lock_irq(q->queue_lock);
	if (val)
		queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q);
	else
		queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q);
	spin_unlock_irq(q->queue_lock);

	return ret;
}
开发者ID:710leo,项目名称:LVS,代码行数:15,代码来源:blk-sysfs.c


示例8: queue_max_sectors_store

static ssize_t
queue_max_sectors_store(struct request_queue *q, const char *page, size_t count)
{
	unsigned long max_sectors_kb,
		max_hw_sectors_kb = queue_max_hw_sectors(q) >> 1,
			page_kb = 1 << (PAGE_CACHE_SHIFT - 10);
	ssize_t ret = queue_var_store(&max_sectors_kb, page, count);

	if (max_sectors_kb > max_hw_sectors_kb || max_sectors_kb < page_kb)
		return -EINVAL;

	spin_lock_irq(q->queue_lock);
	q->limits.max_sectors = max_sectors_kb << 1;
	spin_unlock_irq(q->queue_lock);

	return ret;
}
开发者ID:AndroidDeveloperAlliance,项目名称:ZenKernel_Grouper,代码行数:17,代码来源:blk-sysfs.c


示例9: queue_rq_affinity_store

static ssize_t
queue_rq_affinity_store(struct request_queue *q, const char *page, size_t count)
{
	ssize_t ret = -EINVAL;
#if defined(CONFIG_USE_GENERIC_SMP_HELPERS)
	unsigned long val;

	ret = queue_var_store(&val, page, count);
	spin_lock_irq(q->queue_lock);
	if (val)
		queue_flag_set(QUEUE_FLAG_SAME_COMP, q);
	else
		queue_flag_clear(QUEUE_FLAG_SAME_COMP,  q);
	spin_unlock_irq(q->queue_lock);
#endif
	return ret;
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:17,代码来源:blk-sysfs.c


示例10: queue_store_unpriv_sgio

static ssize_t
queue_store_unpriv_sgio(struct request_queue *q, const char *page, size_t count)
{
	unsigned long val;
	ssize_t ret;

	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;

	ret = queue_var_store(&val, page, count);
	spin_lock_irq(q->queue_lock);
	if (val)
		queue_flag_set(QUEUE_FLAG_UNPRIV_SGIO, q);
	else
		queue_flag_clear(QUEUE_FLAG_UNPRIV_SGIO, q);
	spin_unlock_irq(q->queue_lock);
	return ret;
}
开发者ID:swrite,项目名称:ali_kernel,代码行数:18,代码来源:blk-sysfs.c


示例11: queue_requests_store

static ssize_t
queue_requests_store(struct request_queue *q, const char *page, size_t count)
{
	struct request_list *rl = &q->rq;
	unsigned long nr;
	int ret;

	if (!q->request_fn)
		return -EINVAL;

	ret = queue_var_store(&nr, page, count);
	if (nr < BLKDEV_MIN_RQ)
		nr = BLKDEV_MIN_RQ;

	spin_lock_irq(q->queue_lock);
	q->nr_requests = nr;
	blk_queue_congestion_threshold(q);

	if (rl->count[BLK_RW_SYNC] >= queue_congestion_on_threshold(q))
		blk_set_queue_congested(q, BLK_RW_SYNC);
	else if (rl->count[BLK_RW_SYNC] < queue_congestion_off_threshold(q))
		blk_clear_queue_congested(q, BLK_RW_SYNC);

	if (rl->count[BLK_RW_ASYNC] >= queue_congestion_on_threshold(q))
		blk_set_queue_congested(q, BLK_RW_ASYNC);
	else if (rl->count[BLK_RW_ASYNC] < queue_congestion_off_threshold(q))
		blk_clear_queue_congested(q, BLK_RW_ASYNC);

	if (rl->count[BLK_RW_SYNC] >= q->nr_requests) {
		blk_set_queue_full(q, BLK_RW_SYNC);
	} else {
		blk_clear_queue_full(q, BLK_RW_SYNC);
		wake_up(&rl->wait[BLK_RW_SYNC]);
	}

	if (rl->count[BLK_RW_ASYNC] >= q->nr_requests) {
		blk_set_queue_full(q, BLK_RW_ASYNC);
	} else {
		blk_clear_queue_full(q, BLK_RW_ASYNC);
		wake_up(&rl->wait[BLK_RW_ASYNC]);
	}
	spin_unlock_irq(q->queue_lock);
	return ret;
}
开发者ID:AndroidDeveloperAlliance,项目名称:ZenKernel_Grouper,代码行数:44,代码来源:blk-sysfs.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ queue_work函数代码示例发布时间:2022-05-30
下一篇:
C++ queue_var_show函数代码示例发布时间: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