[f2fs-dev] [PATCH] f2fs: fix a wrong condition in f2fs_skip_inode_update

2018-03-29 Thread Junling Zheng
Fix commit 97dd26ad8347 (f2fs: fix wrong AUTO_RECOVER condition). We should use ~PAGE_MASK to determine whether i_size is aligned to the f2fs's block size or not. Signed-off-by: Junling Zheng --- fs/f2fs/f2fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/f2fs.h b/

Re: [f2fs-dev] [PATCH 1/4] mkfs.f2fs: update extension lists

2018-03-29 Thread Ju Hyung Park
Hi Chao, > I think this is real hardcoded one Agreed, but I can't figure out a better way of doing this. I still don't think fixing it at mkfs point isn't a good idea. Doing this entirely on the userspace also won't make much sense since I would not trust the distros to ship "good extension list

[f2fs-dev] [PATCH v10 58/62] dax: Convert __dax_invalidate_entry to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Avoids walking the radix tree multiple times looking for tags. Signed-off-by: Matthew Wilcox --- fs/dax.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 825bf153f499..9602db13aa65 100644 --- a/fs/dax.c +++ b/

[f2fs-dev] [PATCH v10 24/62] page cache: Convert filemap_range_has_page to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Instead of calling find_get_pages_range() and putting any reference, use xas_find() to iterate over any entries in the range, skipping the shadow/swap entries. Signed-off-by: Matthew Wilcox --- mm/filemap.c | 26 ++ 1 file changed, 18 insertions(+),

[f2fs-dev] [PATCH v10 54/62] dax: Rename some functions

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Remove mentions of 'radix' and 'radix tree'. Simplify some names by dropping the word 'mapping'. Signed-off-by: Matthew Wilcox --- fs/dax.c | 81 +++- 1 file changed, 39 insertions(+), 42 deletions(-) diff --git

[f2fs-dev] [PATCH v10 42/62] shmem: Convert shmem_partial_swap_usage to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Simpler code because the xarray takes care of things like the limit and dereferencing the slot. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index be8c6d43b4aa..

[f2fs-dev] [PATCH v10 07/62] xarray: Add xa_load

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This first function in the XArray API brings with it a lot of support infrastructure. The advanced API is based around the xa_state which is a more capable version of the radix_tree_iter. As the test-suite demonstrates, it is possible to use the xarray and radix tree APIs o

[f2fs-dev] [PATCH v10 20/62] page cache: Convert page deletion to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox The code is slightly shorter and simpler. Signed-off-by: Matthew Wilcox --- mm/filemap.c | 30 ++ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 0e19ea454cba..bdda1beda932 100644 --- a/mm/filema

[f2fs-dev] [PATCH v10 06/62] xarray: Add documentation

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This is documentation on how to use the XArray, not details about its internal implementation. Signed-off-by: Matthew Wilcox Acked-by: Josef Bacik --- Documentation/core-api/index.rst | 1 + Documentation/core-api/xarray.rst | 361 ++

[f2fs-dev] [PATCH v10 37/62] shmem: Convert shmem_confirm_swap to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox xa_load has its own RCU locking, so we can eliminate it here. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index fced882e0b7a..4b66bcedd21c 100644 --- a/mm/shmem.c +++ b/mm/sh

[f2fs-dev] [PATCH v10 23/62] page cache: Remove stray radix comment

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- mm/filemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/filemap.c b/mm/filemap.c index 0635e9cdbc06..86c83014c909 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2579,7 +2579,7 @@ static struct page *do_read_cac

[f2fs-dev] [PATCH v10 09/62] xarray: Add xa_store

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox xa_store() differs from radix_tree_insert() in that it will overwrite an existing element in the array rather than returning an error. This is the behaviour which most users want, and those that want more complex behaviour generally want to use the xas family of routines any

[f2fs-dev] [PATCH v10 22/62] page cache: Convert delete_batch to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Rename the function from page_cache_tree_delete_batch to just page_cache_delete_batch. Signed-off-by: Matthew Wilcox --- mm/filemap.c | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 5a6c7c

