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()
87 bh->b_bdev = inode->i_sb->s_bdev; in nilfs_gccache_submit_read_data()
90 bh->b_blocknr = pbn; in nilfs_gccache_submit_read_data()
91 bh->b_end_io = end_buffer_read_sync; in nilfs_gccache_submit_read_data()
95 bh->b_blocknr = vbn; in nilfs_gccache_submit_read_data()
101 folio_unlock(bh->b_folio); in nilfs_gccache_submit_read_data()
102 folio_put(bh->b_folio); in nilfs_gccache_submit_read_data()
109 * nilfs_gccache_submit_read_node() - add node buffer and submit read request
110 * @inode - gc inode
111 * @pbn - physical block number for the block
112 * @vbn - virtual block number for the block
113 * @out_bh - indirect pointer to a buffer_head struct to receive the results
122 * %-EIO - I/O error.
124 * %-ENOMEM - Insufficient amount of memory available.
129 struct inode *btnc_inode = NILFS_I(inode)->i_assoc_inode; in nilfs_gccache_submit_read_node()
132 ret = nilfs_btnode_submit_block(btnc_inode->i_mapping, vbn ? : pbn, pbn, in nilfs_gccache_submit_read_node()
134 if (ret == -EEXIST) /* internal code (cache hit) */ in nilfs_gccache_submit_read_node()
143 struct inode *inode = bh->b_folio->mapping->host; in nilfs_gccache_wait_and_mark_dirty()
145 nilfs_err(inode->i_sb, in nilfs_gccache_wait_and_mark_dirty()
148 inode->i_ino, (unsigned long long)bh->b_blocknr); in nilfs_gccache_wait_and_mark_dirty()
149 return -EIO; in nilfs_gccache_wait_and_mark_dirty()
152 return -EEXIST; in nilfs_gccache_wait_and_mark_dirty()
156 return -EIO; in nilfs_gccache_wait_and_mark_dirty()
166 inode->i_mode = S_IFREG; in nilfs_init_gcinode()
167 mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); in nilfs_init_gcinode()
168 inode->i_mapping->a_ops = &empty_aops; in nilfs_init_gcinode()
170 ii->i_flags = 0; in nilfs_init_gcinode()
171 nilfs_bmap_init_gc(ii->i_bmap); in nilfs_init_gcinode()
177 * nilfs_remove_all_gcinodes() - remove all unprocessed gc inodes
181 struct list_head *head = &nilfs->ns_gc_inodes; in nilfs_remove_all_gcinodes()
186 list_del_init(&ii->i_dirty); in nilfs_remove_all_gcinodes()
187 truncate_inode_pages(&ii->vfs_inode.i_data, 0); in nilfs_remove_all_gcinodes()
188 nilfs_btnode_cache_clear(ii->i_assoc_inode->i_mapping); in nilfs_remove_all_gcinodes()
189 iput(&ii->vfs_inode); in nilfs_remove_all_gcinodes()