Skip to content

Commit b012b32

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge still more updates from Andrew Morton: "16 patches. Subsystems affected by this patch series: ofs2, nilfs2, mailmap, and mm (madvise, mlock, mfence, memory-failure, kasan, debug, kmemleak, and damon)" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: mm/damon: prevent activated scheme from sleeping by deactivated schemes mm/kmemleak: reset tag when compare object pointer doc/vm/page_owner.rst: remove content related to -c option tools/vm/page_owner_sort.c: remove -c option mm, kasan: fix __GFP_BITS_SHIFT definition breaking LOCKDEP mm,hwpoison: unmap poisoned page before invalidation mailmap: update Kirill's email mm: kfence: fix objcgs vector allocation mm/munlock: protect the per-CPU pagevec by a local_lock_t mm/munlock: update Documentation/vm/unevictable-lru.rst mm/munlock: add lru_add_drain() to fix memcg_stat_test nilfs2: get rid of nilfs_mapping_init() nilfs2: fix lockdep warnings during disk space reclamation nilfs2: fix lockdep warnings in page operations for btree nodes ocfs2: fix crash when mount with quota enabled Revert "mm: madvise: skip unmapped vma holes passed to process_madvise"
2 parents d0d642a + 78049e9 commit b012b32

33 files changed

Lines changed: 554 additions & 393 deletions

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ Kees Cook <keescook@chromium.org> <kees@ubuntu.com>
213213
Keith Busch <kbusch@kernel.org> <keith.busch@intel.com>
214214
Keith Busch <kbusch@kernel.org> <keith.busch@linux.intel.com>
215215
Kenneth W Chen <kenneth.w.chen@intel.com>
216+
Kirill Tkhai <kirill.tkhai@openvz.org> <ktkhai@virtuozzo.com>
216217
Konstantin Khlebnikov <koct9i@gmail.com> <khlebnikov@yandex-team.ru>
217218
Konstantin Khlebnikov <koct9i@gmail.com> <k.khlebnikov@samsung.com>
218219
Koushik <raghavendra.koushik@neterion.com>

Documentation/vm/page_owner.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ Usage
125125
additional function:
126126

127127
Cull:
128-
-c Cull by comparing stacktrace instead of total block.
129128
--cull <rules>
130129
Specify culling rules.Culling syntax is key[,key[,...]].Choose a
131130
multi-letter key from the **STANDARD FORMAT SPECIFIERS** section.

Documentation/vm/unevictable-lru.rst

Lines changed: 210 additions & 261 deletions
Large diffs are not rendered by default.

fs/nilfs2/btnode.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@
2020
#include "page.h"
2121
#include "btnode.h"
2222