[f2fs-dev] [PATCH v10 49/62] nilfs2: Convert to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox I'm not 100% convinced that the rewrite of nilfs_copy_back_pages is correct, but it will at least have different bugs from the current version. Signed-off-by: Matthew Wilcox --- fs/nilfs2/btnode.c | 37 +++- fs/nilfs2/page.c | 72 +

[f2fs-dev] [PATCH v10 57/62] dax: Convert dax_layout_busy_page to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Instead of using a pagevec, just use the XArray iterators. Add a conditional rescheduling point which probably should have been there in the original. Signed-off-by: Matthew Wilcox --- fs/dax.c | 54 -- 1 file changed, 2

[f2fs-dev] [PATCH v10 12/62] xarray: Add xa_extract

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This function combines the functionality of radix_tree_gang_lookup() and radix_tree_gang_lookup_tagged(). It extracts entries matching the specified filter into a normal array. Signed-off-by: Matthew Wilcox --- include/linux/xarray.h | 2 ++ lib/xarray.c | 80 +

[f2fs-dev] [PATCH v10 52/62] dax: Fix use of zero page

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Use my_zero_pfn instead of ZERO_PAGE, and pass the vaddr to it so it works on MIPS and s390. Signed-off-by: Matthew Wilcox --- fs/dax.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index de40ecc9bfd6..371d50a1c14e 100644

[f2fs-dev] [PATCH v10 56/62] dax: Convert dax_insert_pfn_mkwrite to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Add some XArray-based helper functions to replace the radix tree based metaphors currently in use. The biggest change is that converted code doesn't see its own lock bit; get_unlocked_entry() always returns an entry with the lock bit clear, and locking the entry now returns

[f2fs-dev] [PATCH v10 32/62] mm: Convert huge_memory to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Quite a straightforward conversion. Signed-off-by: Matthew Wilcox --- mm/huge_memory.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 2aff58624886..56559ee1cb13 100644 --- a/mm/huge_memory.c

[f2fs-dev] [PATCH v10 11/62] xarray: Add xa_for_each

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This iterator allows the user to efficiently walk a range of the array, executing the loop body once for each entry in that range that matches the filter. This commit also includes xa_find() and xa_find_above() which are helper functions for xa_for_each() but may also be use

[f2fs-dev] [PATCH v10 53/62] dax: dax_insert_mapping_entry always succeeds

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox It does not return an error, so we don't need to check the return value for IS_ERR(). Signed-off-by: Matthew Wilcox --- fs/dax.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 371d50a1c14e..3bd9f624c1f8 100644

[f2fs-dev] [PATCH v10 36/62] shmem: Convert replace to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox shmem_radix_tree_replace() is renamed to shmem_xa_replace() and converted to use the XArray API. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 5cb52a797

[f2fs-dev] [PATCH v10 47/62] fs: Convert buffer to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Mostly comment fixes, but one use of __xa_set_tag. Signed-off-by: Matthew Wilcox --- fs/buffer.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index f3059f929dd6..5c798ecf7a39 100644 --- a/fs/buffer.c +++ b/fs/

[f2fs-dev] [PATCH v10 03/62] xarray: Change definition of sibling entries

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Instead of storing a pointer to the slot containing the canonical entry, store the offset of the slot. Produces slightly more efficient code (~300 bytes) and simplifies the implementation. Signed-off-by: Matthew Wilcox Reviewed-by: Josef Bacik --- include/linux/xarray.h

[f2fs-dev] [PATCH v10 17/62] page cache: Rearrange address_space

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Change i_pages from a radix_tree_root to an xarray, convert the documentation into kernel-doc format and change the order of the elements to pack them better on 64-bit systems. Signed-off-by: Matthew Wilcox --- include/linux/fs.h | 46 +++---

[f2fs-dev] [PATCH v10 35/62] pagevec: Use xa_tag_t

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Removes sparse warnings. Signed-off-by: Matthew Wilcox --- fs/btrfs/extent_io.c| 4 ++-- fs/ext4/inode.c | 2 +- fs/f2fs/data.c | 2 +- fs/gfs2/aops.c | 2 +- include/linux/pagevec.h | 8 +--- mm/swap.c | 4 ++-- 6 files chan

