Re: [PATCH 05/12] bcache: convert to bioset_init()/mempool_init()

2018-05-20 Thread Coly Li
On 2018/5/21 6:25 AM, Kent Overstreet wrote:
> Signed-off-by: Kent Overstreet <kent.overstr...@gmail.com>

Hi Kent,

This change looks good to me,

Reviewed-by: Coly Li <col...@suse.de>

Thanks.

Coly Li

> ---
>  drivers/md/bcache/bcache.h  | 10 +-
>  drivers/md/bcache/bset.c| 13 -
>  drivers/md/bcache/bset.h|  2 +-
>  drivers/md/bcache/btree.c   |  4 ++--
>  drivers/md/bcache/io.c  |  4 ++--
>  drivers/md/bcache/request.c | 18 +-
>  drivers/md/bcache/super.c   | 38 ++---
>  7 files changed, 37 insertions(+), 52 deletions(-)
> 
> diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
> index 3a0cfb237a..3050438761 100644
> --- a/drivers/md/bcache/bcache.h
> +++ b/drivers/md/bcache/bcache.h
> @@ -269,7 +269,7 @@ struct bcache_device {
>   atomic_t*stripe_sectors_dirty;
>   unsigned long   *full_dirty_stripes;
>  
> - struct bio_set  *bio_split;
> + struct bio_set  bio_split;
>  
>   unsigneddata_csum:1;
>  
> @@ -528,9 +528,9 @@ struct cache_set {
>   struct closure  sb_write;
>   struct semaphoresb_write_mutex;
>  
> - mempool_t   *search;
> - mempool_t   *bio_meta;
> - struct bio_set  *bio_split;
> + mempool_t   search;
> + mempool_t   bio_meta;
> + struct bio_set  bio_split;
>  
>   /* For the btree cache */
>   struct shrinker shrink;
> @@ -655,7 +655,7 @@ struct cache_set {
>* A btree node on disk could have too many bsets for an iterator to fit
>* on the stack - have to dynamically allocate them
>*/
> - mempool_t   *fill_iter;
> + mempool_t   fill_iter;
>  
>   struct bset_sort_state  sort;
>  
> diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
> index 579c696a5f..f3403b45bc 100644
> --- a/drivers/md/bcache/bset.c
> +++ b/drivers/md/bcache/bset.c
> @@ -1118,8 +1118,7 @@ struct bkey *bch_btree_iter_next_filter(struct 
> btree_iter *iter,
>  
>  void bch_bset_sort_state_free(struct bset_sort_state *state)
>  {
> - if (state->pool)
> - mempool_destroy(state->pool);
> + mempool_exit(>pool);
>  }
>  
>  int bch_bset_sort_state_init(struct bset_sort_state *state, unsigned 
> page_order)
> @@ -1129,11 +1128,7 @@ int bch_bset_sort_state_init(struct bset_sort_state 
> *state, unsigned page_order)
>   state->page_order = page_order;
>   state->crit_factor = int_sqrt(1 << page_order);
>  
> - state->pool = mempool_create_page_pool(1, page_order);
> - if (!state->pool)
> - return -ENOMEM;
> -
> - return 0;
> + return mempool_init_page_pool(>pool, 1, page_order);
>  }
>  EXPORT_SYMBOL(bch_bset_sort_state_init);
>  
> @@ -1191,7 +1186,7 @@ static void __btree_sort(struct btree_keys *b, struct 
> btree_iter *iter,
>  
>   BUG_ON(order > state->page_order);
>  
> - outp = mempool_alloc(state->pool, GFP_NOIO);
> + outp = mempool_alloc(>pool, GFP_NOIO);
>   out = page_address(outp);
>   used_mempool = true;
>   order = state->page_order;
> @@ -1220,7 +1215,7 @@ static void __btree_sort(struct btree_keys *b, struct 
> btree_iter *iter,
>   }
>  
>   if (used_mempool)
> - mempool_free(virt_to_page(out), state->pool);
> + mempool_free(virt_to_page(out), >pool);
>   else
>   free_pages((unsigned long) out, order);
>  
> diff --git a/drivers/md/bcache/bset.h b/drivers/md/bcache/bset.h
> index 0c24280f3b..b867f22004 100644
> --- a/drivers/md/bcache/bset.h
> +++ b/drivers/md/bcache/bset.h
> @@ -347,7 +347,7 @@ static inline struct bkey *bch_bset_search(struct 
> btree_keys *b,
>  /* Sorting */
>  
>  struct bset_sort_state {
> - mempool_t   *pool;
> + mempool_t   pool;
>  
>   unsignedpage_order;
>   unsignedcrit_factor;
> diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
> index 17936b2dc7..2a0968c04e 100644
> --- a/drivers/md/bcache/btree.c
> +++ b/drivers/md/bcache/btree.c
> @@ -204,7 +204,7 @@ void bch_btree_node_read_done(struct btree *b)
>   struct bset *i = btree_bset_first(b);
>   struct btree_iter *iter;
>  
> - iter = mempool_alloc(b->c->fill_iter, GFP_NOIO);
> + iter = mempool_alloc(>c->fill_iter, GFP_NOIO);
>   iter->size = b->c-&

Re: [PATCH 1/2] E2fsprogs: use the generic inode flags

2011-04-18 Thread Coly Li
On 2011年04月18日 15:37, liubo Wrote:
 
 Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com
 ---
  debugfs/htree.c|2 +-
  e2fsck/pass1.c |   22 +++---
  e2fsck/pass2.c |2 +-
  e2fsck/pass4.c |2 +-
  e2fsck/rehash.c|4 ++--
  ext2ed/inode_com.c |   14 +++---
  lib/e2p/fgetflags.c|6 +++---
  lib/e2p/fsetflags.c|6 +++---
  lib/e2p/getflags.c |6 +++---
  lib/e2p/pf.c   |   34 +-
  lib/e2p/setflags.c |6 +++---
  lib/ext2fs/ext2_fs.h   |   44 ++--
  lib/ext2fs/link.c  |4 ++--
  lib/ext2fs/mkjournal.c |2 +-
  misc/chattr.c  |   26 +-
  misc/tune2fs.c |2 +-
  16 files changed, 91 insertions(+), 91 deletions(-)
 [snip]

Hi Bo,

Could you please to introduce the motivation of this patch set a little bit 
more? Thanks.

-- 
Coly Li
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] E2fsprogs: use the generic inode flags

2011-04-18 Thread Coly Li
On 2011年04月18日 17:01, liubo Wrote:
 On 04/18/2011 04:41 PM, Coly Li wrote:
 On 2011年04月18日 15:37, liubo Wrote:
 Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com
 ---
  debugfs/htree.c|2 +-
  e2fsck/pass1.c |   22 +++---
  e2fsck/pass2.c |2 +-
  e2fsck/pass4.c |2 +-
  e2fsck/rehash.c|4 ++--
  ext2ed/inode_com.c |   14 +++---
  lib/e2p/fgetflags.c|6 +++---
  lib/e2p/fsetflags.c|6 +++---
  lib/e2p/getflags.c |6 +++---
  lib/e2p/pf.c   |   34 +-
  lib/e2p/setflags.c |6 +++---
  lib/ext2fs/ext2_fs.h   |   44 ++--
  lib/ext2fs/link.c  |4 ++--
  lib/ext2fs/mkjournal.c |2 +-
  misc/chattr.c  |   26 +-
  misc/tune2fs.c |2 +-
  16 files changed, 91 insertions(+), 91 deletions(-)
 [snip]

 Hi Bo,

 Could you please to introduce the motivation of this patch set a little bit 
 more? Thanks.

 
 Hi Li,
 
 Since we want to control COW and compression attribute on a per file or per 
 directory basis,
 and find that the generic command chattr is the Mr Right.
 
 Currently only btrfs supports both, of course.
 
 With these patches, we can do the followings:
 
 c: compress
 C: nocow
 
 set compress  nocow:
 
 # ./misc/chattr -V +c +C /mnt/btrfs/dir/
 chattr 1.41.14 (22-Dec-2010)
 Flags of /mnt/btrfs/dir/ set as c--C
 
 # ./misc/lsattr -d /mnt/btrfs/dir/
 c--C /mnt/btrfs/dir/
 

Thank you for the explaining. Now I understand this patch set is to make chattr 
of e2fsprogs to support a
(currently-only) btrfs feature.

It seems chattr and lsattr is not an ext[234] only utilities any more...

-- 
Coly Li
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html