23+
24+
/**
25+
* nilfs_init_btnc_inode - initialize B-tree node cache inode
26+
* @btnc_inode: inode to be initialized
27+
*
28+
* nilfs_init_btnc_inode() sets up an inode for B-tree node cache.
29+
*/
30+
void nilfs_init_btnc_inode(struct inode *btnc_inode)
31+
{
32+
struct nilfs_inode_info *ii = NILFS_I(btnc_inode);
33+
34+
btnc_inode->i_mode = S_IFREG;
35+
ii->i_flags = 0;
36+
memset(&ii->i_bmap_data, 0, sizeof(struct nilfs_bmap));
37+
mapping_set_gfp_mask(btnc_inode->i_mapping, GFP_NOFS);
38+
}
39+
2340
void nilfs_btnode_cache_clear(struct address_space *btnc)
2441
{
2542
invalidate_mapping_pages(btnc, 0, -1);
@@ -29,7 +46,7 @@ void nilfs_btnode_cache_clear(struct address_space *btnc)
2946
struct buffer_head *
3047
nilfs_btnode_create_block(struct address_space *btnc, __u64 blocknr)
3148
{
32-
struct inode *inode = NILFS_BTNC_I(btnc);
49+
struct inode *inode = btnc->host;
3350
struct buffer_head *bh;
3451

3552
bh = nilfs_grab_buffer(inode, btnc, blocknr, BIT(BH_NILFS_Node));
@@ -57,7 +74,7 @@ int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr,
5774
struct buffer_head **pbh, sector_t *submit_ptr)
5875
{
5976
struct buffer_head *bh;
60-
struct inode *inode = NILFS_BTNC_I(btnc);
77+
struct inode *inode = btnc->host;
6178
struct page *page;
6279
int err;
6380

@@ -157,7 +174,7 @@ int nilfs_btnode_prepare_change_key(struct address_space *btnc,
157174
struct nilfs_btnode_chkey_ctxt *ctxt)
158175
{
159176
struct buffer_head *obh, *nbh;
160-
struct inode *inode = NILFS_BTNC_I(btnc);
177+
struct inode *inode = btnc->host;
161178
__u64 oldkey = ctxt->oldkey, newkey = ctxt->newkey;
162179
int err;
163180

fs/nilfs2/btnode.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ struct nilfs_btnode_chkey_ctxt {
3030
struct buffer_head *newbh;
3131
};
3232

33+
void nilfs_init_btnc_inode(struct inode *btnc_inode);
3334
void nilfs_btnode_cache_clear(struct address_space *);
3435
struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc,
3536
__u64 blocknr);

fs/nilfs2/btree.c

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ static void nilfs_btree_free_path(struct nilfs_btree_path *path)
5858
static int nilfs_btree_get_new_block(const struct nilfs_bmap *btree,
5959
__u64 ptr, struct buffer_head **bhp)
6060
{
61-
struct address_space *btnc = &NILFS_BMAP_I(btree)->i_btnode_cache;
61+
struct inode *btnc_inode = NILFS_BMAP_I(btree)->i_assoc_inode;
62+
struct address_space *btnc = btnc_inode->i_mapping;
6263
struct buffer_head *bh;
6364

6465
bh = nilfs_btnode_create_block(btnc, ptr);
@@ -470,7 +471,8 @@ static int __nilfs_btree_get_block(const struct nilfs_bmap *btree, __u64 ptr,
470471
struct buffer_head **bhp,
471472
const struct nilfs_btree_readahead_info *ra)
472473
{
473-
struct address_space *btnc = &NILFS_BMAP_I(btree)->i_btnode_cache;
474+
struct inode *btnc_inode = NILFS_BMAP_I(btree)->i_assoc_inode;
475+
struct address_space *btnc = btnc_inode->i_mapping;
474476
struct buffer_head *bh, *ra_bh;
475477
sector_t submit_ptr = 0;
476478
int ret;
@@ -1741,6 +1743,10 @@ nilfs_btree_prepare_convert_and_insert(struct nilfs_bmap *btree, __u64 key,
17411743
dat = nilfs_bmap_get_dat(btree);
17421744
}
17431745

1746+
ret = nilfs_attach_btree_node_cache(&NILFS_BMAP_I(btree)->vfs_inode);
1747+
if (ret < 0)
1748+
return ret;
1749+
17441750
ret = nilfs_bmap_prepare_alloc_ptr(btree, dreq, dat);
17451751
if (ret < 0)
17461752
return ret;
@@ -1913,7 +1919,7 @@ static int nilfs_btree_prepare_update_v(struct nilfs_bmap *btree,
19131919
path[level].bp_ctxt.newkey = path[level].bp_newreq.bpr_ptr;
19141920
path[level].bp_ctxt.bh = path[level].bp_bh;
19151921
ret = nilfs_btnode_prepare_change_key(
1916-
&NILFS_BMAP_I(btree)->i_btnode_cache,
1922+
NILFS_BMAP_I(btree)->i_assoc_inode->i_mapping,
19171923
&path[level].bp_ctxt);
19181924
if (ret < 0) {
19191925
nilfs_dat_abort_update(dat,
@@ -1939,7 +1945,7 @@ static void nilfs_btree_commit_update_v(struct nilfs_bmap *btree,
19391945

19401946
if (buffer_nilfs_node(path[level].bp_bh)) {
19411947
nilfs_btnode_commit_change_key(
1942-
&NILFS_BMAP_I(btree)->i_btnode_cache,
1948+
NILFS_BMAP_I(btree)->i_assoc_inode->i_mapping,
19431949
&path[level].bp_ctxt);
19441950
path[level].bp_bh = path[level].bp_ctxt.bh;
19451951
}
@@ -1958,7 +1964,7 @@ static void nilfs_btree_abort_update_v(struct nilfs_bmap *btree,
19581964
&path[level].bp_newreq.bpr_req);
19591965
if (buffer_nilfs_node(path[level].bp_bh))
19601966
nilfs_btnode_abort_change_key(
1961-
&NILFS_BMAP_I(btree)->i_btnode_cache,
1967+
NILFS_BMAP_I(btree)->i_assoc_inode->i_mapping,
19621968
&path[level].bp_ctxt);
19631969
}
19641970

@@ -2134,7 +2140,8 @@ static void nilfs_btree_add_dirty_buffer(struct nilfs_bmap *btree,
21342140
static void nilfs_btree_lookup_dirty_buffers(struct nilfs_bmap *btree,
21352141
struct list_head *listp)
21362142
{
2137-
struct address_space *btcache = &NILFS_BMAP_I(btree)->i_btnode_cache;
2143+
struct inode *btnc_inode = NILFS_BMAP_I(btree)->i_assoc_inode;
2144+
struct address_space *btcache = btnc_inode->i_mapping;
21382145
struct list_head lists[NILFS_BTREE_LEVEL_MAX];
21392146
struct pagevec pvec;
21402147
struct buffer_head *bh, *head;
@@ -2188,12 +2195,12 @@ static int nilfs_btree_assign_p(struct nilfs_bmap *btree,
21882195
path[level].bp_ctxt.newkey = blocknr;
21892196
path[level].bp_ctxt.bh = *bh;
21902197
ret = nilfs_btnode_prepare_change_key(
2191-
&NILFS_BMAP_I(btree)->i_btnode_cache,
2198+
NILFS_BMAP_I(btree)->i_assoc_inode->i_mapping,
21922199
&path[level].bp_ctxt);
21932200
if (ret < 0)
21942201
return ret;
21952202
nilfs_btnode_commit_change_key(
2196-
&NILFS_BMAP_I(btree)->i_btnode_cache,
2203+
NILFS_BMAP_I(btree)->i_assoc_inode->i_mapping,
21972204
&path[level].bp_ctxt);
21982205
*bh = path[level].bp_ctxt.bh;
21992206
}
@@ -2398,6 +2405,10 @@ int nilfs_btree_init(struct nilfs_bmap *bmap)
23982405

23992406
if (nilfs_btree_root_broken(nilfs_btree_get_root(bmap), bmap->b_inode))
24002407
ret = -EIO;
2408+
else
2409+
ret = nilfs_attach_btree_node_cache(
2410+
&NILFS_BMAP_I(bmap)->vfs_inode);
2411+
24012412
return ret;
24022413
}
24032414

fs/nilfs2/dat.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,9 @@ int nilfs_dat_read(struct super_block *sb, size_t entry_size,
497497
di = NILFS_DAT_I(dat);
498498
lockdep_set_class(&di->mi.mi_sem, &dat_lock_key);
499499
nilfs_palloc_setup_cache(dat, &di->palloc_cache);
500-
nilfs_mdt_setup_shadow_map(dat, &di->shadow);
500+
err = nilfs_mdt_setup_shadow_map(dat, &di->shadow);
501+
if (err)
502+
goto failed;
501503

502504
err = nilfs_read_inode_common(dat, raw_inode);
503505
if (err)

fs/nilfs2/gcinode.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,10 @@ int nilfs_gccache_submit_read_data(struct inode *inode, sector_t blkoff,
126126
int nilfs_gccache_submit_read_node(struct inode *inode, sector_t pbn,
127127
__u64 vbn, struct buffer_head **out_bh)
128128
{
129+
struct inode *btnc_inode = NILFS_I(inode)->i_assoc_inode;
129130
int ret;
130131

131-
ret = nilfs_btnode_submit_block(&NILFS_I(inode)->i_btnode_cache,
132+
ret = nilfs_btnode_submit_block(btnc_inode->i_mapping,
132133
vbn ? : pbn, pbn, REQ_OP_READ, 0,
133134
out_bh, &pbn);
134135
if (ret == -EEXIST) /* internal code (cache hit) */
@@ -170,7 +171,7 @@ int nilfs_init_gcinode(struct inode *inode)
170171
ii->i_flags = 0;
171172
nilfs_bmap_init_gc(ii->i_bmap);
172173

173-
return 0;
174+
return nilfs_attach_btree_node_cache(inode);
174175
}
175176

176177
/**
@@ -185,7 +186,7 @@ void nilfs_remove_all_gcinodes(struct the_nilfs *nilfs)
185186
ii = list_first_entry(head, struct nilfs_inode_info, i_dirty);
186187
list_del_init(&ii->i_dirty);
187188
truncate_inode_pages(&ii->vfs_inode.i_data, 0);
188-
nilfs_btnode_cache_clear(&ii->i_btnode_cache);
189+
nilfs_btnode_cache_clear(ii->i_assoc_inode->i_mapping);
189190
iput(&ii->vfs_inode);
190191
}
191192
}

0 commit comments

Comments
 (0)