aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/alloc.c9
-rw-r--r--fs/ocfs2/cluster/heartbeat.c10
-rw-r--r--fs/ocfs2/cluster/quorum.c4
-rw-r--r--fs/ocfs2/cluster/tcp.c78
-rw-r--r--fs/ocfs2/cluster/tcp_internal.h8
-rw-r--r--fs/ocfs2/dlm/dlmcommon.h2
-rw-r--r--fs/ocfs2/dlm/dlmdomain.c2
-rw-r--r--fs/ocfs2/dlm/dlmrecovery.c5
-rw-r--r--fs/ocfs2/dlm/userdlm.c10
-rw-r--r--fs/ocfs2/journal.c7
-rw-r--r--fs/ocfs2/journal.h2
-rw-r--r--fs/ocfs2/ocfs2.h2
-rw-r--r--fs/ocfs2/super.c2
13 files changed, 79 insertions, 62 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index f43bc5f18a35..0b2ad163005e 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -1205,10 +1205,12 @@ int ocfs2_flush_truncate_log(struct ocfs2_super *osb)
1205 return status; 1205 return status;
1206} 1206}
1207 1207
1208static void ocfs2_truncate_log_worker(void *data) 1208static void ocfs2_truncate_log_worker(struct work_struct *work)
1209{ 1209{
1210 int status; 1210 int status;
1211 struct ocfs2_super *osb = data; 1211 struct ocfs2_super *osb =
1212 container_of(work, struct ocfs2_super,
1213 osb_truncate_log_wq.work);
1212 1214
1213 mlog_entry_void(); 1215 mlog_entry_void();
1214 1216
@@ -1441,7 +1443,8 @@ int ocfs2_truncate_log_init(struct ocfs2_super *osb)
1441 /* ocfs2_truncate_log_shutdown keys on the existence of 1443 /* ocfs2_truncate_log_shutdown keys on the existence of
1442 * osb->osb_tl_inode so we don't set any of the osb variables 1444 * osb->osb_tl_inode so we don't set any of the osb variables
1443 * until we're sure all is well. */ 1445 * until we're sure all is well. */
1444 INIT_WORK(&osb->osb_truncate_log_wq, ocfs2_truncate_log_worker, osb); 1446 INIT_DELAYED_WORK(&osb->osb_truncate_log_wq,
1447 ocfs2_truncate_log_worker);
1445 osb->osb_tl_bh = tl_bh; 1448 osb->osb_tl_bh = tl_bh;
1446 osb->osb_tl_inode = tl_inode; 1449 osb->osb_tl_inode = tl_inode;
1447 1450
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index 305cba3681fe..4cd9a9580456 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -141,7 +141,7 @@ struct o2hb_region {
141 * recognizes a node going up and down in one iteration */ 141 * recognizes a node going up and down in one iteration */
142 u64 hr_generation; 142 u64 hr_generation;
143 143
144 struct work_struct hr_write_timeout_work; 144 struct delayed_work hr_write_timeout_work;
145 unsigned long hr_last_timeout_start; 145 unsigned long hr_last_timeout_start;
146 146
147 /* Used during o2hb_check_slot to hold a copy of the block 147 /* Used during o2hb_check_slot to hold a copy of the block
@@ -156,9 +156,11 @@ struct o2hb_bio_wait_ctxt {
156 int wc_error; 156 int wc_error;
157}; 157};
158 158
159static void o2hb_write_timeout(void *arg) 159static void o2hb_write_timeout(struct work_struct *work)
160{ 160{
161 struct o2hb_region *reg = arg; 161 struct o2hb_region *reg =
162 container_of(work, struct o2hb_region,
163 hr_write_timeout_work.work);
162 164
163 mlog(ML_ERROR, "Heartbeat write timeout to device %s after %u " 165 mlog(ML_ERROR, "Heartbeat write timeout to device %s after %u "
164 "milliseconds\n", reg->hr_dev_name, 166 "milliseconds\n", reg->hr_dev_name,
@@ -1404,7 +1406,7 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg,
1404 goto out; 1406 goto out;
1405 } 1407 }
1406 1408
1407 INIT_WORK(&reg->hr_write_timeout_work, o2hb_write_timeout, reg); 1409 INIT_DELAYED_WORK(&reg->hr_write_timeout_work, o2hb_write_timeout);
1408 1410
1409 /* 1411 /*
1410 * A node is considered live after it has beat LIVE_THRESHOLD 1412 * A node is considered live after it has beat LIVE_THRESHOLD
diff --git a/fs/ocfs2/cluster/quorum.c b/fs/ocfs2/cluster/quorum.c
index 7bba98fbfc15..4705d659fe57 100644
--- a/fs/ocfs2/cluster/quorum.c
+++ b/fs/ocfs2/cluster/quorum.c
@@ -88,7 +88,7 @@ void o2quo_disk_timeout(void)
88 o2quo_fence_self(); 88 o2quo_fence_self();
89} 89}
90 90
91static void o2quo_make_decision(void *arg) 91static void o2quo_make_decision(struct work_struct *work)
92{ 92{
93 int quorum; 93 int quorum;
94 int lowest_hb, lowest_reachable = 0, fence = 0; 94 int lowest_hb, lowest_reachable = 0, fence = 0;
@@ -306,7 +306,7 @@ void o2quo_init(void)
306 struct o2quo_state *qs = &o2quo_state; 306 struct o2quo_state *qs = &o2quo_state;
307 307
308 spin_lock_init(&qs->qs_lock); 308 spin_lock_init(&qs->qs_lock);
309 INIT_WORK(&qs->qs_work, o2quo_make_decision, NULL); 309 INIT_WORK(&qs->qs_work, o2quo_make_decision);
310} 310}
311 311
312void o2quo_exit(void) 312void o2quo_exit(void)
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index b650efa8c8be..9b3209dc0b16 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -140,11 +140,11 @@ static int o2net_sys_err_translations[O2NET_ERR_MAX] =
140 [O2NET_ERR_DIED] = -EHOSTDOWN,}; 140 [O2NET_ERR_DIED] = -EHOSTDOWN,};
141 141
142/* can't quite avoid *all* internal declarations :/ */ 142/* can't quite avoid *all* internal declarations :/ */
143static void o2net_sc_connect_completed(void *arg); 143static void o2net_sc_connect_completed(struct work_struct *work);
144static void o2net_rx_until_empty(void *arg); 144static void o2net_rx_until_empty(struct work_struct *work);
145static void o2net_shutdown_sc(void *arg); 145static void o2net_shutdown_sc(struct work_struct *work);
146static void o2net_listen_data_ready(struct sock *sk, int bytes); 146static void o2net_listen_data_ready(struct sock *sk, int bytes);
147static void o2net_sc_send_keep_req(void *arg); 147static void o2net_sc_send_keep_req(struct work_struct *work);
148static void o2net_idle_timer(unsigned long data); 148static void o2net_idle_timer(unsigned long data);
149static void o2net_sc_postpone_idle(struct o2net_sock_container *sc); 149static void o2net_sc_postpone_idle(struct o2net_sock_container *sc);
150 150
@@ -308,10 +308,10 @@ static struct o2net_sock_container *sc_alloc(struct o2nm_node *node)
308 o2nm_node_get(node); 308 o2nm_node_get(node);
309 sc->sc_node = node; 309 sc->sc_node = node;
310 310
311 INIT_WORK(&sc->sc_connect_work, o2net_sc_connect_completed, sc); 311 INIT_WORK(&sc->sc_connect_work, o2net_sc_connect_completed);
312 INIT_WORK(&sc->sc_rx_work, o2net_rx_until_empty, sc); 312 INIT_WORK(&sc->sc_rx_work, o2net_rx_until_empty);
313 INIT_WORK(&sc->sc_shutdown_work, o2net_shutdown_sc, sc); 313 INIT_WORK(&sc->sc_shutdown_work, o2net_shutdown_sc);
314 INIT_WORK(&sc->sc_keepalive_work, o2net_sc_send_keep_req, sc); 314 INIT_DELAYED_WORK(&sc->sc_keepalive_work, o2net_sc_send_keep_req);
315 315
316 init_timer(&sc->sc_idle_timeout); 316 init_timer(&sc->sc_idle_timeout);
317 sc->sc_idle_timeout.function = o2net_idle_timer; 317 sc->sc_idle_timeout.function = o2net_idle_timer;
@@ -342,7 +342,7 @@ static void o2net_sc_queue_work(struct o2net_sock_container *sc,
342 sc_put(sc); 342 sc_put(sc);
343} 343}
344static void o2net_sc_queue_delayed_work(struct o2net_sock_container *sc, 344static void o2net_sc_queue_delayed_work(struct o2net_sock_container *sc,
345 struct work_struct *work, 345 struct delayed_work *work,
346 int delay) 346 int delay)
347{ 347{
348 sc_get(sc); 348 sc_get(sc);
@@ -350,7 +350,7 @@ static void o2net_sc_queue_delayed_work(struct o2net_sock_container *sc,
350 sc_put(sc); 350 sc_put(sc);
351} 351}
352static void o2net_sc_cancel_delayed_work(struct o2net_sock_container *sc, 352static void o2net_sc_cancel_delayed_work(struct o2net_sock_container *sc,
353 struct work_struct *work) 353 struct delayed_work *work)
354{ 354{
355 if (cancel_delayed_work(work)) 355 if (cancel_delayed_work(work))
356 sc_put(sc); 356 sc_put(sc);
@@ -564,9 +564,11 @@ static void o2net_ensure_shutdown(struct o2net_node *nn,
564 * ourselves as state_change couldn't get the nn_lock and call set_nn_state 564 * ourselves as state_change couldn't get the nn_lock and call set_nn_state
565 * itself. 565 * itself.
566 */ 566 */
567static void o2net_shutdown_sc(void *arg) 567static void o2net_shutdown_sc(struct work_struct *work)
568{ 568{
569 struct o2net_sock_container *sc = arg; 569 struct o2net_sock_container *sc =
570 container_of(work, struct o2net_sock_container,
571 sc_shutdown_work);
570 struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num); 572 struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num);
571 573
572 sclog(sc, "shutting down\n"); 574 sclog(sc, "shutting down\n");
@@ -1201,9 +1203,10 @@ out:
1201/* this work func is triggerd by data ready. it reads until it can read no 1203/* this work func is triggerd by data ready. it reads until it can read no
1202 * more. it interprets 0, eof, as fatal. if data_ready hits while we're doing 1204 * more. it interprets 0, eof, as fatal. if data_ready hits while we're doing
1203 * our work the work struct will be marked and we'll be called again. */ 1205 * our work the work struct will be marked and we'll be called again. */
1204static void o2net_rx_until_empty(void *arg) 1206static void o2net_rx_until_empty(struct work_struct *work)
1205{ 1207{
1206 struct o2net_sock_container *sc = arg; 1208 struct o2net_sock_container *sc =
1209 container_of(work, struct o2net_sock_container, sc_rx_work);
1207 int ret; 1210 int ret;
1208 1211
1209 do { 1212 do {
@@ -1249,9 +1252,11 @@ static int o2net_set_nodelay(struct socket *sock)
1249 1252
1250/* called when a connect completes and after a sock is accepted. the 1253/* called when a connect completes and after a sock is accepted. the
1251 * rx path will see the response and mark the sc valid */ 1254 * rx path will see the response and mark the sc valid */
1252static void o2net_sc_connect_completed(void *arg) 1255static void o2net_sc_connect_completed(struct work_struct *work)
1253{ 1256{
1254 struct o2net_sock_container *sc = arg; 1257 struct o2net_sock_container *sc =
1258 container_of(work, struct o2net_sock_container,
1259 sc_connect_work);
1255 1260
1256 mlog(ML_MSG, "sc sending handshake with ver %llu id %llx\n", 1261 mlog(ML_MSG, "sc sending handshake with ver %llu id %llx\n",
1257 (unsigned long long)O2NET_PROTOCOL_VERSION, 1262 (unsigned long long)O2NET_PROTOCOL_VERSION,
@@ -1262,9 +1267,11 @@ static void o2net_sc_connect_completed(void *arg)
1262} 1267}
1263 1268
1264/* this is called as a work_struct func. */ 1269/* this is called as a work_struct func. */
1265static void o2net_sc_send_keep_req(void *arg) 1270static void o2net_sc_send_keep_req(struct work_struct *work)
1266{ 1271{
1267 struct o2net_sock_container *sc = arg; 1272 struct o2net_sock_container *sc =
1273 container_of(work, struct o2net_sock_container,
1274 sc_keepalive_work.work);
1268 1275
1269 o2net_sendpage(sc, o2net_keep_req, sizeof(*o2net_keep_req)); 1276 o2net_sendpage(sc, o2net_keep_req, sizeof(*o2net_keep_req));
1270 sc_put(sc); 1277 sc_put(sc);
@@ -1314,14 +1321,15 @@ static void o2net_sc_postpone_idle(struct o2net_sock_container *sc)
1314 * having a connect attempt fail, etc. This centralizes the logic which decides 1321 * having a connect attempt fail, etc. This centralizes the logic which decides
1315 * if a connect attempt should be made or if we should give up and all future 1322 * if a connect attempt should be made or if we should give up and all future
1316 * transmit attempts should fail */ 1323 * transmit attempts should fail */
1317static void o2net_start_connect(void *arg) 1324static void o2net_start_connect(struct work_struct *work)
1318{ 1325{
1319 struct o2net_node *nn = arg; 1326 struct o2net_node *nn =
1327 container_of(work, struct o2net_node, nn_connect_work.work);
1320 struct o2net_sock_container *sc = NULL; 1328 struct o2net_sock_container *sc = NULL;
1321 struct o2nm_node *node = NULL, *mynode = NULL; 1329 struct o2nm_node *node = NULL, *mynode = NULL;
1322 struct socket *sock = NULL; 1330 struct socket *sock = NULL;
1323 struct sockaddr_in myaddr = {0, }, remoteaddr = {0, }; 1331 struct sockaddr_in myaddr = {0, }, remoteaddr = {0, };
1324 int ret = 0; 1332 int ret = 0, stop;
1325 1333
1326 /* if we're greater we initiate tx, otherwise we accept */ 1334 /* if we're greater we initiate tx, otherwise we accept */
1327 if (o2nm_this_node() <= o2net_num_from_nn(nn)) 1335 if (o2nm_this_node() <= o2net_num_from_nn(nn))
@@ -1342,10 +1350,9 @@ static void o2net_start_connect(void *arg)
1342 1350
1343 spin_lock(&nn->nn_lock); 1351 spin_lock(&nn->nn_lock);
1344 /* see if we already have one pending or have given up */ 1352 /* see if we already have one pending or have given up */
1345 if (nn->nn_sc || nn->nn_persistent_error) 1353 stop = (nn->nn_sc || nn->nn_persistent_error);
1346 arg = NULL;
1347 spin_unlock(&nn->nn_lock); 1354 spin_unlock(&nn->nn_lock);
1348 if (arg == NULL) /* *shrug*, needed some indicator */ 1355 if (stop)
1349 goto out; 1356 goto out;
1350 1357
1351 nn->nn_last_connect_attempt = jiffies; 1358 nn->nn_last_connect_attempt = jiffies;
@@ -1421,9 +1428,10 @@ out:
1421 return; 1428 return;
1422} 1429}
1423 1430
1424static void o2net_connect_expired(void *arg) 1431static void o2net_connect_expired(struct work_struct *work)
1425{ 1432{
1426 struct o2net_node *nn = arg; 1433 struct o2net_node *nn =
1434 container_of(work, struct o2net_node, nn_connect_expired.work);
1427 1435
1428 spin_lock(&nn->nn_lock); 1436 spin_lock(&nn->nn_lock);
1429 if (!nn->nn_sc_valid) { 1437 if (!nn->nn_sc_valid) {
@@ -1436,9 +1444,10 @@ static void o2net_connect_expired(void *arg)
1436 spin_unlock(&nn->nn_lock); 1444 spin_unlock(&nn->nn_lock);
1437} 1445}
1438 1446
1439static void o2net_still_up(void *arg) 1447static void o2net_still_up(struct work_struct *work)
1440{ 1448{
1441 struct o2net_node *nn = arg; 1449 struct o2net_node *nn =
1450 container_of(work, struct o2net_node, nn_still_up.work);
1442 1451
1443 o2quo_hb_still_up(o2net_num_from_nn(nn)); 1452 o2quo_hb_still_up(o2net_num_from_nn(nn));
1444} 1453}
@@ -1644,9 +1653,9 @@ out:
1644 return ret; 1653 return ret;
1645} 1654}
1646 1655
1647static void o2net_accept_many(void *arg) 1656static void o2net_accept_many(struct work_struct *work)
1648{ 1657{
1649 struct socket *sock = arg; 1658 struct socket *sock = o2net_listen_sock;
1650 while (o2net_accept_one(sock) == 0) 1659 while (o2net_accept_one(sock) == 0)
1651 cond_resched(); 1660 cond_resched();
1652} 1661}
@@ -1700,7 +1709,7 @@ static int o2net_open_listening_sock(__be16 port)
1700 write_unlock_bh(&sock->sk->sk_callback_lock); 1709 write_unlock_bh(&sock->sk->sk_callback_lock);
1701 1710
1702 o2net_listen_sock = sock; 1711 o2net_listen_sock = sock;
1703 INIT_WORK(&o2net_listen_work, o2net_accept_many, sock); 1712 INIT_WORK(&o2net_listen_work, o2net_accept_many);
1704 1713
1705 sock->sk->sk_reuse = 1; 1714 sock->sk->sk_reuse = 1;
1706 ret = sock->ops->bind(sock, (struct sockaddr *)&sin, sizeof(sin)); 1715 ret = sock->ops->bind(sock, (struct sockaddr *)&sin, sizeof(sin));
@@ -1819,9 +1828,10 @@ int o2net_init(void)
1819 struct o2net_node *nn = o2net_nn_from_num(i); 1828 struct o2net_node *nn = o2net_nn_from_num(i);
1820 1829
1821 spin_lock_init(&nn->nn_lock); 1830 spin_lock_init(&nn->nn_lock);
1822 INIT_WORK(&nn->nn_connect_work, o2net_start_connect, nn); 1831 INIT_DELAYED_WORK(&nn->nn_connect_work, o2net_start_connect);
1823 INIT_WORK(&nn->nn_connect_expired, o2net_connect_expired, nn); 1832 INIT_DELAYED_WORK(&nn->nn_connect_expired,
1824 INIT_WORK(&nn->nn_still_up, o2net_still_up, nn); 1833 o2net_connect_expired);
1834 INIT_DELAYED_WORK(&nn->nn_still_up, o2net_still_up);
1825 /* until we see hb from a node we'll return einval */ 1835 /* until we see hb from a node we'll return einval */
1826 nn->nn_persistent_error = -ENOTCONN; 1836 nn->nn_persistent_error = -ENOTCONN;
1827 init_waitqueue_head(&nn->nn_sc_wq); 1837 init_waitqueue_head(&nn->nn_sc_wq);
diff --git a/fs/ocfs2/cluster/tcp_internal.h b/fs/ocfs2/cluster/tcp_internal.h
index 4b46aac7d243..daebbd3a2c8c 100644
--- a/fs/ocfs2/cluster/tcp_internal.h
+++ b/fs/ocfs2/cluster/tcp_internal.h
@@ -86,18 +86,18 @@ struct o2net_node {
86 * connect attempt fails and so can be self-arming. shutdown is 86 * connect attempt fails and so can be self-arming. shutdown is
87 * careful to first mark the nn such that no connects will be attempted 87 * careful to first mark the nn such that no connects will be attempted
88 * before canceling delayed connect work and flushing the queue. */ 88 * before canceling delayed connect work and flushing the queue. */
89 struct work_struct nn_connect_work; 89 struct delayed_work nn_connect_work;
90 unsigned long nn_last_connect_attempt; 90 unsigned long nn_last_connect_attempt;
91 91
92 /* this is queued as nodes come up and is canceled when a connection is 92 /* this is queued as nodes come up and is canceled when a connection is
93 * established. this expiring gives up on the node and errors out 93 * established. this expiring gives up on the node and errors out
94 * transmits */ 94 * transmits */
95 struct work_struct nn_connect_expired; 95 struct delayed_work nn_connect_expired;
96 96
97 /* after we give up on a socket we wait a while before deciding 97 /* after we give up on a socket we wait a while before deciding
98 * that it is still heartbeating and that we should do some 98 * that it is still heartbeating and that we should do some
99 * quorum work */ 99 * quorum work */
100 struct work_struct nn_still_up; 100 struct delayed_work nn_still_up;
101}; 101};
102 102
103struct o2net_sock_container { 103struct o2net_sock_container {
@@ -129,7 +129,7 @@ struct o2net_sock_container {
129 struct work_struct sc_shutdown_work; 129 struct work_struct sc_shutdown_work;
130 130
131 struct timer_list sc_idle_timeout; 131 struct timer_list sc_idle_timeout;
132 struct work_struct sc_keepalive_work; 132 struct delayed_work sc_keepalive_work;
133 133
134 unsigned sc_handshake_ok:1; 134 unsigned sc_handshake_ok:1;
135 135
diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h
index fa968180b072..6b6ff76538c5 100644
--- a/fs/ocfs2/dlm/dlmcommon.h
+++ b/fs/ocfs2/dlm/dlmcommon.h
@@ -153,7 +153,7 @@ static inline struct hlist_head *dlm_lockres_hash(struct dlm_ctxt *dlm, unsigned
153 * called functions that cannot be directly called from the 153 * called functions that cannot be directly called from the
154 * net message handlers for some reason, usually because 154 * net message handlers for some reason, usually because
155 * they need to send net messages of their own. */ 155 * they need to send net messages of their own. */
156void dlm_dispatch_work(void *data); 156void dlm_dispatch_work(struct work_struct *work);
157 157
158struct dlm_lock_resource; 158struct dlm_lock_resource;
159struct dlm_work_item; 159struct dlm_work_item;
diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
index 8d1065f8b3bd..637646e6922e 100644
--- a/fs/ocfs2/dlm/dlmdomain.c
+++ b/fs/ocfs2/dlm/dlmdomain.c
@@ -1296,7 +1296,7 @@ static struct dlm_ctxt *dlm_alloc_ctxt(const char *domain,
1296 1296
1297 spin_lock_init(&dlm->work_lock); 1297 spin_lock_init(&dlm->work_lock);
1298 INIT_LIST_HEAD(&dlm->work_list); 1298 INIT_LIST_HEAD(&dlm->work_list);
1299 INIT_WORK(&dlm->dispatched_work, dlm_dispatch_work, dlm); 1299 INIT_WORK(&dlm->dispatched_work, dlm_dispatch_work);
1300 1300
1301 kref_init(&dlm->dlm_refs); 1301 kref_init(&dlm->dlm_refs);
1302 dlm->dlm_state = DLM_CTXT_NEW; 1302 dlm->dlm_state = DLM_CTXT_NEW;
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
index 9d950d7cea38..fb3e2b0817f1 100644
--- a/fs/ocfs2/dlm/dlmrecovery.c
+++ b/fs/ocfs2/dlm/dlmrecovery.c
@@ -153,9 +153,10 @@ static inline void dlm_reset_recovery(struct dlm_ctxt *dlm)
153} 153}
154 154
155/* Worker function used during recovery. */ 155/* Worker function used during recovery. */
156void dlm_dispatch_work(void *data) 156void dlm_dispatch_work(struct work_struct *work)
157{ 157{
158 struct dlm_ctxt *dlm = (struct dlm_ctxt *)data; 158 struct dlm_ctxt *dlm =
159 container_of(work, struct dlm_ctxt, dispatched_work);
159 LIST_HEAD(tmp_list); 160 LIST_HEAD(tmp_list);
160 struct list_head *iter, *iter2; 161 struct list_head *iter, *iter2;
161 struct dlm_work_item *item; 162 struct dlm_work_item *item;
diff --git a/fs/ocfs2/dlm/userdlm.c b/fs/ocfs2/dlm/userdlm.c
index eead48bbfac6..7d2f578b267d 100644
--- a/fs/ocfs2/dlm/userdlm.c
+++ b/fs/ocfs2/dlm/userdlm.c
@@ -171,15 +171,14 @@ static inline void user_dlm_grab_inode_ref(struct user_lock_res *lockres)
171 BUG(); 171 BUG();
172} 172}
173 173
174static void user_dlm_unblock_lock(void *opaque); 174static void user_dlm_unblock_lock(struct work_struct *work);
175 175
176static void __user_dlm_queue_lockres(struct user_lock_res *lockres) 176static void __user_dlm_queue_lockres(struct user_lock_res *lockres)
177{ 177{
178 if (!(lockres->l_flags & USER_LOCK_QUEUED)) { 178 if (!(lockres->l_flags & USER_LOCK_QUEUED)) {
179 user_dlm_grab_inode_ref(lockres); 179 user_dlm_grab_inode_ref(lockres);
180 180
181 INIT_WORK(&lockres->l_work, user_dlm_unblock_lock, 181 INIT_WORK(&lockres->l_work, user_dlm_unblock_lock);
182 lockres);
183 182
184 queue_work(user_dlm_worker, &lockres->l_work); 183 queue_work(user_dlm_worker, &lockres->l_work);
185 lockres->l_flags |= USER_LOCK_QUEUED; 184 lockres->l_flags |= USER_LOCK_QUEUED;
@@ -279,10 +278,11 @@ static inline void user_dlm_drop_inode_ref(struct user_lock_res *lockres)
279 iput(inode); 278 iput(inode);
280} 279}
281 280
282static void user_dlm_unblock_lock(void *opaque) 281static void user_dlm_unblock_lock(struct work_struct *work)
283{ 282{
284 int new_level, status; 283 int new_level, status;
285 struct user_lock_res *lockres = (struct user_lock_res *) opaque; 284 struct user_lock_res *lockres =
285 container_of(work, struct user_lock_res, l_work);
286 struct dlm_ctxt *dlm = dlm_ctxt_from_user_lockres(lockres); 286 struct dlm_ctxt *dlm = dlm_ctxt_from_user_lockres(lockres);
287 287
288 mlog(0, "processing lockres %.*s\n", lockres->l_namelen, 288 mlog(0, "processing lockres %.*s\n", lockres->l_namelen,
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index fd9734def551..d95ee2720e6e 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -911,11 +911,12 @@ struct ocfs2_la_recovery_item {
911 * NOTE: This function can and will sleep on recovery of other nodes 911 * NOTE: This function can and will sleep on recovery of other nodes
912 * during cluster locking, just like any other ocfs2 process. 912 * during cluster locking, just like any other ocfs2 process.
913 */ 913 */
914void ocfs2_complete_recovery(void *data) 914void ocfs2_complete_recovery(struct work_struct *work)
915{ 915{
916 int ret; 916 int ret;
917 struct ocfs2_super *osb = data; 917 struct ocfs2_journal *journal =
918 struct ocfs2_journal *journal = osb->journal; 918 container_of(work, struct ocfs2_journal, j_recovery_work);
919 struct ocfs2_super *osb = journal->j_osb;
919 struct ocfs2_dinode *la_dinode, *tl_dinode; 920 struct ocfs2_dinode *la_dinode, *tl_dinode;
920 struct ocfs2_la_recovery_item *item; 921 struct ocfs2_la_recovery_item *item;
921 struct list_head *p, *n; 922 struct list_head *p, *n;
diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h
index 2f3a6acdac45..5be161a4ad9f 100644
--- a/fs/ocfs2/journal.h
+++ b/fs/ocfs2/journal.h
@@ -172,7 +172,7 @@ static inline void ocfs2_handle_set_sync(struct ocfs2_journal_handle *handle, in
172} 172}
173 173
174/* Exported only for the journal struct init code in super.c. Do not call. */ 174/* Exported only for the journal struct init code in super.c. Do not call. */
175void ocfs2_complete_recovery(void *data); 175void ocfs2_complete_recovery(struct work_struct *work);
176 176
177/* 177/*
178 * Journal Control: 178 * Journal Control:
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index 0462a7f4e21b..9b1bad1d48ec 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -283,7 +283,7 @@ struct ocfs2_super
283 /* Truncate log info */ 283 /* Truncate log info */
284 struct inode *osb_tl_inode; 284 struct inode *osb_tl_inode;
285 struct buffer_head *osb_tl_bh; 285 struct buffer_head *osb_tl_bh;
286 struct work_struct osb_truncate_log_wq; 286 struct delayed_work osb_truncate_log_wq;
287 287
288 struct ocfs2_node_map osb_recovering_orphan_dirs; 288 struct ocfs2_node_map osb_recovering_orphan_dirs;
289 unsigned int *osb_orphan_wipes; 289 unsigned int *osb_orphan_wipes;
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 76b46ebbb10c..9a8089030f55 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1365,7 +1365,7 @@ static int ocfs2_initialize_super(struct super_block *sb,
1365 spin_lock_init(&journal->j_lock); 1365 spin_lock_init(&journal->j_lock);
1366 journal->j_trans_id = (unsigned long) 1; 1366 journal->j_trans_id = (unsigned long) 1;
1367 INIT_LIST_HEAD(&journal->j_la_cleanups); 1367 INIT_LIST_HEAD(&journal->j_la_cleanups);
1368 INIT_WORK(&journal->j_recovery_work, ocfs2_complete_recovery, osb); 1368 INIT_WORK(&journal->j_recovery_work, ocfs2_complete_recovery);
1369 journal->j_state = OCFS2_JOURNAL_FREE; 1369 journal->j_state = OCFS2_JOURNAL_FREE;
1370 1370
1371 /* get some pseudo constants for clustersize bits */ 1371 /* get some pseudo constants for clustersize bits */