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/nfs/write.c | |
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/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 12 |
1 files changed, 5 insertions, 7 deletions
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 | ||