diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-07-14 15:40:00 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-01-30 02:05:30 -0500 |
commit | 3ff7576ddac06c3d07089e241b40826d24bbf1ac (patch) | |
tree | 7f5998434b7d0dd1f08ff7ee65c93fab4861a6d3 /fs | |
parent | c970aa85e71bd581726c42df843f6f129db275ac (diff) |
SUNRPC: Clean up the initialisation of priority queue scheduling info.
We want the default scheduling priority (priority == 0) to remain
RPC_PRIORITY_NORMAL.
Also ensure that the priority wait queue scheduling is per process id
instead of sometimes being per thread, and sometimes being per inode.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/direct.c | 10 | ||||
-rw-r--r-- | fs/nfs/read.c | 2 | ||||
-rw-r--r-- | fs/nfs/write.c | 12 |
3 files changed, 5 insertions, 19 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index f9f5fc13dc7d..5bcc764e501a 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -331,8 +331,6 @@ static ssize_t nfs_direct_read_schedule_segment(struct nfs_direct_req *dreq, | |||
331 | rpc_init_task(&data->task, &task_setup_data); | 331 | rpc_init_task(&data->task, &task_setup_data); |
332 | NFS_PROTO(inode)->read_setup(data); | 332 | NFS_PROTO(inode)->read_setup(data); |
333 | 333 | ||
334 | data->task.tk_cookie = (unsigned long) inode; | ||
335 | |||
336 | rpc_execute(&data->task); | 334 | rpc_execute(&data->task); |
337 | 335 | ||
338 | dprintk("NFS: %5u initiated direct read call " | 336 | dprintk("NFS: %5u initiated direct read call " |
@@ -465,9 +463,6 @@ static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq) | |||
465 | rpc_init_task(&data->task, &task_setup_data); | 463 | rpc_init_task(&data->task, &task_setup_data); |
466 | NFS_PROTO(inode)->write_setup(data, FLUSH_STABLE); | 464 | NFS_PROTO(inode)->write_setup(data, FLUSH_STABLE); |
467 | 465 | ||
468 | data->task.tk_priority = RPC_PRIORITY_NORMAL; | ||
469 | data->task.tk_cookie = (unsigned long) inode; | ||
470 | |||
471 | /* | 466 | /* |
472 | * We're called via an RPC callback, so BKL is already held. | 467 | * We're called via an RPC callback, so BKL is already held. |
473 | */ | 468 | */ |
@@ -534,8 +529,6 @@ static void nfs_direct_commit_schedule(struct nfs_direct_req *dreq) | |||
534 | rpc_init_task(&data->task, &task_setup_data); | 529 | rpc_init_task(&data->task, &task_setup_data); |
535 | NFS_PROTO(data->inode)->commit_setup(data, 0); | 530 | NFS_PROTO(data->inode)->commit_setup(data, 0); |
536 | 531 | ||
537 | data->task.tk_priority = RPC_PRIORITY_NORMAL; | ||
538 | data->task.tk_cookie = (unsigned long)data->inode; | ||
539 | /* Note: task.tk_ops->rpc_release will free dreq->commit_data */ | 532 | /* Note: task.tk_ops->rpc_release will free dreq->commit_data */ |
540 | dreq->commit_data = NULL; | 533 | dreq->commit_data = NULL; |
541 | 534 | ||
@@ -718,9 +711,6 @@ static ssize_t nfs_direct_write_schedule_segment(struct nfs_direct_req *dreq, | |||
718 | rpc_init_task(&data->task, &task_setup_data); | 711 | rpc_init_task(&data->task, &task_setup_data); |
719 | NFS_PROTO(inode)->write_setup(data, sync); | 712 | NFS_PROTO(inode)->write_setup(data, sync); |
720 | 713 | ||
721 | data->task.tk_priority = RPC_PRIORITY_NORMAL; | ||
722 | data->task.tk_cookie = (unsigned long) inode; | ||
723 | |||
724 | rpc_execute(&data->task); | 714 | rpc_execute(&data->task); |
725 | 715 | ||
726 | dprintk("NFS: %5u initiated direct write call " | 716 | dprintk("NFS: %5u initiated direct write call " |
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index c7f0d5ebd451..8f1eb08ccffa 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -189,8 +189,6 @@ static void nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data, | |||
189 | rpc_init_task(&data->task, &task_setup_data); | 189 | rpc_init_task(&data->task, &task_setup_data); |
190 | NFS_PROTO(inode)->read_setup(data); | 190 | NFS_PROTO(inode)->read_setup(data); |
191 | 191 | ||
192 | data->task.tk_cookie = (unsigned long)inode; | ||
193 | |||
194 | dprintk("NFS: %5u initiated read call (req %s/%Ld, %u bytes @ offset %Lu)\n", | 192 | dprintk("NFS: %5u initiated read call (req %s/%Ld, %u bytes @ offset %Lu)\n", |
195 | data->task.tk_pid, | 193 | data->task.tk_pid, |
196 | inode->i_sb->s_id, | 194 | inode->i_sb->s_id, |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index c4376606f106..8d90e90ccd47 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -753,7 +753,7 @@ static void nfs_writepage_release(struct nfs_page *req) | |||
753 | nfs_clear_page_tag_locked(req); | 753 | nfs_clear_page_tag_locked(req); |
754 | } | 754 | } |
755 | 755 | ||
756 | static inline int flush_task_priority(int how) | 756 | static int flush_task_priority(int how) |
757 | { | 757 | { |
758 | switch (how & (FLUSH_HIGHPRI|FLUSH_LOWPRI)) { | 758 | switch (how & (FLUSH_HIGHPRI|FLUSH_LOWPRI)) { |
759 | case FLUSH_HIGHPRI: | 759 | case FLUSH_HIGHPRI: |
@@ -775,11 +775,13 @@ static void nfs_write_rpcsetup(struct nfs_page *req, | |||
775 | { | 775 | { |
776 | struct inode *inode = req->wb_context->path.dentry->d_inode; | 776 | struct inode *inode = req->wb_context->path.dentry->d_inode; |
777 | int flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC; | 777 | int flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC; |
778 | int priority = flush_task_priority(how); | ||
778 | struct rpc_task_setup task_setup_data = { | 779 | struct rpc_task_setup task_setup_data = { |
779 | .rpc_client = NFS_CLIENT(inode), | 780 | .rpc_client = NFS_CLIENT(inode), |
780 | .callback_ops = call_ops, | 781 | .callback_ops = call_ops, |
781 | .callback_data = data, | 782 | .callback_data = data, |
782 | .flags = flags, | 783 | .flags = flags, |
784 | .priority = priority, | ||
783 | }; | 785 | }; |
784 | 786 | ||
785 | /* Set up the RPC argument and reply structs | 787 | /* Set up the RPC argument and reply structs |
@@ -805,9 +807,6 @@ static void nfs_write_rpcsetup(struct nfs_page *req, | |||
805 | rpc_init_task(&data->task, &task_setup_data); | 807 | rpc_init_task(&data->task, &task_setup_data); |
806 | NFS_PROTO(inode)->write_setup(data, how); | 808 | NFS_PROTO(inode)->write_setup(data, how); |
807 | 809 | ||
808 | data->task.tk_priority = flush_task_priority(how); | ||
809 | data->task.tk_cookie = (unsigned long)inode; | ||
810 | |||
811 | dprintk("NFS: %5u initiated write call " | 810 | dprintk("NFS: %5u initiated write call " |
812 | "(req %s/%Ld, %u bytes @ offset %Lu)\n", | 811 | "(req %s/%Ld, %u bytes @ offset %Lu)\n", |
813 | data->task.tk_pid, | 812 | data->task.tk_pid, |
@@ -1152,11 +1151,13 @@ static void nfs_commit_rpcsetup(struct list_head *head, | |||
1152 | struct nfs_page *first = nfs_list_entry(head->next); | 1151 | struct nfs_page *first = nfs_list_entry(head->next); |
1153 | struct inode *inode = first->wb_context->path.dentry->d_inode; | 1152 | struct inode *inode = first->wb_context->path.dentry->d_inode; |
1154 | int flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC; | 1153 | int flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC; |
1154 | int priority = flush_task_priority(how); | ||
1155 | struct rpc_task_setup task_setup_data = { | 1155 | struct rpc_task_setup task_setup_data = { |
1156 | .rpc_client = NFS_CLIENT(inode), | 1156 | .rpc_client = NFS_CLIENT(inode), |
1157 | .callback_ops = &nfs_commit_ops, | 1157 | .callback_ops = &nfs_commit_ops, |
1158 | .callback_data = data, | 1158 | .callback_data = data, |
1159 | .flags = flags, | 1159 | .flags = flags, |
1160 | .priority = priority, | ||
1160 | }; | 1161 | }; |
1161 | 1162 | ||
1162 | /* Set up the RPC argument and reply structs | 1163 | /* Set up the RPC argument and reply structs |
@@ -1180,9 +1181,6 @@ static void nfs_commit_rpcsetup(struct list_head *head, | |||
1180 | rpc_init_task(&data->task, &task_setup_data); | 1181 | rpc_init_task(&data->task, &task_setup_data); |
1181 | NFS_PROTO(inode)->commit_setup(data, how); | 1182 | NFS_PROTO(inode)->commit_setup(data, how); |
1182 | 1183 | ||
1183 | data->task.tk_priority = flush_task_priority(how); | ||
1184 | data->task.tk_cookie = (unsigned long)inode; | ||
1185 | |||
1186 | dprintk("NFS: %5u initiated commit call\n", data->task.tk_pid); | 1184 | dprintk("NFS: %5u initiated commit call\n", data->task.tk_pid); |
1187 | } | 1185 | } |
1188 | 1186 | ||