cregit-Linux how code gets into the kernel

Release 4.7 block/noop-iosched.c

Directory: block
/*
 * elevator noop
 */
#include <linux/blkdev.h>
#include <linux/elevator.h>
#include <linux/bio.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>


struct noop_data {
	
struct list_head queue;
};


static void noop_merged_requests(struct request_queue *q, struct request *rq, struct request *next) { list_del_init(&next->queuelist); }

Contributors

PersonTokensPropCommitsCommitProp
tejun heotejun heo1758.62%125.00%
andrew mortonandrew morton931.03%125.00%
jens axboejens axboe26.90%125.00%
pekka j enbergpekka j enberg13.45%125.00%
Total29100.00%4100.00%


static int noop_dispatch(struct request_queue *q, int force) { struct noop_data *nd = q->elevator->elevator_data; struct request *rq; rq = list_first_entry_or_null(&nd->queue, struct request, queuelist); if (rq) { list_del_init(&rq->queuelist); elv_dispatch_sort(q, rq); return 1; } return 0; }

Contributors

PersonTokensPropCommitsCommitProp
tejun heotejun heo5272.22%112.50%
jens axboejens axboe1013.89%562.50%
geliang tanggeliang tang79.72%112.50%
andrew mortonandrew morton34.17%112.50%
Total72100.00%8100.00%


static void noop_add_request(struct request_queue *q, struct request *rq) { struct noop_data *nd = q->elevator->elevator_data; list_add_tail(&rq->queuelist, &nd->queue); }

Contributors

PersonTokensPropCommitsCommitProp
tejun heotejun heo3792.50%133.33%
jens axboejens axboe25.00%133.33%
andrew mortonandrew morton12.50%133.33%
Total40100.00%3100.00%


static struct request * noop_former_request(struct request_queue *q, struct request *rq) { struct noop_data *nd = q->elevator->elevator_data; if (rq->queuelist.prev == &nd->queue) return NULL; return list_prev_entry(rq, queuelist); }

Contributors

PersonTokensPropCommitsCommitProp
tejun heotejun heo5094.34%133.33%
jens axboejens axboe23.77%133.33%
geliang tanggeliang tang11.89%133.33%
Total53100.00%3100.00%


static struct request * noop_latter_request(struct request_queue *q, struct request *rq) { struct noop_data *nd = q->elevator->elevator_data; if (rq->queuelist.next == &nd->queue) return NULL; return list_next_entry(rq, queuelist); }

Contributors

PersonTokensPropCommitsCommitProp
tejun heotejun heo4686.79%120.00%
jens axboejens axboe35.66%240.00%
andrew mortonandrew morton35.66%120.00%
geliang tanggeliang tang11.89%120.00%
Total53100.00%5100.00%


static int noop_init_queue(struct request_queue *q, struct elevator_type *e) { struct noop_data *nd; struct elevator_queue *eq; eq = elevator_alloc(q, e); if (!eq) return -ENOMEM; nd = kmalloc_node(sizeof(*nd), GFP_KERNEL, q->node); if (!nd) { kobject_put(&eq->kobj); return -ENOMEM; } eq->elevator_data = nd; INIT_LIST_HEAD(&nd->queue); spin_lock_irq(q->queue_lock); q->elevator = eq; spin_unlock_irq(q->queue_lock); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
ma jianpengma jianpeng5950.43%116.67%
tejun heotejun heo4740.17%233.33%
jens axboejens axboe75.98%233.33%
andrew mortonandrew morton43.42%116.67%
Total117100.00%6100.00%


static void noop_exit_queue(struct elevator_queue *e) { struct noop_data *nd = e->elevator_data; BUG_ON(!list_empty(&nd->queue)); kfree(nd); }

Contributors

PersonTokensPropCommitsCommitProp
tejun heotejun heo3594.59%150.00%
jens axboejens axboe25.41%150.00%
Total37100.00%2100.00%

static struct elevator_type elevator_noop = { .ops = { .elevator_merge_req_fn = noop_merged_requests, .elevator_dispatch_fn = noop_dispatch, .elevator_add_req_fn = noop_add_request, .elevator_former_req_fn = noop_former_request, .elevator_latter_req_fn = noop_latter_request, .elevator_init_fn = noop_init_queue, .elevator_exit_fn = noop_exit_queue, }, .elevator_name = "noop", .elevator_owner = THIS_MODULE, };
static int __init noop_init(void) { return elv_register(&elevator_noop); }

Contributors

PersonTokensPropCommitsCommitProp
jens axboejens axboe1381.25%133.33%
pekka j enbergpekka j enberg212.50%133.33%
tejun heotejun heo16.25%133.33%
Total16100.00%3100.00%


static void __exit noop_exit(void) { elv_unregister(&elevator_noop); }

Contributors

PersonTokensPropCommitsCommitProp
jens axboejens axboe960.00%133.33%
andrew mortonandrew morton426.67%133.33%
pekka j enbergpekka j enberg213.33%133.33%
Total15100.00%3100.00%

module_init(noop_init); module_exit(noop_exit); MODULE_AUTHOR("Jens Axboe"); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("No-op IO scheduler");

Overall Contributors

PersonTokensPropCommitsCommitProp
tejun heotejun heo32459.78%425.00%
jens axboejens axboe8916.42%850.00%
ma jianpengma jianpeng5910.89%16.25%
andrew mortonandrew morton5610.33%16.25%
geliang tanggeliang tang91.66%16.25%
pekka j enbergpekka j enberg50.92%16.25%
Total542100.00%16100.00%
Directory: block
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}