Lines Matching +full:non +full:- +full:overlap +full:- +full:time

1 // SPDX-License-Identifier: GPL-2.0+
5 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
12 * This file adds the cache of on-disk blocks to be moved in garbage
18 * time after they are copied to a new log. Dirty blocks made on the
19 * current generation and the blocks to be moved by GC never overlap
38 * nilfs_gccache_submit_read_data() - add data buffer and submit read request
39 * @inode - gc inode
40 * @blkoff - dummy offset treated as the key for the page cache
41 * @pbn - physical block number of the block
42 * @vbn - virtual block number of the block, 0 for non-virtual block
43 * @out_bh - indirect pointer to a buffer_head struct to receive the results
52 * %-EIO - I/O error.
54 * %-ENOMEM - Insufficient amount of memory available.
56 * %-ENOENT - The block specified with @pbn does not exist.
65 bh = nilfs_grab_buffer(inode, inode->i_mapping, blkoff, 0); in nilfs_gccache_submit_read_data()
67 return -ENOMEM; in nilfs_gccache_submit_read_data()
73 struct the_nilfs *nilfs = inode->i_sb->s_fs_info; in nilfs_gccache_submit_read_data()
75 err = nilfs_dat_translate(nilfs->ns_dat, vbn, &pbn); in nilfs_gccache_submit_read_data()
76 if (unlikely(err)) /* -EIO, -ENOMEM, -ENOENT */ in nilfs_gccache_submit_read_data()
88 bh->b_blocknr = pbn; in nilfs_gccache_submit_read_data()
89 bh->b_end_io = end_buffer_read_sync; in nilfs_gccache_submit_read_data()
93 bh->b_blocknr = vbn; in nilfs_gccache_submit_read_data()
99 folio_unlock(bh->b_folio); in nilfs_gccache_submit_read_data()
100 folio_put(bh->b_folio); in nilfs_gccache_submit_read_data()
107 * nilfs_gccache_submit_read_node() - add node buffer and submit read request
108 * @inode - gc inode
109 * @pbn - physical block number for the block
110 * @vbn - virtual block number for the block
111 * @out_bh - indirect pointer to a buffer_head struct to receive the results
120 * %-EIO - I/O error.
122 * %-ENOMEM - Insufficient amount of memory available.
127 struct inode *btnc_inode = NILFS_I(inode)->i_assoc_inode; in nilfs_gccache_submit_read_node()
130 ret = nilfs_btnode_submit_block(btnc_inode->i_mapping, vbn ? : pbn, pbn, in nilfs_gccache_submit_read_node()
132 if (ret == -EEXIST) /* internal code (cache hit) */ in nilfs_gccache_submit_read_node()
141 struct inode *inode = bh->b_folio->mapping->host; in nilfs_gccache_wait_and_mark_dirty()
143 nilfs_err(inode->i_sb, in nilfs_gccache_wait_and_mark_dirty()
146 inode->i_ino, (unsigned long long)bh->b_blocknr); in nilfs_gccache_wait_and_mark_dirty()
147 return -EIO; in nilfs_gccache_wait_and_mark_dirty()
150 return -EEXIST; in nilfs_gccache_wait_and_mark_dirty()
154 return -EIO; in nilfs_gccache_wait_and_mark_dirty()
164 inode->i_mode = S_IFREG; in nilfs_init_gcinode()
165 mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); in nilfs_init_gcinode()
166 inode->i_mapping->a_ops = &empty_aops; in nilfs_init_gcinode()
168 ii->i_flags = 0; in nilfs_init_gcinode()
169 nilfs_bmap_init_gc(ii->i_bmap); in nilfs_init_gcinode()
175 * nilfs_remove_all_gcinodes() - remove all unprocessed gc inodes
180 struct list_head *head = &nilfs->ns_gc_inodes; in nilfs_remove_all_gcinodes()
185 list_del_init(&ii->i_dirty); in nilfs_remove_all_gcinodes()
186 truncate_inode_pages(&ii->vfs_inode.i_data, 0); in nilfs_remove_all_gcinodes()
187 nilfs_btnode_cache_clear(ii->i_assoc_inode->i_mapping); in nilfs_remove_all_gcinodes()
188 iput(&ii->vfs_inode); in nilfs_remove_all_gcinodes()