aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-03-23 14:40:53 -0400
committerJeff Layton <jlayton@redhat.com>2012-03-23 14:40:53 -0400
commitda472fc847e9d8c9da69b09ce0ab975b24f9b894 (patch)
treef5b2c4e187aa39e011c758f8e94d2d2b3d296384 /fs
parent7c9421e1a9ce8d17816f480c3a5b4f2609442cd5 (diff)
cifs: add new cifsiod_wq workqueue
...and convert existing cifs users of system_nrt_wq to use that instead. Also, make it freezable, and set WQ_MEM_RECLAIM since we use it to deal with write reply handling. Signed-off-by: Jeff Layton <jlayton@redhat.com> Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/cifsfs.c13
-rw-r--r--fs/cifs/cifsglob.h1
-rw-r--r--fs/cifs/cifssmb.c4
-rw-r--r--fs/cifs/connect.c8
-rw-r--r--fs/cifs/misc.c2
5 files changed, 20 insertions, 8 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index eee522c56ef..d3421282244 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -85,6 +85,8 @@ extern mempool_t *cifs_sm_req_poolp;
85extern mempool_t *cifs_req_poolp; 85extern mempool_t *cifs_req_poolp;
86extern mempool_t *cifs_mid_poolp; 86extern mempool_t *cifs_mid_poolp;
87 87
88struct workqueue_struct *cifsiod_wq;
89
88static int 90static int
89cifs_read_super(struct super_block *sb) 91cifs_read_super(struct super_block *sb)
90{ 92{
@@ -1111,9 +1113,15 @@ init_cifs(void)
1111 cFYI(1, "cifs_max_pending set to max of %u", CIFS_MAX_REQ); 1113 cFYI(1, "cifs_max_pending set to max of %u", CIFS_MAX_REQ);
1112 } 1114 }
1113 1115
1116 cifsiod_wq = alloc_workqueue("cifsiod", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0);
1117 if (!cifsiod_wq) {
1118 rc = -ENOMEM;
1119 goto out_clean_proc;
1120 }
1121
1114 rc = cifs_fscache_register(); 1122 rc = cifs_fscache_register();
1115 if (rc) 1123 if (rc)
1116 goto out_clean_proc; 1124 goto out_destroy_wq;
1117 1125
1118 rc = cifs_init_inodecache(); 1126 rc = cifs_init_inodecache();
1119 if (rc) 1127 if (rc)
@@ -1161,6 +1169,8 @@ out_destroy_inodecache:
1161 cifs_destroy_inodecache(); 1169 cifs_destroy_inodecache();
1162out_unreg_fscache: 1170out_unreg_fscache:
1163 cifs_fscache_unregister(); 1171 cifs_fscache_unregister();
1172out_destroy_wq:
1173 destroy_workqueue(cifsiod_wq);
1164out_clean_proc: 1174out_clean_proc:
1165 cifs_proc_clean(); 1175 cifs_proc_clean();
1166 return rc; 1176 return rc;
@@ -1183,6 +1193,7 @@ exit_cifs(void)
1183 cifs_destroy_mids(); 1193 cifs_destroy_mids();
1184 cifs_destroy_inodecache(); 1194 cifs_destroy_inodecache();
1185 cifs_fscache_unregister(); 1195 cifs_fscache_unregister();
1196 destroy_workqueue(cifsiod_wq);
1186 cifs_proc_clean(); 1197 cifs_proc_clean();
1187} 1198}
1188 1199
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index d5ccd467a1d..79eba5a15e8 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -1070,5 +1070,6 @@ GLOBAL_EXTERN spinlock_t gidsidlock;
1070void cifs_oplock_break(struct work_struct *work); 1070void cifs_oplock_break(struct work_struct *work);
1071 1071
1072extern const struct slow_work_ops cifs_oplock_break_ops; 1072extern const struct slow_work_ops cifs_oplock_break_ops;
1073extern struct workqueue_struct *cifsiod_wq;
1073 1074
1074#endif /* _CIFS_GLOB_H */ 1075#endif /* _CIFS_GLOB_H */
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index f0b1c59a3bb..76d8981736e 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1689,7 +1689,7 @@ cifs_readv_callback(struct mid_q_entry *mid)
1689 rdata->result = -EIO; 1689 rdata->result = -EIO;
1690 } 1690 }
1691 1691
1692 queue_work(system_nrt_wq, &rdata->work); 1692 queue_work(cifsiod_wq, &rdata->work);
1693 DeleteMidQEntry(mid); 1693 DeleteMidQEntry(mid);
1694 cifs_add_credits(server, 1); 1694 cifs_add_credits(server, 1);
1695} 1695}
@@ -2129,7 +2129,7 @@ cifs_writev_callback(struct mid_q_entry *mid)
2129 break; 2129 break;
2130 } 2130 }
2131 2131
2132 queue_work(system_nrt_wq, &wdata->work); 2132 queue_work(cifsiod_wq, &wdata->work);
2133 DeleteMidQEntry(mid); 2133 DeleteMidQEntry(mid);
2134 cifs_add_credits(tcon->ses->server, 1); 2134 cifs_add_credits(tcon->ses->server, 1);
2135} 2135}
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index f3c932910b6..855d8c08e3a 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -335,7 +335,7 @@ cifs_echo_request(struct work_struct *work)
335 server->hostname); 335 server->hostname);
336 336
337requeue_echo: 337requeue_echo:
338 queue_delayed_work(system_nrt_wq, &server->echo, SMB_ECHO_INTERVAL); 338 queue_delayed_work(cifsiod_wq, &server->echo, SMB_ECHO_INTERVAL);
339} 339}
340 340
341static bool 341static bool
@@ -1971,7 +1971,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
1971 cifs_fscache_get_client_cookie(tcp_ses); 1971 cifs_fscache_get_client_cookie(tcp_ses);
1972 1972
1973 /* queue echo request delayed work */ 1973 /* queue echo request delayed work */
1974 queue_delayed_work(system_nrt_wq, &tcp_ses->echo, SMB_ECHO_INTERVAL); 1974 queue_delayed_work(cifsiod_wq, &tcp_ses->echo, SMB_ECHO_INTERVAL);
1975 1975
1976 return tcp_ses; 1976 return tcp_ses;
1977 1977
@@ -3537,7 +3537,7 @@ remote_path_check:
3537 tlink_rb_insert(&cifs_sb->tlink_tree, tlink); 3537 tlink_rb_insert(&cifs_sb->tlink_tree, tlink);
3538 spin_unlock(&cifs_sb->tlink_tree_lock); 3538 spin_unlock(&cifs_sb->tlink_tree_lock);
3539 3539
3540 queue_delayed_work(system_nrt_wq, &cifs_sb->prune_tlinks, 3540 queue_delayed_work(cifsiod_wq, &cifs_sb->prune_tlinks,
3541 TLINK_IDLE_EXPIRE); 3541 TLINK_IDLE_EXPIRE);
3542 3542
3543mount_fail_check: 3543mount_fail_check:
@@ -4091,6 +4091,6 @@ cifs_prune_tlinks(struct work_struct *work)
4091 } 4091 }
4092 spin_unlock(&cifs_sb->tlink_tree_lock); 4092 spin_unlock(&cifs_sb->tlink_tree_lock);
4093 4093
4094 queue_delayed_work(system_nrt_wq, &cifs_sb->prune_tlinks, 4094 queue_delayed_work(cifsiod_wq, &cifs_sb->prune_tlinks,
4095 TLINK_IDLE_EXPIRE); 4095 TLINK_IDLE_EXPIRE);
4096} 4096}
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 425e4f2a155..c29d1aa2c54 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -595,7 +595,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
595 595
596 cifs_set_oplock_level(pCifsInode, 596 cifs_set_oplock_level(pCifsInode,
597 pSMB->OplockLevel ? OPLOCK_READ : 0); 597 pSMB->OplockLevel ? OPLOCK_READ : 0);
598 queue_work(system_nrt_wq, 598 queue_work(cifsiod_wq,
599 &netfile->oplock_break); 599 &netfile->oplock_break);
600 netfile->oplock_break_cancelled = false; 600 netfile->oplock_break_cancelled = false;
601 601