Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1345171

Re: [PATCH 3/3] radix-tree: support locking of individual exception entries.

From NeilBrown <neilb@suse.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] radix-tree: support locking of individual exception entries.
Date 2016-02-28 07:30 +0100
Message-ID <r731E-6Mv-5@gated-at.bofh.it> (permalink)
References <r71VT-605-3@gated-at.bofh.it> <r71VT-605-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Sun, Feb 28 2016, NeilBrown <neilb@suse.com> wrote:

> +static int wake_slot_function(wait_queue_t *wait, unsigned mode, int sync,
> +			      void *arg)
> +{
> +	struct wait_bit_key *key = arg;
> +	struct wait_slot_queue *wait_slot =
> +		container_of(wait, struct wait_slot_queue, wait);
> +	void **slot;
> +
> +	if (wait_slot->root != key->flags ||
> +	    wait_slot->index != key->timeout)
> +		/* Not waking this waiter */
> +		return 0;
> +	if (wait_slot->state != SLOT_WAITING)
> +		/* Should be impossible.... */
> +		return 1;
> +	if (key->bit_nr == -3)
> +		/* Was just deleted, no point in doing a lookup */
> +		wait_slot = NULL;
> +	else
> +		wait_slot->ret = __radix_tree_lookup(
> +			wait_slot->root, wait_slot->index, NULL, &slot);
> +	if (!wait_slot->ret || !radix_tree_exceptional_entry(wait_slot->ret)) {
> +		wait_slot->state = SLOT_GONE;
> +		return 1;
> +	}
> +	if (slot_locked(slot))
> +		/* still locked */
> +		return 0;
> +	wait_slot->ret = lock_slot(slot);
> +	wait_slot->state = SLOT_LOCKED;
> +	return 1;
> +}

Sorry, just realized that this should:
  return autoremove_wake_function(wait, mode, sync, arg);

instead of "return 1;"

NeilBrown

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3/3] radix-tree: support locking of individual exception  entries. NeilBrown <neilb@suse.com> - 2016-02-28 06:20 +0100
  Re: [PATCH 3/3] radix-tree: support locking of individual exception  entries. kbuild test robot <lkp@intel.com> - 2016-02-28 06:40 +0100
  Re: [PATCH 3/3] radix-tree: support locking of individual exception entries. NeilBrown <neilb@suse.com> - 2016-02-28 07:30 +0100
  Re: [PATCH 3/3] radix-tree: support locking of individual exception  entries. Jan Kara <jack@suse.cz> - 2016-03-03 14:20 +0100
    Re: [PATCH 3/3] radix-tree: support locking of individual exception entries. NeilBrown <neilb@suse.com> - 2016-03-04 01:00 +0100

csiph-web