Ejemplo n.º 1
0
static void au_nhash_de_do_free(struct hlist_head *head)
{
	struct au_vdir_dehstr *pos;
	struct hlist_node *node;

	hlist_for_each_entry_safe(pos, node, head, hash)
		au_cache_free_vdir_dehstr(pos);
}
Ejemplo n.º 2
0
static void au_nhash_wh_do_free(struct hlist_head *head)
{
	struct au_vdir_wh *pos;
	struct hlist_node *node;

	hlist_for_each_entry_safe(pos, node, head, wh_hash)
		kfree(pos);
}
/* Calls registered user return notifiers */
void fire_user_return_notifiers(void)
{
	struct user_return_notifier *urn;
	struct hlist_node *tmp1, *tmp2;
	struct hlist_head *head;

	head = &get_cpu_var(return_notifier_list);
	hlist_for_each_entry_safe(urn, tmp1, tmp2, head, link)
		urn->on_user_return(urn);
	put_cpu_var(return_notifier_list);
}
Ejemplo n.º 4
0
static void kvmppc_mmu_pte_flush_all(struct kvm_vcpu *vcpu)
{
	struct hpte_cache *pte;
	struct hlist_node *node, *tmp;
	int i;

	for (i = 0; i < HPTEG_HASH_NUM_VPTE_LONG; i++) {
		struct hlist_head *list = &vcpu->arch.hpte_hash_vpte_long[i];

		hlist_for_each_entry_safe(pte, node, tmp, list, list_vpte_long)
			invalidate_pte(vcpu, pte);
	}
}
Ejemplo n.º 5
0
static void ip_tunnel_destroy(struct ip_tunnel_net *itn, struct list_head *head)
{
	int h;

	for (h = 0; h < IP_TNL_HASH_SIZE; h++) {
		struct ip_tunnel *t;
		struct hlist_node *n;
		struct hlist_head *thead = &itn->tunnels[h];

		hlist_for_each_entry_safe(t, n, thead, hash_node)
			unregister_netdevice_queue(t->dev, head);
	}
	if (itn->fb_tunnel_dev)
		unregister_netdevice_queue(itn->fb_tunnel_dev, head);
}
Ejemplo n.º 6
0
void free_rmtperm_hash(struct hlist_head *hash)
{
	int i;
	struct ll_remote_perm *lrp;
	struct hlist_node *next;

	if (!hash)
		return;

	for (i = 0; i < REMOTE_PERM_HASHSIZE; i++)
		hlist_for_each_entry_safe(lrp, next, hash + i,
					      lrp_list)
			free_ll_remote_perm(lrp);
	OBD_SLAB_FREE(hash, ll_rmtperm_hash_cachep,
		      REMOTE_PERM_HASHSIZE * sizeof(*hash));
}
Ejemplo n.º 7
0
		/* check again */
		if (save != lli->lli_rmtperm_time) {
			rc = do_check_remote_perm(lli, mask);
			if (!rc || (rc != -ENOENT && i)) {
				mutex_unlock(&lli->lli_rmtperm_mutex);
				break;
			}
		}

		if (i++ > 5) {
			CERROR("check remote perm falls in dead loop!\n");
			LBUG();
		}

		oc = ll_mdscapa_get(inode);
		rc = md_get_remote_perm(sbi->ll_md_exp, ll_inode2fid(inode), oc,
					ll_i2suppgid(inode), &req);
		capa_put(oc);
		if (rc) {
			mutex_unlock(&lli->lli_rmtperm_mutex);
			break;
		}

		perm = req_capsule_server_swab_get(&req->rq_pill, &RMF_ACL,
						   lustre_swab_mdt_remote_perm);
		if (unlikely(perm == NULL)) {
			mutex_unlock(&lli->lli_rmtperm_mutex);
			rc = -EPROTO;
			break;
		}

		rc = ll_update_remote_perm(inode, perm);
		mutex_unlock(&lli->lli_rmtperm_mutex);
		if (rc == -ENOMEM)
			break;

		ptlrpc_req_finished(req);
		req = NULL;
	} while (1);
	ptlrpc_req_finished(req);
	return rc;
}

#if 0  /* NB: remote perms can't be freed in ll_mdc_blocking_ast of UPDATE lock,
	* because it will fail sanity test 48.
	*/
void ll_free_remote_perms(struct inode *inode)
{
	struct ll_inode_info *lli = ll_i2info(inode);
	struct hlist_head *hash = lli->lli_remote_perms;
	struct ll_remote_perm *lrp;
	struct hlist_node *node, *next;
	int i;

	LASSERT(hash);

	spin_lock(&lli->lli_lock);

	for (i = 0; i < REMOTE_PERM_HASHSIZE; i++) {
		hlist_for_each_entry_safe(lrp, node, next, hash + i,
					      lrp_list)
			free_ll_remote_perm(lrp);
	}

	spin_unlock(&lli->lli_lock);
}