本文整理汇总了C++中DD_ATTR函数的典型用法代码示例。如果您正苦于以下问题:C++ DD_ATTR函数的具体用法?C++ DD_ATTR怎么用?C++ DD_ATTR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DD_ATTR函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: STORE_FUNCTION
*(__PTR) = msecs_to_jiffies(__data); \
else \
*(__PTR) = __data; \
return ret; \
}
STORE_FUNCTION(sio_sync_expire_store, &sd->fifo_expire[SYNC], 0, INT_MAX, 1);
STORE_FUNCTION(sio_async_expire_store, &sd->fifo_expire[ASYNC], 0, INT_MAX, 1);
STORE_FUNCTION(sio_fifo_batch_store, &sd->fifo_batch, 0, INT_MAX, 0);
#undef STORE_FUNCTION
#define DD_ATTR(name) \
__ATTR(name, S_IRUGO|S_IWUSR, sio_##name##_show, \
sio_##name##_store)
static struct elv_fs_entry sio_attrs[] = {
DD_ATTR(sync_expire),
DD_ATTR(async_expire),
DD_ATTR(fifo_batch),
__ATTR_NULL
};
static struct elevator_type iosched_sio = {
.ops = {
.elevator_merge_req_fn = sio_merged_requests,
.elevator_dispatch_fn = sio_dispatch_requests,
.elevator_add_req_fn = sio_add_request,
.elevator_queue_empty_fn = sio_queue_empty,
.elevator_former_req_fn = sio_former_request,
.elevator_latter_req_fn = sio_latter_request,
.elevator_init_fn = sio_init_queue,
.elevator_exit_fn = sio_exit_queue,
示例2: STORE_FUNCTION
return ret; \
}
STORE_FUNCTION(sio_sync_read_expire_store, &sd->fifo_expire[SYNC][READ], 0, INT_MAX, 1);
STORE_FUNCTION(sio_sync_write_expire_store, &sd->fifo_expire[SYNC][WRITE], 0, INT_MAX, 1);
STORE_FUNCTION(sio_async_read_expire_store, &sd->fifo_expire[ASYNC][READ], 0, INT_MAX, 1);
STORE_FUNCTION(sio_async_write_expire_store, &sd->fifo_expire[ASYNC][WRITE], 0, INT_MAX, 1);
STORE_FUNCTION(sio_fifo_batch_store, &sd->fifo_batch, 0, INT_MAX, 0);
STORE_FUNCTION(sio_writes_starved_store, &sd->writes_starved, 0, INT_MAX, 0);
#undef STORE_FUNCTION
#define DD_ATTR(name) \
__ATTR(name, S_IRUGO|S_IWUSR, sio_##name##_show, \
sio_##name##_store)
static struct elv_fs_entry sio_attrs[] = {
DD_ATTR(sync_read_expire),
DD_ATTR(sync_write_expire),
DD_ATTR(async_read_expire),
DD_ATTR(async_write_expire),
DD_ATTR(fifo_batch),
DD_ATTR(writes_starved),
__ATTR_NULL
};
static struct elevator_type iosched_sio = {
.ops = {
.elevator_merge_req_fn = sio_merged_requests,
.elevator_dispatch_fn = sio_dispatch_requests,
.elevator_add_req_fn = sio_add_request,
.elevator_queue_empty_fn = sio_queue_empty,
.elevator_former_req_fn = sio_former_request,