[f2fs-dev] [PATCH v10 08/62] xarray: Add xa_get_tag, xa_set_tag and xa_clear_tag

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox XArray tags are slightly more strongly typed than the radix tree tags, but occupy the same bits. This commit also adds the xas_ family of tag operations, for cases where the caller is already holding the lock, and xa_tagged() to ask whether any array member has a particular

[f2fs-dev] [PATCH v10 10/62] xarray: Add xa_cmpxchg and xa_insert

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Like cmpxchg(), xa_cmpxchg will only store to the index if the current entry matches the old entry. It returns the current entry, which is usually more useful than the errno returned by radix_tree_insert(). For the users who really only want the errno, the xa_insert() wrappe

[f2fs-dev] [PATCH v10 33/62] mm: Convert collapse_shmem to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox I found another victim of the radix tree being hard to use. Because there was no call to radix_tree_preload(), khugepaged was allocating radix_tree_nodes using GFP_ATOMIC. I also converted a local_irq_save()/restore() pair to disable()/enable(). Signed-off-by: Matthew Wilc

[f2fs-dev] [PATCH v10 13/62] xarray: Add xa_destroy

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This function frees all the internal memory allocated to the xarray and reinitialises it to be empty. Signed-off-by: Matthew Wilcox --- include/linux/xarray.h | 1 + lib/xarray.c | 28 2 files changed, 29 insertions(+) diff --git a/

[f2fs-dev] [PATCH v10 05/62] xarray: Define struct xa_node

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This is a direct replacement for struct radix_tree_node. A couple of struct members have changed name, so convert those. Use a #define so that radix tree users continue to work without change. Signed-off-by: Matthew Wilcox Reviewed-by: Josef Bacik --- include/linux/radi

[f2fs-dev] [PATCH v10 45/62] shmem: Comment fixups

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Remove the last mentions of radix tree from various comments. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index cffb3b6294b7..4735f8ebeb46 100644 --- a/mm/shmem.c +++

[f2fs-dev] [PATCH v10 00/62] Convert page cache to XArray

2018-03-29 Thread Matthew Wilcox
really appreciate a review on something that you feel somewhat responsible for, eg the particular filesystem (nilfs, f2fs, lustre) that I've touched, or something in the mm/ or fs/ directories that you've worked on recently. This is against next-20180329. Patch 1 is just cleanup of a coup

[f2fs-dev] [PATCH v10 61/62] page cache: Finish XArray conversion

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox With no more radix tree API users left, we can drop the GFP flags and use xa_init() instead of INIT_RADIX_TREE(). Signed-off-by: Matthew Wilcox --- fs/inode.c | 2 +- mm/swap_state.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/inode.c b/f

[f2fs-dev] [PATCH v10 02/62] xarray: Replace exceptional entries

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Introduce xarray value entries to replace the radix tree exceptional entry code. This is a slight change in encoding to allow the use of an extra bit (we can now store BITS_PER_LONG - 1 bits in a value entry). It is also a change in emphasis; exceptional entries are intimida

[f2fs-dev] [PATCH v10 19/62] page cache: Add and replace pages using the XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Use the XArray APIs to add and replace pages in the page cache. This removes two uses of the radix tree preload API and is significantly shorter code. Signed-off-by: Matthew Wilcox --- include/linux/swap.h | 8 ++- mm/filemap.c | 143 ++--

[f2fs-dev] [PATCH v10 44/62] memfd: Convert shmem_wait_for_pins to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox As with shmem_tag_pins(), hold the lock around the entire loop instead of acquiring & dropping it for each entry we're going to untag. Signed-off-by: Matthew Wilcox --- mm/memfd.c | 61 + 1 file changed, 25 insert

[f2fs-dev] [PATCH v10 39/62] shmem: Convert shmem_add_to_page_cache to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This removes the last caller of radix_tree_maybe_preload_order(). Simpler code, unless we run out of memory for new xa_nodes partway through inserting entries into the xarray. Hopefully we can support multi-index entries in the page cache soon and all the awful code goes awa

[f2fs-dev] [PATCH v10 62/62] radix tree: Remove unused functions

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox The following functions are (now) unused: - __radix_tree_delete_node - radix_tree_gang_lookup_slot - radix_tree_join - radix_tree_maybe_preload_order - radix_tree_split - radix_tree_split_preload Signed-off-by: Matthew Wilcox --- include/linux/radix-tree.h

