···408408/* this function performs work that has been deferred until sleeping is OK409409 */410410void411411-aoecmd_sleepwork(void *vp)411411+aoecmd_sleepwork(struct work_struct *work)412412{413413- struct aoedev *d = (struct aoedev *) vp;413413+ struct aoedev *d = container_of(work, struct aoedev, work);414414415415 if (d->flags & DEVFL_GDALLOC)416416 aoeblk_gdalloc(d);
···102102 * Routine to poll RTC seconds field for change as often as possible,103103 * after first RTC_UIE use timer to reduce polling104104 */105105-static void genrtc_troutine(void *data)105105+static void genrtc_troutine(struct work_struct *work)106106{107107 unsigned int tmp = get_rtc_ss();108108···255255 irq_active = 1;256256 stop_rtc_timers = 0;257257 lostint = 0;258258- INIT_WORK(&genrtc_task, genrtc_troutine, NULL);258258+ INIT_WORK(&genrtc_task, genrtc_troutine);259259 oldsecs = get_rtc_ss();260260 init_timer(&timer_task);261261
···4040#define SNAPSHOT_PAGES 25641414242struct workqueue_struct *ksnapd;4343-static void flush_queued_bios(void *data);4343+static void flush_queued_bios(struct work_struct *work);44444545struct pending_exception {4646 struct exception e;···528528 }529529530530 bio_list_init(&s->queued_bios);531531- INIT_WORK(&s->queued_bios_work, flush_queued_bios, s);531531+ INIT_WORK(&s->queued_bios_work, flush_queued_bios);532532533533 /* Add snapshot to the list of snapshots for this origin */534534 /* Exceptions aren't triggered till snapshot_resume() is called */···603603 }604604}605605606606-static void flush_queued_bios(void *data)606606+static void flush_queued_bios(struct work_struct *work)607607{608608- struct dm_snapshot *s = (struct dm_snapshot *) data;608608+ struct dm_snapshot *s =609609+ container_of(work, struct dm_snapshot, queued_bios_work);609610 struct bio *queued_bios;610611 unsigned long flags;611612
+2-2
drivers/md/kcopyd.c
···417417/*418418 * kcopyd does this every time it's woken up.419419 */420420-static void do_work(void *ignored)420420+static void do_work(struct work_struct *ignored)421421{422422 /*423423 * The order that these are called is *very* important.···628628 }629629630630 kcopyd_clients++;631631- INIT_WORK(&_kcopyd_work, do_work, NULL);631631+ INIT_WORK(&_kcopyd_work, do_work);632632 mutex_unlock(&kcopyd_init_lock);633633 return 0;634634}
···371371 * new LCT and if the buffer for the LCT was to small sends a LCT NOTIFY372372 * again, otherwise send LCT NOTIFY to get informed on next LCT change.373373 */374374-static void i2o_exec_lct_modified(struct i2o_exec_lct_notify_work *work)374374+static void i2o_exec_lct_modified(struct work_struct *_work)375375{376376+ struct i2o_exec_lct_notify_work *work =377377+ container_of(_work, struct i2o_exec_lct_notify_work, work);376378 u32 change_ind = 0;377379 struct i2o_controller *c = work->c;378380···441439442440 work->c = c;443441444444- INIT_WORK(&work->work, (void (*)(void *))i2o_exec_lct_modified,445445- work);442442+ INIT_WORK(&work->work, i2o_exec_lct_modified);446443 queue_work(i2o_exec_driver.event_queue, &work->work);447444 return 1;448445 }···461460462461/**463462 * i2o_exec_event - Event handling function464464- * @evt: Event which occurs463463+ * @work: Work item in occurring event465464 *466465 * Handles events send by the Executive device. At the moment does not do467466 * anything useful.468467 */469469-static void i2o_exec_event(struct i2o_event *evt)468468+static void i2o_exec_event(struct work_struct *work)470469{470470+ struct i2o_event *evt = container_of(work, struct i2o_event, work);471471+471472 if (likely(evt->i2o_dev))472473 osm_debug("Event received from device: %d\n",473474 evt->i2o_dev->lct_data.tid);
+9-6
drivers/message/i2o/i2o_block.c
···419419420420/**421421 * i2o_block_delayed_request_fn - delayed request queue function422422- * delayed_request: the delayed request with the queue to start422422+ * @work: the delayed request with the queue to start423423 *424424 * If the request queue is stopped for a disk, and there is no open425425 * request, a new event is created, which calls this function to start426426 * the queue after I2O_BLOCK_REQUEST_TIME. Otherwise the queue will never427427 * be started again.428428 */429429-static void i2o_block_delayed_request_fn(void *delayed_request)429429+static void i2o_block_delayed_request_fn(struct work_struct *work)430430{431431- struct i2o_block_delayed_request *dreq = delayed_request;431431+ struct i2o_block_delayed_request *dreq =432432+ container_of(work, struct i2o_block_delayed_request,433433+ work.work);432434 struct request_queue *q = dreq->queue;433435 unsigned long flags;434436···540538 return 1;541539};542540543543-static void i2o_block_event(struct i2o_event *evt)541541+static void i2o_block_event(struct work_struct *work)544542{543543+ struct i2o_event *evt = container_of(work, struct i2o_event, work);545544 osm_debug("event received\n");546545 kfree(evt);547546};···941938 continue;942939943940 dreq->queue = q;944944- INIT_WORK(&dreq->work, i2o_block_delayed_request_fn,945945- dreq);941941+ INIT_DELAYED_WORK(&dreq->work,942942+ i2o_block_delayed_request_fn);946943947944 if (!queue_delayed_work(i2o_block_driver.event_queue,948945 &dreq->work,
···11651165 */11661166void mmc_detect_change(struct mmc_host *host, unsigned long delay)11671167{11681168- if (delay)11691169- mmc_schedule_delayed_work(&host->detect, delay);11701170- else11711171- mmc_schedule_work(&host->detect);11681168+ mmc_schedule_delayed_work(&host->detect, delay);11721169}1173117011741171EXPORT_SYMBOL(mmc_detect_change);117511721176117311771177-static void mmc_rescan(void *data)11741174+static void mmc_rescan(struct work_struct *work)11781175{11791179- struct mmc_host *host = data;11761176+ struct mmc_host *host =11771177+ container_of(work, struct mmc_host, detect.work);11801178 struct list_head *l, *n;11811179 unsigned char power_mode;11821180···12571259 spin_lock_init(&host->lock);12581260 init_waitqueue_head(&host->wq);12591261 INIT_LIST_HEAD(&host->cards);12601260- INIT_WORK(&host->detect, mmc_rescan, host);12621262+ INIT_DELAYED_WORK(&host->detect, mmc_rescan);1261126312621264 /*12631265 * By default, hosts do not support SGIO or large requests.···13551357 */13561358int mmc_resume_host(struct mmc_host *host)13571359{13581358- mmc_rescan(host);13601360+ mmc_rescan(&host->detect.work);1359136113601362 return 0;13611363}
+1-1
drivers/mmc/mmc.h
···2020void mmc_free_host_sysfs(struct mmc_host *host);21212222int mmc_schedule_work(struct work_struct *work);2323-int mmc_schedule_delayed_work(struct work_struct *work, unsigned long delay);2323+int mmc_schedule_delayed_work(struct delayed_work *work, unsigned long delay);2424void mmc_flush_scheduled_work(void);2525#endif
+1-9
drivers/mmc/mmc_sysfs.c
···321321static struct workqueue_struct *workqueue;322322323323/*324324- * Internal function. Schedule work in the MMC work queue.325325- */326326-int mmc_schedule_work(struct work_struct *work)327327-{328328- return queue_work(workqueue, work);329329-}330330-331331-/*332324 * Internal function. Schedule delayed work in the MMC work queue.333325 */334334-int mmc_schedule_delayed_work(struct work_struct *work, unsigned long delay)326326+int mmc_schedule_delayed_work(struct delayed_work *work, unsigned long delay)335327{336328 return queue_delayed_work(workqueue, work, delay);337329}
···474474475475/* Called only as scheduled task after receiving info frames (used to avoid476476 * pending too much time in HW IRQ handler). */477477-static void handle_info_queue(void *data)477477+static void handle_info_queue(struct work_struct *work)478478{479479- local_info_t *local = (local_info_t *) data;479479+ local_info_t *local = container_of(work, local_info_t, info_queue);480480481481 if (test_and_clear_bit(PRISM2_INFO_PENDING_LINKSTATUS,482482 &local->pending_info))···493493{494494 skb_queue_head_init(&local->info_list);495495#ifndef PRISM2_NO_STATION_MODES496496- INIT_WORK(&local->info_queue, handle_info_queue, local);496496+ INIT_WORK(&local->info_queue, handle_info_queue);497497#endif /* PRISM2_NO_STATION_MODES */498498}499499
+4-4
drivers/net/wireless/hostap/hostap_main.c
···767767768768/* TODO: to be further implemented as soon as Prism2 fully supports769769 * GroupAddresses and correct documentation is available */770770-void hostap_set_multicast_list_queue(void *data)770770+void hostap_set_multicast_list_queue(struct work_struct *work)771771{772772- struct net_device *dev = (struct net_device *) data;772772+ local_info_t *local =773773+ container_of(work, local_info_t, set_multicast_list_queue);774774+ struct net_device *dev = local->dev;773775 struct hostap_interface *iface;774774- local_info_t *local;775776776777 iface = netdev_priv(dev);777777- local = iface->local;778778 if (hostap_set_word(dev, HFA384X_RID_PROMISCUOUSMODE,779779 local->is_promisc)) {780780 printk(KERN_INFO "%s: %sabling promiscuous mode failed\n",
···5353 * Routine to poll RTC seconds field for change as often as possible,5454 * after first RTC_UIE use timer to reduce polling5555 */5656-static void rtc_uie_task(void *data)5656+static void rtc_uie_task(struct work_struct *work)5757{5858- struct rtc_device *rtc = data;5858+ struct rtc_device *rtc =5959+ container_of(work, struct rtc_device, uie_task);5960 struct rtc_time tm;6061 int num = 0;6162 int err;···399398 spin_lock_init(&rtc->irq_lock);400399 init_waitqueue_head(&rtc->irq_queue);401400#ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL402402- INIT_WORK(&rtc->uie_task, rtc_uie_task, rtc);401401+ INIT_WORK(&rtc->uie_task, rtc_uie_task);403402 setup_timer(&rtc->uie_timer, rtc_uie_timer, (unsigned long)rtc);404403#endif405404
+6-5
drivers/scsi/NCR5380.c
···849849 hostdata->issue_queue = NULL;850850 hostdata->disconnected_queue = NULL;851851852852- INIT_WORK(&hostdata->coroutine, NCR5380_main, hostdata);852852+ INIT_DELAYED_WORK(&hostdata->coroutine, NCR5380_main);853853854854#ifdef NCR5380_STATS855855 for (i = 0; i < 8; ++i) {···1016101610171017 /* Run the coroutine if it isn't already running. */10181018 /* Kick off command processing */10191019- schedule_work(&hostdata->coroutine);10191019+ schedule_delayed_work(&hostdata->coroutine, 0);10201020 return 0;10211021}10221022···10331033 * host lock and called routines may take the isa dma lock.10341034 */1035103510361036-static void NCR5380_main(void *p)10361036+static void NCR5380_main(struct work_struct *work)10371037{10381038- struct NCR5380_hostdata *hostdata = p;10381038+ struct NCR5380_hostdata *hostdata =10391039+ container_of(work, struct NCR5380_hostdata, coroutine.work);10391040 struct Scsi_Host *instance = hostdata->host;10401041 Scsi_Cmnd *tmp, *prev;10411042 int done;···12221221 } /* if BASR_IRQ */12231222 spin_unlock_irqrestore(instance->host_lock, flags);12241223 if(!done)12251225- schedule_work(&hostdata->coroutine);12241224+ schedule_delayed_work(&hostdata->coroutine, 0);12261225 } while (!done);12271226 return IRQ_HANDLED;12281227}
+2-2
drivers/scsi/NCR5380.h
···271271 unsigned long time_expires; /* in jiffies, set prior to sleeping */272272 int select_time; /* timer in select for target response */273273 volatile Scsi_Cmnd *selecting;274274- struct work_struct coroutine; /* our co-routine */274274+ struct delayed_work coroutine; /* our co-routine */275275#ifdef NCR5380_STATS276276 unsigned timebase; /* Base for time calcs */277277 long time_read[8]; /* time to do reads */···298298#ifndef DONT_USE_INTR299299static irqreturn_t NCR5380_intr(int irq, void *dev_id);300300#endif301301-static void NCR5380_main(void *ptr);301301+static void NCR5380_main(struct work_struct *work);302302static void NCR5380_print_options(struct Scsi_Host *instance);303303#ifdef NDEBUG304304static void NCR5380_print_phase(struct Scsi_Host *instance);
+2-2
drivers/scsi/aha152x.c
···14431443 * Run service completions on the card with interrupts enabled.14441444 *14451445 */14461446-static void run(void)14461446+static void run(struct work_struct *work)14471447{14481448 struct aha152x_hostdata *hd;14491449···14991499 HOSTDATA(shpnt)->service=1;1500150015011501 /* Poke the BH handler */15021502- INIT_WORK(&aha152x_tq, (void *) run, NULL);15021502+ INIT_WORK(&aha152x_tq, run);15031503 schedule_work(&aha152x_tq);15041504 }15051505 DO_UNLOCK(flags);
+5-7
drivers/scsi/imm.c
···3636 int base_hi; /* Hi Base address for ECP-ISA chipset */3737 int mode; /* Transfer mode */3838 struct scsi_cmnd *cur_cmd; /* Current queued command */3939- struct work_struct imm_tq; /* Polling interrupt stuff */3939+ struct delayed_work imm_tq; /* Polling interrupt stuff */4040 unsigned long jstart; /* Jiffies at start */4141 unsigned failed:1; /* Failure flag */4242 unsigned dp:1; /* Data phase present */···733733 * the scheduler's task queue to generate a stream of call-backs and734734 * complete the request when the drive is ready.735735 */736736-static void imm_interrupt(void *data)736736+static void imm_interrupt(struct work_struct *work)737737{738738- imm_struct *dev = (imm_struct *) data;738738+ imm_struct *dev = container_of(work, imm_struct, imm_tq.work);739739 struct scsi_cmnd *cmd = dev->cur_cmd;740740 struct Scsi_Host *host = cmd->device->host;741741 unsigned long flags;···745745 return;746746 }747747 if (imm_engine(dev, cmd)) {748748- INIT_WORK(&dev->imm_tq, imm_interrupt, (void *) dev);749748 schedule_delayed_work(&dev->imm_tq, 1);750749 return;751750 }···952953 cmd->result = DID_ERROR << 16; /* default return code */953954 cmd->SCp.phase = 0; /* bus free */954955955955- INIT_WORK(&dev->imm_tq, imm_interrupt, dev);956956- schedule_work(&dev->imm_tq);956956+ schedule_delayed_work(&dev->imm_tq, 0);957957958958 imm_pb_claim(dev);959959···12231225 else12241226 ports = 8;1225122712261226- INIT_WORK(&dev->imm_tq, imm_interrupt, dev);12281228+ INIT_DELAYED_WORK(&dev->imm_tq, imm_interrupt);1227122912281230 err = -ENOMEM;12291231 host = scsi_host_alloc(&imm_template, sizeof(imm_struct *));
+5-4
drivers/scsi/ipr.c
···2093209320942094/**20952095 * ipr_worker_thread - Worker thread20962096- * @data: ioa config struct20962096+ * @work: ioa config struct20972097 *20982098 * Called at task level from a work thread. This function takes care20992099 * of adding and removing device from the mid-layer as configuration···21022102 * Return value:21032103 * nothing21042104 **/21052105-static void ipr_worker_thread(void *data)21052105+static void ipr_worker_thread(struct work_struct *work)21062106{21072107 unsigned long lock_flags;21082108 struct ipr_resource_entry *res;21092109 struct scsi_device *sdev;21102110 struct ipr_dump *dump;21112111- struct ipr_ioa_cfg *ioa_cfg = data;21112111+ struct ipr_ioa_cfg *ioa_cfg =21122112+ container_of(work, struct ipr_ioa_cfg, work_q);21122113 u8 bus, target, lun;21132114 int did_work;21142115···69276926 INIT_LIST_HEAD(&ioa_cfg->hostrcb_pending_q);69286927 INIT_LIST_HEAD(&ioa_cfg->free_res_q);69296928 INIT_LIST_HEAD(&ioa_cfg->used_res_q);69306930- INIT_WORK(&ioa_cfg->work_q, ipr_worker_thread, ioa_cfg);69296929+ INIT_WORK(&ioa_cfg->work_q, ipr_worker_thread);69316930 init_waitqueue_head(&ioa_cfg->reset_wait_q);69326931 ioa_cfg->sdt_state = INACTIVE;69336932 if (ipr_enable_cache)
+4-3
drivers/scsi/libiscsi.c
···719719 return rc;720720}721721722722-static void iscsi_xmitworker(void *data)722722+static void iscsi_xmitworker(struct work_struct *work)723723{724724- struct iscsi_conn *conn = data;724724+ struct iscsi_conn *conn =725725+ container_of(work, struct iscsi_conn, xmitwork);725726 int rc;726727 /*727728 * serialize Xmit worker on a per-connection basis.···15131512 if (conn->mgmtqueue == ERR_PTR(-ENOMEM))15141513 goto mgmtqueue_alloc_fail;1515151415161516- INIT_WORK(&conn->xmitwork, iscsi_xmitworker, conn);15151515+ INIT_WORK(&conn->xmitwork, iscsi_xmitworker);1517151615181517 /* allocate login_mtask used for the login/text sequences */15191518 spin_lock_bh(&session->lock);
+14-8
drivers/scsi/libsas/sas_discover.c
···647647 * Discover process only interrogates devices in order to discover the648648 * domain.649649 */650650-static void sas_discover_domain(void *data)650650+static void sas_discover_domain(struct work_struct *work)651651{652652 int error = 0;653653- struct asd_sas_port *port = data;653653+ struct sas_discovery_event *ev =654654+ container_of(work, struct sas_discovery_event, work);655655+ struct asd_sas_port *port = ev->port;654656655657 sas_begin_event(DISCE_DISCOVER_DOMAIN, &port->disc.disc_event_lock,656658 &port->disc.pending);···694692 current->pid, error);695693}696694697697-static void sas_revalidate_domain(void *data)695695+static void sas_revalidate_domain(struct work_struct *work)698696{699697 int res = 0;700700- struct asd_sas_port *port = data;698698+ struct sas_discovery_event *ev =699699+ container_of(work, struct sas_discovery_event, work);700700+ struct asd_sas_port *port = ev->port;701701702702 sas_begin_event(DISCE_REVALIDATE_DOMAIN, &port->disc.disc_event_lock,703703 &port->disc.pending);···726722 BUG_ON(ev >= DISC_NUM_EVENTS);727723728724 sas_queue_event(ev, &disc->disc_event_lock, &disc->pending,729729- &disc->disc_work[ev], port->ha->core.shost);725725+ &disc->disc_work[ev].work, port->ha->core.shost);730726731727 return 0;732728}···741737{742738 int i;743739744744- static void (*sas_event_fns[DISC_NUM_EVENTS])(void *) = {740740+ static const work_func_t sas_event_fns[DISC_NUM_EVENTS] = {745741 [DISCE_DISCOVER_DOMAIN] = sas_discover_domain,746742 [DISCE_REVALIDATE_DOMAIN] = sas_revalidate_domain,747743 };748744749745 spin_lock_init(&disc->disc_event_lock);750746 disc->pending = 0;751751- for (i = 0; i < DISC_NUM_EVENTS; i++)752752- INIT_WORK(&disc->disc_work[i], sas_event_fns[i], port);747747+ for (i = 0; i < DISC_NUM_EVENTS; i++) {748748+ INIT_WORK(&disc->disc_work[i].work, sas_event_fns[i]);749749+ disc->disc_work[i].port = port;750750+ }753751}
···12051205 return status;12061206}1207120712081208-static void ocfs2_truncate_log_worker(void *data)12081208+static void ocfs2_truncate_log_worker(struct work_struct *work)12091209{12101210 int status;12111211- struct ocfs2_super *osb = data;12111211+ struct ocfs2_super *osb =12121212+ container_of(work, struct ocfs2_super,12131213+ osb_truncate_log_wq.work);1212121412131215 mlog_entry_void();12141216···14431441 /* ocfs2_truncate_log_shutdown keys on the existence of14441442 * osb->osb_tl_inode so we don't set any of the osb variables14451443 * until we're sure all is well. */14461446- INIT_WORK(&osb->osb_truncate_log_wq, ocfs2_truncate_log_worker, osb);14441444+ INIT_DELAYED_WORK(&osb->osb_truncate_log_wq,14451445+ ocfs2_truncate_log_worker);14471446 osb->osb_tl_bh = tl_bh;14481447 osb->osb_tl_inode = tl_inode;14491448
+6-4
fs/ocfs2/cluster/heartbeat.c
···141141 * recognizes a node going up and down in one iteration */142142 u64 hr_generation;143143144144- struct work_struct hr_write_timeout_work;144144+ struct delayed_work hr_write_timeout_work;145145 unsigned long hr_last_timeout_start;146146147147 /* Used during o2hb_check_slot to hold a copy of the block···156156 int wc_error;157157};158158159159-static void o2hb_write_timeout(void *arg)159159+static void o2hb_write_timeout(struct work_struct *work)160160{161161- struct o2hb_region *reg = arg;161161+ struct o2hb_region *reg =162162+ container_of(work, struct o2hb_region,163163+ hr_write_timeout_work.work);162164163165 mlog(ML_ERROR, "Heartbeat write timeout to device %s after %u "164166 "milliseconds\n", reg->hr_dev_name,···14061404 goto out;14071405 }1408140614091409- INIT_WORK(®->hr_write_timeout_work, o2hb_write_timeout, reg);14071407+ INIT_DELAYED_WORK(®->hr_write_timeout_work, o2hb_write_timeout);1410140814111409 /*14121410 * A node is considered live after it has beat LIVE_THRESHOLD
···140140 [O2NET_ERR_DIED] = -EHOSTDOWN,};141141142142/* can't quite avoid *all* internal declarations :/ */143143-static void o2net_sc_connect_completed(void *arg);144144-static void o2net_rx_until_empty(void *arg);145145-static void o2net_shutdown_sc(void *arg);143143+static void o2net_sc_connect_completed(struct work_struct *work);144144+static void o2net_rx_until_empty(struct work_struct *work);145145+static void o2net_shutdown_sc(struct work_struct *work);146146static void o2net_listen_data_ready(struct sock *sk, int bytes);147147-static void o2net_sc_send_keep_req(void *arg);147147+static void o2net_sc_send_keep_req(struct work_struct *work);148148static void o2net_idle_timer(unsigned long data);149149static void o2net_sc_postpone_idle(struct o2net_sock_container *sc);150150···308308 o2nm_node_get(node);309309 sc->sc_node = node;310310311311- INIT_WORK(&sc->sc_connect_work, o2net_sc_connect_completed, sc);312312- INIT_WORK(&sc->sc_rx_work, o2net_rx_until_empty, sc);313313- INIT_WORK(&sc->sc_shutdown_work, o2net_shutdown_sc, sc);314314- INIT_WORK(&sc->sc_keepalive_work, o2net_sc_send_keep_req, sc);311311+ INIT_WORK(&sc->sc_connect_work, o2net_sc_connect_completed);312312+ INIT_WORK(&sc->sc_rx_work, o2net_rx_until_empty);313313+ INIT_WORK(&sc->sc_shutdown_work, o2net_shutdown_sc);314314+ INIT_DELAYED_WORK(&sc->sc_keepalive_work, o2net_sc_send_keep_req);315315316316 init_timer(&sc->sc_idle_timeout);317317 sc->sc_idle_timeout.function = o2net_idle_timer;···342342 sc_put(sc);343343}344344static void o2net_sc_queue_delayed_work(struct o2net_sock_container *sc,345345- struct work_struct *work,345345+ struct delayed_work *work,346346 int delay)347347{348348 sc_get(sc);···350350 sc_put(sc);351351}352352static void o2net_sc_cancel_delayed_work(struct o2net_sock_container *sc,353353- struct work_struct *work)353353+ struct delayed_work *work)354354{355355 if (cancel_delayed_work(work))356356 sc_put(sc);···564564 * ourselves as state_change couldn't get the nn_lock and call set_nn_state565565 * itself.566566 */567567-static void o2net_shutdown_sc(void *arg)567567+static void o2net_shutdown_sc(struct work_struct *work)568568{569569- struct o2net_sock_container *sc = arg;569569+ struct o2net_sock_container *sc =570570+ container_of(work, struct o2net_sock_container,571571+ sc_shutdown_work);570572 struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num);571573572574 sclog(sc, "shutting down\n");···12031201/* this work func is triggerd by data ready. it reads until it can read no12041202 * more. it interprets 0, eof, as fatal. if data_ready hits while we're doing12051203 * our work the work struct will be marked and we'll be called again. */12061206-static void o2net_rx_until_empty(void *arg)12041204+static void o2net_rx_until_empty(struct work_struct *work)12071205{12081208- struct o2net_sock_container *sc = arg;12061206+ struct o2net_sock_container *sc =12071207+ container_of(work, struct o2net_sock_container, sc_rx_work);12091208 int ret;1210120912111210 do {···1252124912531250/* called when a connect completes and after a sock is accepted. the12541251 * rx path will see the response and mark the sc valid */12551255-static void o2net_sc_connect_completed(void *arg)12521252+static void o2net_sc_connect_completed(struct work_struct *work)12561253{12571257- struct o2net_sock_container *sc = arg;12541254+ struct o2net_sock_container *sc =12551255+ container_of(work, struct o2net_sock_container,12561256+ sc_connect_work);1258125712591258 mlog(ML_MSG, "sc sending handshake with ver %llu id %llx\n",12601259 (unsigned long long)O2NET_PROTOCOL_VERSION,···12671262}1268126312691264/* this is called as a work_struct func. */12701270-static void o2net_sc_send_keep_req(void *arg)12651265+static void o2net_sc_send_keep_req(struct work_struct *work)12711266{12721272- struct o2net_sock_container *sc = arg;12671267+ struct o2net_sock_container *sc =12681268+ container_of(work, struct o2net_sock_container,12691269+ sc_keepalive_work.work);1273127012741271 o2net_sendpage(sc, o2net_keep_req, sizeof(*o2net_keep_req));12751272 sc_put(sc);···13211314 * having a connect attempt fail, etc. This centralizes the logic which decides13221315 * if a connect attempt should be made or if we should give up and all future13231316 * transmit attempts should fail */13241324-static void o2net_start_connect(void *arg)13171317+static void o2net_start_connect(struct work_struct *work)13251318{13261326- struct o2net_node *nn = arg;13191319+ struct o2net_node *nn =13201320+ container_of(work, struct o2net_node, nn_connect_work.work);13271321 struct o2net_sock_container *sc = NULL;13281322 struct o2nm_node *node = NULL, *mynode = NULL;13291323 struct socket *sock = NULL;13301324 struct sockaddr_in myaddr = {0, }, remoteaddr = {0, };13311331- int ret = 0;13251325+ int ret = 0, stop;1332132613331327 /* if we're greater we initiate tx, otherwise we accept */13341328 if (o2nm_this_node() <= o2net_num_from_nn(nn))···1350134213511343 spin_lock(&nn->nn_lock);13521344 /* see if we already have one pending or have given up */13531353- if (nn->nn_sc || nn->nn_persistent_error)13541354- arg = NULL;13451345+ stop = (nn->nn_sc || nn->nn_persistent_error);13551346 spin_unlock(&nn->nn_lock);13561356- if (arg == NULL) /* *shrug*, needed some indicator */13471347+ if (stop)13571348 goto out;1358134913591350 nn->nn_last_connect_attempt = jiffies;···14281421 return;14291422}1430142314311431-static void o2net_connect_expired(void *arg)14241424+static void o2net_connect_expired(struct work_struct *work)14321425{14331433- struct o2net_node *nn = arg;14261426+ struct o2net_node *nn =14271427+ container_of(work, struct o2net_node, nn_connect_expired.work);1434142814351429 spin_lock(&nn->nn_lock);14361430 if (!nn->nn_sc_valid) {···14441436 spin_unlock(&nn->nn_lock);14451437}1446143814471447-static void o2net_still_up(void *arg)14391439+static void o2net_still_up(struct work_struct *work)14481440{14491449- struct o2net_node *nn = arg;14411441+ struct o2net_node *nn =14421442+ container_of(work, struct o2net_node, nn_still_up.work);1450144314511444 o2quo_hb_still_up(o2net_num_from_nn(nn));14521445}···16531644 return ret;16541645}1655164616561656-static void o2net_accept_many(void *arg)16471647+static void o2net_accept_many(struct work_struct *work)16571648{16581658- struct socket *sock = arg;16491649+ struct socket *sock = o2net_listen_sock;16591650 while (o2net_accept_one(sock) == 0)16601651 cond_resched();16611652}···17091700 write_unlock_bh(&sock->sk->sk_callback_lock);1710170117111702 o2net_listen_sock = sock;17121712- INIT_WORK(&o2net_listen_work, o2net_accept_many, sock);17031703+ INIT_WORK(&o2net_listen_work, o2net_accept_many);1713170417141705 sock->sk->sk_reuse = 1;17151706 ret = sock->ops->bind(sock, (struct sockaddr *)&sin, sizeof(sin));···18281819 struct o2net_node *nn = o2net_nn_from_num(i);1829182018301821 spin_lock_init(&nn->nn_lock);18311831- INIT_WORK(&nn->nn_connect_work, o2net_start_connect, nn);18321832- INIT_WORK(&nn->nn_connect_expired, o2net_connect_expired, nn);18331833- INIT_WORK(&nn->nn_still_up, o2net_still_up, nn);18221822+ INIT_DELAYED_WORK(&nn->nn_connect_work, o2net_start_connect);18231823+ INIT_DELAYED_WORK(&nn->nn_connect_expired,18241824+ o2net_connect_expired);18251825+ INIT_DELAYED_WORK(&nn->nn_still_up, o2net_still_up);18341826 /* until we see hb from a node we'll return einval */18351827 nn->nn_persistent_error = -ENOTCONN;18361828 init_waitqueue_head(&nn->nn_sc_wq);
+4-4
fs/ocfs2/cluster/tcp_internal.h
···8686 * connect attempt fails and so can be self-arming. shutdown is8787 * careful to first mark the nn such that no connects will be attempted8888 * before canceling delayed connect work and flushing the queue. */8989- struct work_struct nn_connect_work;8989+ struct delayed_work nn_connect_work;9090 unsigned long nn_last_connect_attempt;91919292 /* this is queued as nodes come up and is canceled when a connection is9393 * established. this expiring gives up on the node and errors out9494 * transmits */9595- struct work_struct nn_connect_expired;9595+ struct delayed_work nn_connect_expired;96969797 /* after we give up on a socket we wait a while before deciding9898 * that it is still heartbeating and that we should do some9999 * quorum work */100100- struct work_struct nn_still_up;100100+ struct delayed_work nn_still_up;101101};102102103103struct o2net_sock_container {···129129 struct work_struct sc_shutdown_work;130130131131 struct timer_list sc_idle_timeout;132132- struct work_struct sc_keepalive_work;132132+ struct delayed_work sc_keepalive_work;133133134134 unsigned sc_handshake_ok:1;135135
+1-1
fs/ocfs2/dlm/dlmcommon.h
···153153 * called functions that cannot be directly called from the154154 * net message handlers for some reason, usually because155155 * they need to send net messages of their own. */156156-void dlm_dispatch_work(void *data);156156+void dlm_dispatch_work(struct work_struct *work);157157158158struct dlm_lock_resource;159159struct dlm_work_item;
···911911 * NOTE: This function can and will sleep on recovery of other nodes912912 * during cluster locking, just like any other ocfs2 process.913913 */914914-void ocfs2_complete_recovery(void *data)914914+void ocfs2_complete_recovery(struct work_struct *work)915915{916916 int ret;917917- struct ocfs2_super *osb = data;918918- struct ocfs2_journal *journal = osb->journal;917917+ struct ocfs2_journal *journal =918918+ container_of(work, struct ocfs2_journal, j_recovery_work);919919+ struct ocfs2_super *osb = journal->j_osb;919920 struct ocfs2_dinode *la_dinode, *tl_dinode;920921 struct ocfs2_la_recovery_item *item;921922 struct list_head *p, *n;
+1-1
fs/ocfs2/journal.h
···172172}173173174174/* Exported only for the journal struct init code in super.c. Do not call. */175175-void ocfs2_complete_recovery(void *data);175175+void ocfs2_complete_recovery(struct work_struct *work);176176177177/*178178 * Journal Control:
···10301030void sctp_inq_free(struct sctp_inq *);10311031void sctp_inq_push(struct sctp_inq *, struct sctp_chunk *packet);10321032struct sctp_chunk *sctp_inq_pop(struct sctp_inq *);10331033-void sctp_inq_set_th_handler(struct sctp_inq *, void (*)(void *), void *);10331033+void sctp_inq_set_th_handler(struct sctp_inq *, work_func_t);1034103410351035/* This is the structure we use to hold outbound chunks. You push10361036 * chunks in and they automatically pop out the other end as bundled
+19-4
include/scsi/libsas.h
···200200 void *lldd_dev;201201};202202203203+struct sas_discovery_event {204204+ struct work_struct work;205205+ struct asd_sas_port *port;206206+};207207+203208struct sas_discovery {204209 spinlock_t disc_event_lock;205205- struct work_struct disc_work[DISC_NUM_EVENTS];210210+ struct sas_discovery_event disc_work[DISC_NUM_EVENTS];206211 unsigned long pending;207212 u8 fanout_sas_addr[8];208213 u8 eeds_a[8];···253248 void *lldd_port; /* not touched by the sas class code */254249};255250251251+struct asd_sas_event {252252+ struct work_struct work;253253+ struct asd_sas_phy *phy;254254+};255255+256256/* The phy pretty much is controlled by the LLDD.257257 * The class only reads those fields.258258 */259259struct asd_sas_phy {260260/* private: */261261 /* protected by ha->event_lock */262262- struct work_struct port_events[PORT_NUM_EVENTS];263263- struct work_struct phy_events[PHY_NUM_EVENTS];262262+ struct asd_sas_event port_events[PORT_NUM_EVENTS];263263+ struct asd_sas_event phy_events[PHY_NUM_EVENTS];264264265265 unsigned long port_events_pending;266266 unsigned long phy_events_pending;···317307 int queue_thread_kill;318308};319309310310+struct sas_ha_event {311311+ struct work_struct work;312312+ struct sas_ha_struct *ha;313313+};314314+320315struct sas_ha_struct {321316/* private: */322317 spinlock_t event_lock;323323- struct work_struct ha_events[HA_NUM_EVENTS];318318+ struct sas_ha_event ha_events[HA_NUM_EVENTS];324319 unsigned long pending;325320326321 struct scsi_core core;
···1458145814591459#define LEC_ARP_REFRESH_INTERVAL (3*HZ)1460146014611461-static void lec_arp_check_expire(void *data);14611461+static void lec_arp_check_expire(struct work_struct *work);14621462static void lec_arp_expire_arp(unsigned long data);1463146314641464/* ···14811481 INIT_HLIST_HEAD(&priv->lec_no_forward);14821482 INIT_HLIST_HEAD(&priv->mcast_fwds);14831483 spin_lock_init(&priv->lec_arp_lock);14841484- INIT_WORK(&priv->lec_arp_work, lec_arp_check_expire, priv);14841484+ INIT_DELAYED_WORK(&priv->lec_arp_work, lec_arp_check_expire);14851485 schedule_delayed_work(&priv->lec_arp_work, LEC_ARP_REFRESH_INTERVAL);14861486}14871487···18791879 * to ESI_FORWARD_DIRECT. This causes the flush period to end18801880 * regardless of the progress of the flush protocol.18811881 */18821882-static void lec_arp_check_expire(void *data)18821882+static void lec_arp_check_expire(struct work_struct *work)18831883{18841884 unsigned long flags;18851885- struct lec_priv *priv = data;18851885+ struct lec_priv *priv =18861886+ container_of(work, struct lec_priv, lec_arp_work.work);18861887 struct hlist_node *node, *next;18871888 struct lec_arp_table *entry;18881889 unsigned long now;
+1-1
net/atm/lec.h
···9292 spinlock_t lec_arp_lock;9393 struct atm_vcc *mcast_vcc; /* Default Multicast Send VCC */9494 struct atm_vcc *lecd;9595- struct work_struct lec_arp_work; /* C10 */9595+ struct delayed_work lec_arp_work; /* C10 */9696 unsigned int maximum_unknown_frame_count;9797 /*9898 * Within the period of time defined by this variable, the client will send
···122122123123 sm->associnfo.associating = 1;124124 /* queue lower level code to do work (if necessary) */125125- schedule_work(&sm->associnfo.work);125125+ schedule_delayed_work(&sm->associnfo.work, 0);126126out:127127 mutex_unlock(&sm->associnfo.mutex);128128···356356 /* force reassociation */357357 mac->associnfo.bssvalid = 0;358358 if (mac->associnfo.associated)359359- schedule_work(&mac->associnfo.work);359359+ schedule_delayed_work(&mac->associnfo.work, 0);360360 } else if (is_zero_ether_addr(data->ap_addr.sa_data)) {361361 /* the bssid we have is no longer fixed */362362 mac->associnfo.bssfixed = 0;···373373 /* tell the other code that this bssid should be used no matter what */374374 mac->associnfo.bssfixed = 1;375375 /* queue associate if new bssid or (old one again and not associated) */376376- schedule_work(&mac->associnfo.work);376376+ schedule_delayed_work(&mac->associnfo.work, 0);377377 }378378379379 out:
···6161#include <net/sctp/sm.h>62626363/* Forward declarations for internal helpers. */6464-static void sctp_endpoint_bh_rcv(struct sctp_endpoint *ep);6464+static void sctp_endpoint_bh_rcv(struct work_struct *work);65656666/*6767 * Initialize the base fields of the endpoint structure.···8585 sctp_inq_init(&ep->base.inqueue);86868787 /* Set its top-half handler */8888- sctp_inq_set_th_handler(&ep->base.inqueue,8989- (void (*)(void *))sctp_endpoint_bh_rcv, ep);8888+ sctp_inq_set_th_handler(&ep->base.inqueue, sctp_endpoint_bh_rcv);90899190 /* Initialize the bind addr area */9291 sctp_bind_addr_init(&ep->base.bind_addr, 0);···310311/* Do delayed input processing. This is scheduled by sctp_rcv().311312 * This may be called on BH or task time.312313 */313313-static void sctp_endpoint_bh_rcv(struct sctp_endpoint *ep)314314+static void sctp_endpoint_bh_rcv(struct work_struct *work)314315{316316+ struct sctp_endpoint *ep =317317+ container_of(work, struct sctp_endpoint,318318+ base.inqueue.immediate);315319 struct sctp_association *asoc;316320 struct sock *sk;317321 struct sctp_transport *transport;
+4-5
net/sctp/inqueue.c
···5454 queue->in_progress = NULL;55555656 /* Create a task for delivering data. */5757- INIT_WORK(&queue->immediate, NULL, NULL);5757+ INIT_WORK(&queue->immediate, NULL);58585959 queue->malloced = 0;6060}···9797 * on the BH related data structures.9898 */9999 list_add_tail(&chunk->list, &q->in_chunk_list);100100- q->immediate.func(q->immediate.data);100100+ q->immediate.func(&q->immediate);101101}102102103103/* Extract a chunk from an SCTP inqueue.···205205 * The intent is that this routine will pull stuff out of the206206 * inqueue and process it.207207 */208208-void sctp_inq_set_th_handler(struct sctp_inq *q,209209- void (*callback)(void *), void *arg)208208+void sctp_inq_set_th_handler(struct sctp_inq *q, work_func_t callback)210209{211211- INIT_WORK(&q->immediate, callback, arg);210210+ INIT_WORK(&q->immediate, callback);212211}213212
+4-4
net/xfrm/xfrm_policy.c
···358358 xfrm_pol_put(policy);359359}360360361361-static void xfrm_policy_gc_task(void *data)361361+static void xfrm_policy_gc_task(struct work_struct *work)362362{363363 struct xfrm_policy *policy;364364 struct hlist_node *entry, *tmp;···546546547547static DEFINE_MUTEX(hash_resize_mutex);548548549549-static void xfrm_hash_resize(void *__unused)549549+static void xfrm_hash_resize(struct work_struct *__unused)550550{551551 int dir, total;552552···563563 mutex_unlock(&hash_resize_mutex);564564}565565566566-static DECLARE_WORK(xfrm_hash_work, xfrm_hash_resize, NULL);566566+static DECLARE_WORK(xfrm_hash_work, xfrm_hash_resize);567567568568/* Generate new index... KAME seems to generate them ordered by cost569569 * of an absolute inpredictability of ordering of rules. This will not pass. */···20802080 panic("XFRM: failed to allocate bydst hash\n");20812081 }2082208220832083- INIT_WORK(&xfrm_policy_gc_work, xfrm_policy_gc_task, NULL);20832083+ INIT_WORK(&xfrm_policy_gc_work, xfrm_policy_gc_task);20842084 register_netdevice_notifier(&xfrm_dev_notifier);20852085}20862086