这篇教程C++ wake_up_bit函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wake_up_bit函数的典型用法代码示例。如果您正苦于以下问题:C++ wake_up_bit函数的具体用法?C++ wake_up_bit怎么用?C++ wake_up_bit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wake_up_bit函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: nfs_writepagesint nfs_writepages(struct address_space *mapping, struct writeback_control *wbc){ struct inode *inode = mapping->host; unsigned long *bitlock = &NFS_I(inode)->flags; struct nfs_pageio_descriptor pgio; int err; /* Stop dirtying of new pages while we sync */ err = wait_on_bit_lock(bitlock, NFS_INO_FLUSHING, nfs_wait_bit_killable, TASK_KILLABLE); if (err) goto out_err; nfs_inc_stats(inode, NFSIOS_VFSWRITEPAGES); nfs_pageio_init_write(&pgio, inode, wb_priority(wbc)); err = write_cache_pages(mapping, wbc, nfs_writepages_callback, &pgio); nfs_pageio_complete(&pgio); clear_bit_unlock(NFS_INO_FLUSHING, bitlock); smp_mb__after_clear_bit(); wake_up_bit(bitlock, NFS_INO_FLUSHING); if (err < 0) goto out_err; err = pgio.pg_error; if (err < 0) goto out_err; return 0;out_err: return err;}
开发者ID:friackazoid,项目名称:linux-2.6,代码行数:32,
示例2: gdlm_recover_donestatic void gdlm_recover_done(void *arg, struct dlm_slot *slots, int num_slots, int our_slot, uint32_t generation){ struct gfs2_sbd *sdp = arg; struct lm_lockstruct *ls = &sdp->sd_lockstruct; /* ensure the ls jid arrays are large enough */ set_recover_size(sdp, slots, num_slots); spin_lock(&ls->ls_recover_spin); ls->ls_recover_start = generation; if (!ls->ls_recover_mount) { ls->ls_recover_mount = generation; ls->ls_jid = our_slot - 1; } if (!test_bit(DFL_UNMOUNT, &ls->ls_recover_flags)) queue_delayed_work(gfs2_control_wq, &sdp->sd_control_work, 0); clear_bit(DFL_DLM_RECOVERY, &ls->ls_recover_flags); smp_mb__after_atomic(); wake_up_bit(&ls->ls_recover_flags, DFL_DLM_RECOVERY); spin_unlock(&ls->ls_recover_spin);}
开发者ID:AudioGod,项目名称:Gods_kernel_yu_msm8916,代码行数:25,
示例3: fscache_object_lookup_negative/** * fscache_object_lookup_negative - Note negative cookie lookup * @object: Object pointing to cookie to mark * * Note negative lookup, permitting those waiting to read data from an already * existing backing object to continue as there's no data for them to read. */void fscache_object_lookup_negative(struct fscache_object *object){ struct fscache_cookie *cookie = object->cookie; _enter("{OBJ%x,%s}", object->debug_id, fscache_object_states[object->state]); spin_lock(&object->lock); if (object->state == FSCACHE_OBJECT_LOOKING_UP) { fscache_stat(&fscache_n_object_lookups_negative); /* transit here to allow write requests to begin stacking up * and read requests to begin returning ENODATA */ object->state = FSCACHE_OBJECT_CREATING; spin_unlock(&object->lock); set_bit(FSCACHE_COOKIE_PENDING_FILL, &cookie->flags); set_bit(FSCACHE_COOKIE_NO_DATA_YET, &cookie->flags); _debug("wake up lookup %p", &cookie->flags); smp_mb__before_clear_bit(); clear_bit(FSCACHE_COOKIE_LOOKING_UP, &cookie->flags); smp_mb__after_clear_bit(); wake_up_bit(&cookie->flags, FSCACHE_COOKIE_LOOKING_UP); set_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events); } else { ASSERTCMP(object->state, ==, FSCACHE_OBJECT_CREATING); spin_unlock(&object->lock); } _leave("");}
开发者ID:daveti,项目名称:prov-kernel,代码行数:39,
示例4: fscache_obtained_object/** * fscache_obtained_object - Note successful object lookup or creation * @object: Object pointing to cookie to mark * * Note successful lookup and/or creation, permitting those waiting to write * data to a backing object to continue. * * Note that after calling this, an object's cookie may be relinquished by the * netfs, and so must be accessed with object lock held. */void fscache_obtained_object(struct fscache_object *object){ struct fscache_cookie *cookie = object->cookie; _enter("{OBJ%x,%s}", object->debug_id, object->state->name); /* if we were still looking up, then we must have a positive lookup * result, in which case there may be data available */ if (!test_and_set_bit(FSCACHE_OBJECT_IS_LOOKED_UP, &object->flags)) { fscache_stat(&fscache_n_object_lookups_positive); /* We do (presumably) have data */ clear_bit_unlock(FSCACHE_COOKIE_NO_DATA_YET, &cookie->flags); clear_bit(FSCACHE_COOKIE_UNAVAILABLE, &cookie->flags); /* Allow write requests to begin stacking up and read requests * to begin shovelling data. */ clear_bit_unlock(FSCACHE_COOKIE_LOOKING_UP, &cookie->flags); wake_up_bit(&cookie->flags, FSCACHE_COOKIE_LOOKING_UP); } else { fscache_stat(&fscache_n_object_created); } set_bit(FSCACHE_OBJECT_IS_AVAILABLE, &object->flags); _leave("");}
开发者ID:AshishNamdev,项目名称:linux,代码行数:37,
示例5: gfs2_clear_glop_pendingstatic void gfs2_clear_glop_pending(struct gfs2_inode *ip){ if (!ip) return; clear_bit_unlock(GIF_GLOP_PENDING, &ip->i_flags); wake_up_bit(&ip->i_flags, GIF_GLOP_PENDING);}
开发者ID:multipath-tcp,项目名称:mptcp_net-next,代码行数:8,
示例6: dvb_usb_stop_feedstatic int dvb_usb_stop_feed(struct dvb_demux_feed *dvbdmxfeed){ struct dvb_usb_adapter *adap = dvbdmxfeed->demux->priv; struct dvb_usb_device *d = adap_to_d(adap); int ret = 0; dev_dbg(&d->udev->dev, "%s: adap=%d active_fe=%d feed_type=%d setting pid [%s]: %04x (%04d) at index %d/n", __func__, adap->id, adap->active_fe, dvbdmxfeed->type, adap->pid_filtering ? "yes" : "no", dvbdmxfeed->pid, dvbdmxfeed->pid, dvbdmxfeed->index); if (adap->active_fe == -1) return -EINVAL; /* remove PID from device HW PID filter */ if (adap->pid_filtering && adap->props->pid_filter) { ret = adap->props->pid_filter(adap, dvbdmxfeed->index, dvbdmxfeed->pid, 0); if (ret) dev_err(&d->udev->dev, "%s: pid_filter() failed=%d/n", KBUILD_MODNAME, ret); } /* we cannot stop streaming until last PID is removed */ if (--adap->feed_count > 0) goto skip_feed_stop; /* ask device to stop streaming */ if (d->props->streaming_ctrl) { ret = d->props->streaming_ctrl(adap->fe[adap->active_fe], 0); if (ret) dev_err(&d->udev->dev, "%s: streaming_ctrl() failed=%d/n", KBUILD_MODNAME, ret); } /* disable HW PID filter */ if (adap->pid_filtering && adap->props->pid_filter_ctrl) { ret = adap->props->pid_filter_ctrl(adap, 0); if (ret) dev_err(&d->udev->dev, "%s: pid_filter_ctrl() failed=%d/n", KBUILD_MODNAME, ret); } /* kill USB streaming packets */ usb_urb_killv2(&adap->stream); /* clear 'streaming' status bit */ clear_bit(ADAP_STREAMING, &adap->state_bits); smp_mb__after_atomic(); wake_up_bit(&adap->state_bits, ADAP_STREAMING);skip_feed_stop: if (ret) dev_dbg(&d->udev->dev, "%s: failed=%d/n", __func__, ret); return ret;}
开发者ID:adbensi,项目名称:kernel-odroidc-3.10.80-rt102,代码行数:58,
示例7: nfs_fscache_inode_unlock/* * Unlock cookie management lock */static inline void nfs_fscache_inode_unlock(struct inode *inode){ struct nfs_inode *nfsi = NFS_I(inode); smp_mb__before_clear_bit(); clear_bit(NFS_INO_FSCACHE_LOCK, &nfsi->flags); smp_mb__after_clear_bit(); wake_up_bit(&nfsi->flags, NFS_INO_FSCACHE_LOCK);}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:12,
示例8: fscache_run_op/* * start an op running */static void fscache_run_op(struct fscache_object *object, struct fscache_operation *op){ object->n_in_progress++; if (test_and_clear_bit(FSCACHE_OP_WAITING, &op->flags)) wake_up_bit(&op->flags, FSCACHE_OP_WAITING); if (op->processor) fscache_enqueue_operation(op); fscache_stat(&fscache_n_op_run);}
开发者ID:rrowicki,项目名称:Chrono_Kernel-1,代码行数:13,
示例9: afs_vl_probe_donestatic bool afs_vl_probe_done(struct afs_vlserver *server){ if (!atomic_dec_and_test(&server->probe_outstanding)) return false; wake_up_var(&server->probe_outstanding); clear_bit_unlock(AFS_VLSERVER_FL_PROBING, &server->flags); wake_up_bit(&server->flags, AFS_VLSERVER_FL_PROBING); return true;}
开发者ID:avagin,项目名称:linux,代码行数:10,
示例10: nfs_page_group_unlock/* * nfs_page_group_unlock - unlock the head of the page group * @req - request in group that is to be unlocked */voidnfs_page_group_unlock(struct nfs_page *req){ struct nfs_page *head = req->wb_head; WARN_ON_ONCE(head != head->wb_head); smp_mb__before_atomic(); clear_bit(PG_HEADLOCK, &head->wb_flags); smp_mb__after_atomic(); wake_up_bit(&head->wb_flags, PG_HEADLOCK);}
开发者ID:FT-Liang,项目名称:linux,代码行数:16,
示例11: xfs_inode_item_unpinSTATIC voidxfs_inode_item_unpin( struct xfs_log_item *lip, int remove){ struct xfs_inode *ip = INODE_ITEM(lip)->ili_inode; trace_xfs_inode_unpin(ip, _RET_IP_); ASSERT(atomic_read(&ip->i_pincount) > 0); if (atomic_dec_and_test(&ip->i_pincount)) wake_up_bit(&ip->i_flags, __XFS_IPINNED_BIT);}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:12,
示例12: fscache_obtained_object/** * fscache_obtained_object - Note successful object lookup or creation * @object: Object pointing to cookie to mark * * Note successful lookup and/or creation, permitting those waiting to write * data to a backing object to continue. * * Note that after calling this, an object's cookie may be relinquished by the * netfs, and so must be accessed with object lock held. */void fscache_obtained_object(struct fscache_object *object){ struct fscache_cookie *cookie = object->cookie; _enter("{OBJ%x,%s}", object->debug_id, fscache_object_states[object->state]); /* if we were still looking up, then we must have a positive lookup * result, in which case there may be data available */ spin_lock(&object->lock); if (object->state == FSCACHE_OBJECT_LOOKING_UP) { fscache_stat(&fscache_n_object_lookups_positive); clear_bit(FSCACHE_COOKIE_NO_DATA_YET, &cookie->flags); object->state = FSCACHE_OBJECT_AVAILABLE; spin_unlock(&object->lock); smp_mb__before_clear_bit(); clear_bit(FSCACHE_COOKIE_LOOKING_UP, &cookie->flags); smp_mb__after_clear_bit(); wake_up_bit(&cookie->flags, FSCACHE_COOKIE_LOOKING_UP); set_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events); } else { ASSERTCMP(object->state, ==, FSCACHE_OBJECT_CREATING); fscache_stat(&fscache_n_object_created); object->state = FSCACHE_OBJECT_AVAILABLE; spin_unlock(&object->lock); set_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events); smp_wmb(); } if (test_and_clear_bit(FSCACHE_COOKIE_CREATING, &cookie->flags)) wake_up_bit(&cookie->flags, FSCACHE_COOKIE_CREATING); _leave("");}
开发者ID:daveti,项目名称:prov-kernel,代码行数:48,
示例13: fscache_object_available/* * handle an object that has just become available */static void fscache_object_available(struct fscache_object *object){ _enter("{OBJ%x}", object->debug_id); spin_lock(&object->lock); if (object->cookie && test_and_clear_bit(FSCACHE_COOKIE_CREATING, &object->cookie->flags)) wake_up_bit(&object->cookie->flags, FSCACHE_COOKIE_CREATING); fscache_done_parent_op(object); if (object->n_in_progress == 0) { if (object->n_ops > 0) { ASSERTCMP(object->n_ops, >=, object->n_obj_ops); fscache_start_operations(object); } else {
开发者ID:daveti,项目名称:prov-kernel,代码行数:19,
示例14: tux3_mark_inode_to_delete/* * Mark inode dirty to delete. (called from ->drop_inode()). * Caller must hold inode->i_lock. */void tux3_mark_inode_to_delete(struct inode *inode){ struct sb *sb = tux_sb(inode->i_sb); struct tux3_inode *tuxnode = tux_inode(inode); unsigned delta; /* inode has dead mark already */ if (tux3_inode_is_dead(tuxnode)) return; change_begin_atomic(sb); delta = tux3_inode_delta(inode); __tux3_mark_inode_to_delete(inode, delta); /* * Hack: this is called under inode->i_lock. So, we have to * release inode->i_lock to call mark_inode_dirty_sync(). * * FIXME: we want to set I_DIRTY_SYNC (I_DIRTY_SYNC will * prevent the indo is freed) and wakeup flusher if need, * while preventing inode is freed. Need better way to do. */ if (!(tux3_dirty_flags(inode, delta) & I_DIRTY_SYNC)) { /* FIXME: I_REFERENCED can't prevent completely */ //inode->i_state |= I_REFERENCED; /* FIXME: I_WILL_FREE will bother igrab() grabs reference */ inode->i_state |= I_WILL_FREE; spin_unlock(&inode->i_lock); /* Tell dead inode to backend by marking as dirty. */ tux3_mark_inode_dirty_sync(inode); spin_lock(&inode->i_lock); inode->i_state &= ~I_WILL_FREE;#ifdef __KERNEL__ wake_up_bit(&inode->i_state, __I_NEW);#endif } change_end_atomic(sb);}
开发者ID:daiyy,项目名称:linux-tux3,代码行数:46,
示例15: fscache_object_lookup_negative/** * fscache_object_lookup_negative - Note negative cookie lookup * @object: Object pointing to cookie to mark * * Note negative lookup, permitting those waiting to read data from an already * existing backing object to continue as there's no data for them to read. */void fscache_object_lookup_negative(struct fscache_object *object){ struct fscache_cookie *cookie = object->cookie; _enter("{OBJ%x,%s}", object->debug_id, object->state->name); if (!test_and_set_bit(FSCACHE_OBJECT_IS_LOOKED_UP, &object->flags)) { fscache_stat(&fscache_n_object_lookups_negative); /* Allow write requests to begin stacking up and read requests to begin * returning ENODATA. */ set_bit(FSCACHE_COOKIE_NO_DATA_YET, &cookie->flags); clear_bit(FSCACHE_COOKIE_UNAVAILABLE, &cookie->flags); _debug("wake up lookup %p", &cookie->flags); clear_bit_unlock(FSCACHE_COOKIE_LOOKING_UP, &cookie->flags); wake_up_bit(&cookie->flags, FSCACHE_COOKIE_LOOKING_UP); } _leave("");}
开发者ID:AshishNamdev,项目名称:linux,代码行数:28,
示例16: dvb_usb_fe_sleepstatic int dvb_usb_fe_sleep(struct dvb_frontend *fe){ int ret; struct dvb_usb_adapter *adap = fe->dvb->priv; struct dvb_usb_device *d = adap_to_d(adap); dev_dbg(&d->udev->dev, "%s: adap=%d fe=%d/n", __func__, adap->id, fe->id); if (!adap->suspend_resume_active) { set_bit(ADAP_SLEEP, &adap->state_bits); wait_on_bit(&adap->state_bits, ADAP_STREAMING, TASK_UNINTERRUPTIBLE); } if (adap->fe_sleep[fe->id]) { ret = adap->fe_sleep[fe->id](fe); if (ret < 0) goto err; } if (d->props->frontend_ctrl) { ret = d->props->frontend_ctrl(fe, 0); if (ret < 0) goto err; } ret = dvb_usbv2_device_power_ctrl(d, 0); if (ret < 0) goto err;err: if (!adap->suspend_resume_active) { adap->active_fe = -1; clear_bit(ADAP_SLEEP, &adap->state_bits); smp_mb__after_atomic(); wake_up_bit(&adap->state_bits, ADAP_SLEEP); } dev_dbg(&d->udev->dev, "%s: ret=%d/n", __func__, ret); return ret;}
开发者ID:adbensi,项目名称:kernel-odroidc-3.10.80-rt102,代码行数:40,
示例17: dvb_usb_fe_initstatic int dvb_usb_fe_init(struct dvb_frontend *fe){ int ret; struct dvb_usb_adapter *adap = fe->dvb->priv; struct dvb_usb_device *d = adap_to_d(adap); dev_dbg(&d->udev->dev, "%s: adap=%d fe=%d/n", __func__, adap->id, fe->id); if (!adap->suspend_resume_active) { adap->active_fe = fe->id; set_bit(ADAP_INIT, &adap->state_bits); } ret = dvb_usbv2_device_power_ctrl(d, 1); if (ret < 0) goto err; if (d->props->frontend_ctrl) { ret = d->props->frontend_ctrl(fe, 1); if (ret < 0) goto err; } if (adap->fe_init[fe->id]) { ret = adap->fe_init[fe->id](fe); if (ret < 0) goto err; }err: if (!adap->suspend_resume_active) { clear_bit(ADAP_INIT, &adap->state_bits); smp_mb__after_atomic(); wake_up_bit(&adap->state_bits, ADAP_INIT); } dev_dbg(&d->udev->dev, "%s: ret=%d/n", __func__, ret); return ret;}
开发者ID:adbensi,项目名称:kernel-odroidc-3.10.80-rt102,代码行数:38,
示例18: id_to_sidstatic intid_to_sid(unsigned long cid, uint sidtype, struct cifs_sid *ssid){ int rc = 0; struct key *sidkey; const struct cred *saved_cred; struct cifs_sid *lsid; struct cifs_sid_id *psidid, *npsidid; struct rb_root *cidtree; spinlock_t *cidlock; if (sidtype == SIDOWNER) { cidlock = &siduidlock; cidtree = &uidtree; } else if (sidtype == SIDGROUP) { cidlock = &sidgidlock; cidtree = &gidtree; } else return -EINVAL; spin_lock(cidlock); psidid = sid_rb_search(cidtree, cid); if (!psidid) { spin_unlock(cidlock); npsidid = kzalloc(sizeof(struct cifs_sid_id), GFP_KERNEL); if (!npsidid) return -ENOMEM; npsidid->sidstr = kmalloc(SIDLEN, GFP_KERNEL); if (!npsidid->sidstr) { kfree(npsidid); return -ENOMEM; } spin_lock(cidlock); psidid = sid_rb_search(cidtree, cid); if (psidid) { ++psidid->refcount; spin_unlock(cidlock); kfree(npsidid->sidstr); kfree(npsidid); } else { psidid = npsidid; sid_rb_insert(cidtree, cid, &psidid, sidtype == SIDOWNER ? "oi:" : "gi:"); ++psidid->refcount; spin_unlock(cidlock); } } else { ++psidid->refcount; spin_unlock(cidlock); } if (test_bit(SID_ID_MAPPED, &psidid->state)) { memcpy(ssid, &psidid->sid, sizeof(struct cifs_sid)); psidid->time = jiffies; goto id_sid_out; } if (time_after(psidid->time + SID_MAP_RETRY, jiffies)) { rc = -EINVAL; goto id_sid_out; } if (!test_and_set_bit(SID_ID_PENDING, &psidid->state)) { saved_cred = override_creds(root_cred); sidkey = request_key(&cifs_idmap_key_type, psidid->sidstr, ""); if (IS_ERR(sidkey)) { rc = -EINVAL; cFYI(1, "%s: Can't map and id to a SID", __func__); } else { lsid = (struct cifs_sid *)sidkey->payload.data; memcpy(&psidid->sid, lsid, sidkey->datalen < sizeof(struct cifs_sid) ? sidkey->datalen : sizeof(struct cifs_sid)); memcpy(ssid, &psidid->sid, sidkey->datalen < sizeof(struct cifs_sid) ? sidkey->datalen : sizeof(struct cifs_sid)); set_bit(SID_ID_MAPPED, &psidid->state); key_put(sidkey); kfree(psidid->sidstr); } psidid->time = jiffies; revert_creds(saved_cred); clear_bit(SID_ID_PENDING, &psidid->state); wake_up_bit(&psidid->state, SID_ID_PENDING); } else { rc = wait_on_bit(&psidid->state, SID_ID_PENDING, sidid_pending_wait, TASK_INTERRUPTIBLE); if (rc) { cFYI(1, "%s: sidid_pending_wait interrupted %d", __func__, rc); --psidid->refcount; return rc; } if (test_bit(SID_ID_MAPPED, &psidid->state)) memcpy(ssid, &psidid->sid, sizeof(struct cifs_sid)); else rc = -EINVAL;//.........这里部分代码省略.........
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:101,
示例19: afs_update_cell/* * Update a cell's VL server address list from the DNS. */static void afs_update_cell(struct afs_cell *cell){ struct afs_vlserver_list *vllist, *old; unsigned int min_ttl = READ_ONCE(afs_cell_min_ttl); unsigned int max_ttl = READ_ONCE(afs_cell_max_ttl); time64_t now, expiry = 0; _enter("%s", cell->name); vllist = afs_dns_query(cell, &expiry); now = ktime_get_real_seconds(); if (min_ttl > max_ttl) max_ttl = min_ttl; if (expiry < now + min_ttl) expiry = now + min_ttl; else if (expiry > now + max_ttl) expiry = now + max_ttl; if (IS_ERR(vllist)) { switch (PTR_ERR(vllist)) { case -ENODATA: case -EDESTADDRREQ: /* The DNS said that the cell does not exist or there * weren't any addresses to be had. */ set_bit(AFS_CELL_FL_NOT_FOUND, &cell->flags); clear_bit(AFS_CELL_FL_DNS_FAIL, &cell->flags); cell->dns_expiry = expiry; break; case -EAGAIN: case -ECONNREFUSED: default: set_bit(AFS_CELL_FL_DNS_FAIL, &cell->flags); cell->dns_expiry = now + 10; break; } cell->error = -EDESTADDRREQ; } else { clear_bit(AFS_CELL_FL_DNS_FAIL, &cell->flags); clear_bit(AFS_CELL_FL_NOT_FOUND, &cell->flags); /* Exclusion on changing vl_addrs is achieved by a * non-reentrant work item. */ old = rcu_dereference_protected(cell->vl_servers, true); rcu_assign_pointer(cell->vl_servers, vllist); cell->dns_expiry = expiry; if (old) afs_put_vlserverlist(cell->net, old); } if (test_and_clear_bit(AFS_CELL_FL_NO_LOOKUP_YET, &cell->flags)) wake_up_bit(&cell->flags, AFS_CELL_FL_NO_LOOKUP_YET); now = ktime_get_real_seconds(); afs_set_cell_timer(cell->net, cell->dns_expiry - now); _leave("");}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:65,
示例20: fscache_object_state_machine/* * process events that have been sent to an object's state machine * - initiates parent lookup * - does object lookup * - does object creation * - does object recycling and retirement * - does object withdrawal */static void fscache_object_state_machine(struct fscache_object *object){ enum fscache_object_state new_state; struct fscache_cookie *cookie; ASSERT(object != NULL); _enter("{OBJ%x,%s,%lx}", object->debug_id, fscache_object_states[object->state], object->events); switch (object->state) { /* wait for the parent object to become ready */ case FSCACHE_OBJECT_INIT: object->event_mask = ULONG_MAX & ~(1 << FSCACHE_OBJECT_EV_CLEARED); fscache_initialise_object(object); goto done; /* look up the object metadata on disk */ case FSCACHE_OBJECT_LOOKING_UP: fscache_lookup_object(object); goto lookup_transit; /* create the object metadata on disk */ case FSCACHE_OBJECT_CREATING: fscache_lookup_object(object); goto lookup_transit; /* handle an object becoming available; start pending * operations and queue dependent operations for processing */ case FSCACHE_OBJECT_AVAILABLE: fscache_object_available(object); goto active_transit; /* normal running state */ case FSCACHE_OBJECT_ACTIVE: goto active_transit; /* Invalidate an object on disk */ case FSCACHE_OBJECT_INVALIDATING: clear_bit(FSCACHE_OBJECT_EV_INVALIDATE, &object->events); fscache_stat(&fscache_n_invalidates_run); fscache_stat(&fscache_n_cop_invalidate_object); fscache_invalidate_object(object); fscache_stat_d(&fscache_n_cop_invalidate_object); fscache_raise_event(object, FSCACHE_OBJECT_EV_UPDATE); goto active_transit; /* update the object metadata on disk */ case FSCACHE_OBJECT_UPDATING: clear_bit(FSCACHE_OBJECT_EV_UPDATE, &object->events); fscache_stat(&fscache_n_updates_run); fscache_stat(&fscache_n_cop_update_object); object->cache->ops->update_object(object); fscache_stat_d(&fscache_n_cop_update_object); goto active_transit; /* handle an object dying during lookup or creation */ case FSCACHE_OBJECT_LC_DYING: object->event_mask &= ~(1 << FSCACHE_OBJECT_EV_UPDATE); fscache_stat(&fscache_n_cop_lookup_complete); object->cache->ops->lookup_complete(object); fscache_stat_d(&fscache_n_cop_lookup_complete); spin_lock(&object->lock); object->state = FSCACHE_OBJECT_DYING; cookie = object->cookie; if (cookie) { if (test_and_clear_bit(FSCACHE_COOKIE_LOOKING_UP, &cookie->flags)) wake_up_bit(&cookie->flags, FSCACHE_COOKIE_LOOKING_UP); if (test_and_clear_bit(FSCACHE_COOKIE_CREATING, &cookie->flags)) wake_up_bit(&cookie->flags, FSCACHE_COOKIE_CREATING); } spin_unlock(&object->lock); fscache_done_parent_op(object); /* wait for completion of all active operations on this object * and the death of all child objects of this object */ case FSCACHE_OBJECT_DYING: dying: clear_bit(FSCACHE_OBJECT_EV_CLEARED, &object->events); spin_lock(&object->lock); _debug("dying OBJ%x {%d,%d}", object->debug_id, object->n_ops, object->n_children); if (object->n_ops == 0 && object->n_children == 0) { object->event_mask &=//.........这里部分代码省略.........
开发者ID:daveti,项目名称:prov-kernel,代码行数:101,
示例21: fscache_invalidation_complete/* * Notify netfs of invalidation completion. */static inline void fscache_invalidation_complete(struct fscache_cookie *cookie){ if (test_and_clear_bit(FSCACHE_COOKIE_INVALIDATING, &cookie->flags)) wake_up_bit(&cookie->flags, FSCACHE_COOKIE_INVALIDATING);}
开发者ID:daveti,项目名称:prov-kernel,代码行数:8,
示例22: afs_manage_cell/* * Manage a cell record, initialising and destroying it, maintaining its DNS * records. */static void afs_manage_cell(struct work_struct *work){ struct afs_cell *cell = container_of(work, struct afs_cell, manager); struct afs_net *net = cell->net; bool deleted; int ret, usage; _enter("%s", cell->name);again: _debug("state %u", cell->state); switch (cell->state) { case AFS_CELL_INACTIVE: case AFS_CELL_FAILED: write_seqlock(&net->cells_lock); usage = 1; deleted = atomic_try_cmpxchg_relaxed(&cell->usage, &usage, 0); if (deleted) rb_erase(&cell->net_node, &net->cells); write_sequnlock(&net->cells_lock); if (deleted) goto final_destruction; if (cell->state == AFS_CELL_FAILED) goto done; cell->state = AFS_CELL_UNSET; goto again; case AFS_CELL_UNSET: cell->state = AFS_CELL_ACTIVATING; goto again; case AFS_CELL_ACTIVATING: ret = afs_activate_cell(net, cell); if (ret < 0) goto activation_failed; cell->state = AFS_CELL_ACTIVE; smp_wmb(); clear_bit(AFS_CELL_FL_NOT_READY, &cell->flags); wake_up_bit(&cell->flags, AFS_CELL_FL_NOT_READY); goto again; case AFS_CELL_ACTIVE: if (atomic_read(&cell->usage) > 1) { time64_t now = ktime_get_real_seconds(); if (cell->dns_expiry <= now && net->live) afs_update_cell(cell); goto done; } cell->state = AFS_CELL_DEACTIVATING; goto again; case AFS_CELL_DEACTIVATING: set_bit(AFS_CELL_FL_NOT_READY, &cell->flags); if (atomic_read(&cell->usage) > 1) goto reverse_deactivation; afs_deactivate_cell(net, cell); cell->state = AFS_CELL_INACTIVE; goto again; default: break; } _debug("bad state %u", cell->state); BUG(); /* Unhandled state */activation_failed: cell->error = ret; afs_deactivate_cell(net, cell); cell->state = AFS_CELL_FAILED; smp_wmb(); if (test_and_clear_bit(AFS_CELL_FL_NOT_READY, &cell->flags)) wake_up_bit(&cell->flags, AFS_CELL_FL_NOT_READY); goto again;reverse_deactivation: cell->state = AFS_CELL_ACTIVE; smp_wmb(); clear_bit(AFS_CELL_FL_NOT_READY, &cell->flags); wake_up_bit(&cell->flags, AFS_CELL_FL_NOT_READY); _leave(" [deact->act]"); return;done: _leave(" [done %u]", cell->state); return;final_destruction: call_rcu(&cell->rcu, afs_cell_destroy); afs_dec_cells_outstanding(net); _leave(" [destruct %d]", atomic_read(&net->cells_outstanding));}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:97,
示例23: wake_up_aststatic void wake_up_ast(struct gdlm_lock *lp){ clear_bit(LFL_AST_WAIT, &lp->flags); smp_mb__after_clear_bit(); wake_up_bit(&lp->flags, LFL_AST_WAIT);}
开发者ID:Tigrouzen,项目名称:k1099,代码行数:6,
示例24: fscache_object_state_machinestatic void fscache_object_state_machine(struct fscache_object *object){ enum fscache_object_state new_state; struct fscache_cookie *cookie; ASSERT(object != NULL); _enter("{OBJ%x,%s,%lx}", object->debug_id, fscache_object_states[object->state], object->events); switch (object->state) { case FSCACHE_OBJECT_INIT: object->event_mask = ULONG_MAX & ~(1 << FSCACHE_OBJECT_EV_CLEARED); fscache_initialise_object(object); goto done; case FSCACHE_OBJECT_LOOKING_UP: fscache_lookup_object(object); goto lookup_transit; case FSCACHE_OBJECT_CREATING: fscache_lookup_object(object); goto lookup_transit; case FSCACHE_OBJECT_AVAILABLE: fscache_object_available(object); goto active_transit; case FSCACHE_OBJECT_ACTIVE: goto active_transit; case FSCACHE_OBJECT_UPDATING: clear_bit(FSCACHE_OBJECT_EV_UPDATE, &object->events); fscache_stat(&fscache_n_updates_run); fscache_stat(&fscache_n_cop_update_object); object->cache->ops->update_object(object); fscache_stat_d(&fscache_n_cop_update_object); goto active_transit; case FSCACHE_OBJECT_LC_DYING: object->event_mask &= ~(1 << FSCACHE_OBJECT_EV_UPDATE); fscache_stat(&fscache_n_cop_lookup_complete); object->cache->ops->lookup_complete(object); fscache_stat_d(&fscache_n_cop_lookup_complete); spin_lock(&object->lock); object->state = FSCACHE_OBJECT_DYING; cookie = object->cookie; if (cookie) { if (test_and_clear_bit(FSCACHE_COOKIE_LOOKING_UP, &cookie->flags)) wake_up_bit(&cookie->flags, FSCACHE_COOKIE_LOOKING_UP); if (test_and_clear_bit(FSCACHE_COOKIE_CREATING, &cookie->flags)) wake_up_bit(&cookie->flags, FSCACHE_COOKIE_CREATING); } spin_unlock(&object->lock); fscache_done_parent_op(object); case FSCACHE_OBJECT_DYING: dying: clear_bit(FSCACHE_OBJECT_EV_CLEARED, &object->events); spin_lock(&object->lock); _debug("dying OBJ%x {%d,%d}", object->debug_id, object->n_ops, object->n_children); if (object->n_ops == 0 && object->n_children == 0) { object->event_mask &= ~(1 << FSCACHE_OBJECT_EV_CLEARED); object->event_mask |= (1 << FSCACHE_OBJECT_EV_WITHDRAW) | (1 << FSCACHE_OBJECT_EV_RETIRE) | (1 << FSCACHE_OBJECT_EV_RELEASE) | (1 << FSCACHE_OBJECT_EV_ERROR); } else { object->event_mask &= ~((1 << FSCACHE_OBJECT_EV_WITHDRAW) | (1 << FSCACHE_OBJECT_EV_RETIRE) | (1 << FSCACHE_OBJECT_EV_RELEASE) | (1 << FSCACHE_OBJECT_EV_ERROR)); object->event_mask |= 1 << FSCACHE_OBJECT_EV_CLEARED; } spin_unlock(&object->lock); fscache_enqueue_dependents(object); fscache_start_operations(object); goto terminal_transit; case FSCACHE_OBJECT_ABORT_INIT://.........这里部分代码省略.........
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:101,
示例25: journal_commit_transaction//.........这里部分代码省略......... JBUFFER_TRACE(jh, "ph4: unfile after journal write"); journal_unfile_buffer(journal, jh); /* * ->t_iobuf_list should contain only dummy buffer_heads * which were created by journal_write_metadata_buffer(). */ BUFFER_TRACE(bh, "dumping temporary bh"); journal_put_journal_head(jh); __brelse(bh); J_ASSERT_BH(bh, atomic_read(&bh->b_count) == 0); free_buffer_head(bh); /* We also have to unlock and free the corresponding shadowed buffer */ jh = commit_transaction->t_shadow_list->b_tprev; bh = jh2bh(jh); clear_buffer_jwrite(bh); J_ASSERT_BH(bh, buffer_jbddirty(bh)); /* The metadata is now released for reuse, but we need to remember it against this transaction so that when we finally commit, we can do any checkpointing required. */ JBUFFER_TRACE(jh, "file as BJ_Forget"); journal_file_buffer(jh, commit_transaction, BJ_Forget); /* * Wake up any transactions which were waiting for this * IO to complete. The barrier must be here so that changes * by journal_file_buffer() take effect before wake_up_bit() * does the waitqueue check. */ smp_mb(); wake_up_bit(&bh->b_state, BH_Unshadow); JBUFFER_TRACE(jh, "brelse shadowed buffer"); __brelse(bh); } J_ASSERT (commit_transaction->t_shadow_list == NULL); jbd_debug(3, "JBD: commit phase 5/n"); /* Here we wait for the revoke record and descriptor record buffers */ wait_for_ctlbuf: while (commit_transaction->t_log_list != NULL) { struct buffer_head *bh; jh = commit_transaction->t_log_list->b_tprev; bh = jh2bh(jh); if (buffer_locked(bh)) { wait_on_buffer(bh); goto wait_for_ctlbuf; } if (cond_resched()) goto wait_for_ctlbuf; if (unlikely(!buffer_uptodate(bh))) err = -EIO; BUFFER_TRACE(bh, "ph5: control buffer writeout done: unfile"); clear_buffer_jwrite(bh); journal_unfile_buffer(journal, jh); journal_put_journal_head(jh); __brelse(bh); /* One for getblk */ /* AKPM: bforget here */ }
开发者ID:33d,项目名称:linux-2.6.21-hh20,代码行数:67,
示例26: key_garbage_collector//.........这里部分代码省略.........contended: spin_unlock(&key_serial_lock);maybe_resched: if (cursor) { cond_resched(); spin_lock(&key_serial_lock); goto continue_scanning; } /* We've completed the pass. Set the timer if we need to and queue a * new cycle if necessary. We keep executing cycles until we find one * where we didn't reap any keys. */ kdebug("pass complete"); if (gc_state & KEY_GC_SET_TIMER && new_timer != (time_t)LONG_MAX) { new_timer += key_gc_delay; key_schedule_gc(new_timer); } if (unlikely(gc_state & KEY_GC_REAPING_DEAD_2) || !list_empty(&graveyard)) { /* Make sure that all pending keyring payload destructions are * fulfilled and that people aren't now looking at dead or * dying keys that they don't have a reference upon or a link * to. */ kdebug("gc sync"); synchronize_rcu(); } if (!list_empty(&graveyard)) { kdebug("gc keys"); key_gc_unused_keys(&graveyard); } if (unlikely(gc_state & (KEY_GC_REAPING_DEAD_1 | KEY_GC_REAPING_DEAD_2))) { if (!(gc_state & KEY_GC_FOUND_DEAD_KEY)) { /* No remaining dead keys: short circuit the remaining * keytype reap cycles. */ kdebug("dead short"); gc_state &= ~(KEY_GC_REAPING_DEAD_1 | KEY_GC_REAPING_DEAD_2); gc_state |= KEY_GC_REAPING_DEAD_3; } else { gc_state |= KEY_GC_REAP_AGAIN; } } if (unlikely(gc_state & KEY_GC_REAPING_DEAD_3)) { kdebug("dead wake"); smp_mb(); clear_bit(KEY_GC_REAPING_KEYTYPE, &key_gc_flags); wake_up_bit(&key_gc_flags, KEY_GC_REAPING_KEYTYPE); } if (gc_state & KEY_GC_REAP_AGAIN) schedule_work(&key_gc_work); kleave(" [end %x]", gc_state); return; /* We found an unreferenced key - once we've removed it from the tree, * we can safely drop the lock. */found_unreferenced_key: kdebug("unrefd key %d", key->serial); rb_erase(&key->serial_node, &key_serial_tree); spin_unlock(&key_serial_lock); list_add_tail(&key->graveyard_link, &graveyard); gc_state |= KEY_GC_REAP_AGAIN; goto maybe_resched; /* We found a keyring and we need to check the payload for links to * dead or expired keys. We don't flag another reap immediately as we * have to wait for the old payload to be destroyed by RCU before we * can reap the keys to which it refers. */found_keyring: spin_unlock(&key_serial_lock); kdebug("scan keyring %d", key->serial); key_gc_keyring(key, limit); goto maybe_resched; /* We found a dead key that is still referenced. Reset its type and * destroy its payload with its semaphore held. */destroy_dead_key: spin_unlock(&key_serial_lock); kdebug("destroy key %d", key->serial); down_write(&key->sem); key->type = &key_type_dead; if (key_gc_dead_keytype->destroy) key_gc_dead_keytype->destroy(key); memset(&key->payload, KEY_DESTROY, sizeof(key->payload)); up_write(&key->sem); goto maybe_resched;}
开发者ID:adyjl,项目名称:DORIMANX_LG_STOCK_LP_KERNEL,代码行数:101,
示例27: gdlm_mountstatic int gdlm_mount(struct gfs2_sbd *sdp, const char *table){ struct lm_lockstruct *ls = &sdp->sd_lockstruct; char cluster[GFS2_LOCKNAME_LEN]; const char *fsname; uint32_t flags; int error, ops_result; /* * initialize everything */ INIT_DELAYED_WORK(&sdp->sd_control_work, gfs2_control_func); spin_lock_init(&ls->ls_recover_spin); ls->ls_recover_flags = 0; ls->ls_recover_mount = 0; ls->ls_recover_start = 0; ls->ls_recover_block = 0; ls->ls_recover_size = 0; ls->ls_recover_submit = NULL; ls->ls_recover_result = NULL; ls->ls_lvb_bits = NULL; error = set_recover_size(sdp, NULL, 0); if (error) goto fail; /* * prepare dlm_new_lockspace args */ fsname = strchr(table, ':'); if (!fsname) { fs_info(sdp, "no fsname found/n"); error = -EINVAL; goto fail_free; } memset(cluster, 0, sizeof(cluster)); memcpy(cluster, table, strlen(table) - strlen(fsname)); fsname++; flags = DLM_LSFL_FS | DLM_LSFL_NEWEXCL; /* * create/join lockspace */ error = dlm_new_lockspace(fsname, cluster, flags, GDLM_LVB_SIZE, &gdlm_lockspace_ops, sdp, &ops_result, &ls->ls_dlm); if (error) { fs_err(sdp, "dlm_new_lockspace error %d/n", error); goto fail_free; } if (ops_result < 0) { /* * dlm does not support ops callbacks, * old dlm_controld/gfs_controld are used, try without ops. */ fs_info(sdp, "dlm lockspace ops not used/n"); free_recover_size(ls); set_bit(DFL_NO_DLM_OPS, &ls->ls_recover_flags); return 0; } if (!test_bit(SDF_NOJOURNALID, &sdp->sd_flags)) { fs_err(sdp, "dlm lockspace ops disallow jid preset/n"); error = -EINVAL; goto fail_release; } /* * control_mount() uses control_lock to determine first mounter, * and for later mounts, waits for any recoveries to be cleared. */ error = control_mount(sdp); if (error) { fs_err(sdp, "mount control error %d/n", error); goto fail_release; } ls->ls_first = !!test_bit(DFL_FIRST_MOUNT, &ls->ls_recover_flags); clear_bit(SDF_NOJOURNALID, &sdp->sd_flags); smp_mb__after_atomic(); wake_up_bit(&sdp->sd_flags, SDF_NOJOURNALID); return 0;fail_release: dlm_release_lockspace(ls->ls_dlm, 2);fail_free: free_recover_size(ls);fail: return error;}
开发者ID:AudioGod,项目名称:Gods_kernel_yu_msm8916,代码行数:96,
示例28: sid_to_idstatic intsid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid, struct cifs_fattr *fattr, uint sidtype){ int rc; unsigned long cid; struct key *idkey; const struct cred *saved_cred; struct cifs_sid_id *psidid, *npsidid; struct rb_root *cidtree; spinlock_t *cidlock; if (sidtype == SIDOWNER) { cid = cifs_sb->mnt_uid; cidlock = &siduidlock; cidtree = &uidtree; } else if (sidtype == SIDGROUP) { cid = cifs_sb->mnt_gid; cidlock = &sidgidlock; cidtree = &gidtree; } else return -ENOENT; spin_lock(cidlock); psidid = id_rb_search(cidtree, psid); if (!psidid) { spin_unlock(cidlock); npsidid = kzalloc(sizeof(struct cifs_sid_id), GFP_KERNEL); if (!npsidid) return -ENOMEM; npsidid->sidstr = kmalloc(SIDLEN, GFP_KERNEL); if (!npsidid->sidstr) { kfree(npsidid); return -ENOMEM; } spin_lock(cidlock); psidid = id_rb_search(cidtree, psid); if (psidid) { ++psidid->refcount; spin_unlock(cidlock); kfree(npsidid->sidstr); kfree(npsidid); } else { psidid = npsidid; id_rb_insert(cidtree, psid, &psidid, sidtype == SIDOWNER ? "os:" : "gs:"); ++psidid->refcount; spin_unlock(cidlock); } } else { ++psidid->refcount; spin_unlock(cidlock); } if (test_bit(SID_ID_MAPPED, &psidid->state)) { cid = psidid->id; psidid->time = jiffies; goto sid_to_id_out; } if (time_after(psidid->time + SID_MAP_RETRY, jiffies)) goto sid_to_id_out; if (!test_and_set_bit(SID_ID_PENDING, &psidid->state)) { saved_cred = override_creds(root_cred); idkey = request_key(&cifs_idmap_key_type, psidid->sidstr, ""); if (IS_ERR(idkey)) cFYI(1, "%s: Can't map SID to an id", __func__); else { cid = *(unsigned long *)idkey->payload.value; psidid->id = cid; set_bit(SID_ID_MAPPED, &psidid->state); key_put(idkey); kfree(psidid->sidstr); } revert_creds(saved_cred); psidid->time = jiffies; clear_bit(SID_ID_PENDING, &psidid->state); wake_up_bit(&psidid->state, SID_ID_PENDING); } else { rc = wait_on_bit(&psidid->state, SID_ID_PENDING, sidid_pending_wait, TASK_INTERRUPTIBLE); if (rc) { cFYI(1, "%s: sidid_pending_wait interrupted %d", __func__, rc); --psidid->refcount; return rc; } if (test_bit(SID_ID_MAPPED, &psidid->state)) cid = psidid->id; }sid_to_id_out: --psidid->refcount; if (sidtype == SIDOWNER) fattr->cf_uid = cid; else//.........这里部分代码省略.........
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:101,
注:本文中的wake_up_bit函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ wake_up_interruptible_all函数代码示例 C++ wake_up_all函数代码示例 |