[f2fs-dev] [PATCH v10 15/62] xarray: Add xas_create_range

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This hopefully temporary function is useful for users who have not yet been converted to multi-index entries. Signed-off-by: Matthew Wilcox --- include/linux/xarray.h | 2 ++ lib/xarray.c | 22 ++ 2 files changed, 24 insertions(+) diff --git

[f2fs-dev] [PATCH v10 31/62] mm: Convert page migration to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- mm/migrate.c | 41 - 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index bdef905b1737..16fbbffec185 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -323,7

[f2fs-dev] [PATCH v10 59/62] dax: Convert dax writeback to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Use XArray iteration instead of a pagevec. Signed-off-by: Matthew Wilcox --- fs/dax.c | 129 ++- 1 file changed, 61 insertions(+), 68 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 9602db13aa65..3de12a065e05

[f2fs-dev] [PATCH v10 25/62] mm: Convert page-writeback to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Includes moving mapping_tagged() to fs.h as a static inline, and changing it to return bool. Signed-off-by: Matthew Wilcox --- include/linux/fs.h | 17 +-- mm/page-writeback.c | 63 +++-- 2 files changed, 32 inse

[f2fs-dev] [PATCH v10 29/62] mm: Convert delete_from_swap_cache to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Both callers of __delete_from_swap_cache have the swp_entry_t already, so pass that in to make constructing the XA_STATE easier. Signed-off-by: Matthew Wilcox --- include/linux/swap.h | 5 +++-- mm/swap_state.c | 24 ++-- mm/vmscan.c | 2

[f2fs-dev] [PATCH v10 04/62] xarray: Add definition of struct xarray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This is a direct replacement for struct radix_tree_root. Some of the struct members have changed name; convert those, and use a #define so that radix_tree users continue to work without change. Signed-off-by: Matthew Wilcox Reviewed-by: Josef Bacik --- include/linux/radi

[f2fs-dev] [PATCH v10 43/62] memfd: Convert shmem_tag_pins to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Simplify the locking by taking the spinlock while we walk the tree on the assumption that many acquires and releases of the lock will be worse than holding the lock for a (potentially) long time. We could replicate the same locking behaviour with the xarray, but would have t

[f2fs-dev] [PATCH v10 26/62] mm: Convert workingset to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox We construct a fake XA_STATE and use it to delete the node with xa_store() rather than adding a special function for this unique use case. Signed-off-by: Matthew Wilcox --- include/linux/swap.h | 9 - mm/workingset.c | 51 ++---

[f2fs-dev] [PATCH v10 40/62] shmem: Convert shmem_alloc_hugepage to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox xa_find() is a slightly easier API to use than radix_tree_gang_lookup_slot() because it contains its own RCU locking. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c in

[f2fs-dev] [PATCH v10 14/62] xarray: Add xas_next and xas_prev

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox These two functions move the xas index by one position, and adjust the rest of the iterator state to match it. This is more efficient than calling xas_set() as it keeps the iterator at the leaves of the tree instead of walking the iterator from the root each time. Signed-of

[f2fs-dev] [PATCH v10 01/62] page cache: Use xa_lock

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Remove the address_space ->tree_lock and use the xa_lock newly added to the radix_tree_root. Rename the address_space ->page_tree to ->i_pages, since we don't really care that it's a tree. Signed-off-by: Matthew Wilcox Acked-by: Jeff Layton Reviewed-by: Josef Bacik ---

[f2fs-dev] [PATCH v10 30/62] mm: Convert __do_page_cache_readahead to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This one is trivial. Signed-off-by: Matthew Wilcox --- mm/readahead.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/readahead.c b/mm/readahead.c index c7ddcf60ac6d..50910c27b372 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -174,9 +174,7 @

[f2fs-dev] [PATCH v10 46/62] btrfs: Convert page cache to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox Acked-by: David Sterba --- fs/btrfs/compression.c | 4 +--- fs/btrfs/extent_io.c | 8 +++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index ad330af89eef..c2286f436571 10

