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


Groups > linux.kernel > #1500344

Re: [PATCH v6 14/17] dax: move put_(un)locked_mapping_entry() in dax.c

From Jan Kara <jack@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH v6 14/17] dax: move put_(un)locked_mapping_entry() in dax.c
Date 2016-10-13 17:20 +0200
Message-ID <srPXA-5cV-19@gated-at.bofh.it> (permalink)
References <srAFb-2y2-3@gated-at.bofh.it> <srAFc-2y2-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed 12-10-16 16:50:19, Ross Zwisler wrote:
> No functional change.
> 
> The static functions put_locked_mapping_entry() and
> put_unlocked_mapping_entry() will soon be used in error cases in
> grab_mapping_entry(), so move their definitions above this function.
> 
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>

Looks good. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/dax.c | 50 +++++++++++++++++++++++++-------------------------
>  1 file changed, 25 insertions(+), 25 deletions(-)
> 
> diff --git a/fs/dax.c b/fs/dax.c
> index c45cc4d..0582c7c 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -382,6 +382,31 @@ static void *get_unlocked_mapping_entry(struct address_space *mapping,
>  	}
>  }
>  
> +static void put_locked_mapping_entry(struct address_space *mapping,
> +				     pgoff_t index, void *entry)
> +{
> +	if (!radix_tree_exceptional_entry(entry)) {
> +		unlock_page(entry);
> +		put_page(entry);
> +	} else {
> +		dax_unlock_mapping_entry(mapping, index);
> +	}
> +}
> +
> +/*
> + * Called when we are done with radix tree entry we looked up via
> + * get_unlocked_mapping_entry() and which we didn't lock in the end.
> + */
> +static void put_unlocked_mapping_entry(struct address_space *mapping,
> +				       pgoff_t index, void *entry)
> +{
> +	if (!radix_tree_exceptional_entry(entry))
> +		return;
> +
> +	/* We have to wake up next waiter for the radix tree entry lock */
> +	dax_wake_mapping_entry_waiter(mapping, index, entry, false);
> +}
> +
>  /*
>   * Find radix tree entry at given index. If it points to a page, return with
>   * the page locked. If it points to the exceptional entry, return with the
> @@ -486,31 +511,6 @@ void dax_unlock_mapping_entry(struct address_space *mapping, pgoff_t index)
>  	dax_wake_mapping_entry_waiter(mapping, index, entry, false);
>  }
>  
> -static void put_locked_mapping_entry(struct address_space *mapping,
> -				     pgoff_t index, void *entry)
> -{
> -	if (!radix_tree_exceptional_entry(entry)) {
> -		unlock_page(entry);
> -		put_page(entry);
> -	} else {
> -		dax_unlock_mapping_entry(mapping, index);
> -	}
> -}
> -
> -/*
> - * Called when we are done with radix tree entry we looked up via
> - * get_unlocked_mapping_entry() and which we didn't lock in the end.
> - */
> -static void put_unlocked_mapping_entry(struct address_space *mapping,
> -				       pgoff_t index, void *entry)
> -{
> -	if (!radix_tree_exceptional_entry(entry))
> -		return;
> -
> -	/* We have to wake up next waiter for the radix tree entry lock */
> -	dax_wake_mapping_entry_waiter(mapping, index, entry, false);
> -}
> -
>  /*
>   * Delete exceptional DAX entry at @index from @mapping. Wait for radix tree
>   * entry to get unlocked before deleting it.
> -- 
> 2.9.0
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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


Thread

[PATCH v6 00/17] re-enable DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-13 01:00 +0200
  [PATCH v6 13/17] dax: move RADIX_DAX_* defines to dax.h Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-13 01:00 +0200
  [PATCH v6 11/17] dax: add dax_iomap_sector() helper function Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-13 01:00 +0200
  [PATCH v6 10/17] dax: correct dax iomap code namespace Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-13 01:00 +0200
  [PATCH v6 14/17] dax: move put_(un)locked_mapping_entry() in dax.c Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-13 01:00 +0200
    Re: [PATCH v6 14/17] dax: move put_(un)locked_mapping_entry() in  dax.c Jan Kara <jack@suse.cz> - 2016-10-13 17:20 +0200
  [PATCH v6 16/17] xfs: use struct iomap based DAX PMD fault path Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-13 01:00 +0200
  [PATCH v6 05/17] dax: make 'wait_table' global variable static Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-13 01:00 +0200
  [PATCH v6 12/17] dax: dax_iomap_fault() needs to call iomap_end() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-13 01:00 +0200
  [PATCH v6 07/17] dax: consistent variable naming for DAX entries Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-13 01:00 +0200
  [PATCH v6 08/17] dax: coordinate locking for offsets in PMD range Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-13 01:00 +0200
  [PATCH v6 02/17] ext4: tell DAX the size of allocation holes Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-13 01:00 +0200
  [PATCH v6 01/17] ext4: allow DAX writeback for hole punch Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-13 01:00 +0200
  [PATCH v6 17/17] dax: remove "depends on BROKEN" from FS_DAX_PMD Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-13 01:00 +0200
    Re: [PATCH v6 17/17] dax: remove "depends on BROKEN" from FS_DAX_PMD Jan Kara <jack@suse.cz> - 2016-10-13 17:50 +0200
    Re: [PATCH v6 17/17] dax: remove "depends on BROKEN" from FS_DAX_PMD "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> - 2016-10-17 08:00 +0200
      Re: [PATCH v6 17/17] dax: remove "depends on BROKEN" from FS_DAX_PMD Jan Kara <jack@suse.cz> - 2016-10-17 11:20 +0200
  [PATCH v6 06/17] dax: remove the last BUG_ON() from fs/dax.c Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-10-13 01:00 +0200

csiph-web