[f2fs-dev] [PATCH v10 41/62] shmem: Convert shmem_free_swap to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This is a perfect use for xa_cmpxchg(). Note the use of 0 for GFP flags; we won't be allocating memory. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index aa7e92b24c19..be8c

[f2fs-dev] [PATCH v10 51/62] lustre: Convert to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- drivers/staging/lustre/lustre/llite/glimpse.c | 12 +--- drivers/staging/lustre/lustre/mdc/mdc_request.c | 16 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/g

[f2fs-dev] [PATCH v10 50/62] f2fs: Convert to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This is a straightforward conversion. Signed-off-by: Matthew Wilcox --- fs/f2fs/data.c | 3 +-- fs/f2fs/dir.c| 5 + fs/f2fs/inline.c | 6 +- fs/f2fs/node.c | 10 ++ 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/fs/f2fs/data.c b/

[f2fs-dev] [PATCH v10 34/62] mm: Convert khugepaged_scan_shmem to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Slightly shorter and easier to read code. Signed-off-by: Matthew Wilcox --- mm/khugepaged.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 193bacac91a8..7c6343db7de0 100644 --- a/mm/khugepaged.

[f2fs-dev] [PATCH v10 38/62] shmem: Convert find_swap_entry to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This is a 1:1 conversion. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 4b66bcedd21c..c77b41d06528 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1085,2

[f2fs-dev] [PATCH v10 18/62] page cache: Convert hole search to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox The page cache offers the ability to search for a miss in the previous or next N locations. Rather than teach the XArray about the page cache's definition of a miss, use xas_prev() and xas_next() to search the page array. This should be more efficient as it does not have to

[f2fs-dev] [PATCH v10 27/62] mm: Convert truncate to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This is essentially xa_cmpxchg() with the locking handled above us, and it doesn't have to handle replacing a NULL entry. Signed-off-by: Matthew Wilcox --- mm/truncate.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/mm/truncate.c b/mm/

[f2fs-dev] [PATCH v10 55/62] dax: Hash on XArray instead of mapping

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Since the XArray is embedded in the struct address_space, this contains exactly as much entropy as the address of the mapping. Signed-off-by: Matthew Wilcox --- fs/dax.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/fs/

[f2fs-dev] [PATCH v10 16/62] xarray: Add MAINTAINERS entry

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Add myself as XArray and IDR maintainer. Signed-off-by: Matthew Wilcox --- MAINTAINERS | 12 1 file changed, 12 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 49236216a871..5da3adc1fabc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15327,6 +15327

[f2fs-dev] [PATCH v10 21/62] page cache: Convert page cache lookups to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Introduce page_cache_pin() to factor out the common logic between the various lookup routines: find_get_entry find_get_entries find_get_pages_range find_get_pages_contig find_get_pages_range_tag find_get_entries_tag filemap_map_pages By using the xa_state to control the ite

[f2fs-dev] [PATCH v10 48/62] fs: Convert writeback to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox A couple of short loops. Signed-off-by: Matthew Wilcox --- fs/fs-writeback.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 4b12ba70a895..7d90d3beb591 100644 --- a/fs/fs-writeback.c

[f2fs-dev] [PATCH v10 60/62] dax: Convert page fault handlers to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox This is the last part of DAX to be converted to the XArray so remove all the old helper functions. Signed-off-by: Matthew Wilcox --- fs/dax.c | 368 --- 1 file changed, 92 insertions(+), 276 deletions(-) diff --g

[f2fs-dev] [PATCH v10 28/62] mm: Convert add_to_swap_cache to XArray

2018-03-29 Thread Matthew Wilcox
From: Matthew Wilcox Combine __add_to_swap_cache and add_to_swap_cache into one function since there is no more need to preload. Signed-off-by: Matthew Wilcox --- mm/swap_state.c | 93 ++--- 1 file changed, 29 insertions(+), 64 deletions(-)

[f2fs-dev] [PATCH] f2fs: remain written times to update inode during fsync

2018-03-29 Thread Jaegeuk Kim
This fixes xfstests/generic/392. Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 15 +++ fs/f2fs/inode.c | 4 2 files changed, 19 insertions(+) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 000f93f6767e..675c39d85111 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -6