[akpm-mm:mm-unstable 41/107] fs/f2fs/data.c:2060:28: error: call to undeclared function 'page_index'; ISO C99 and later do not support implicit function declarations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
head:   c65920c76a977c2b73c3a8b03b4c0c00cc1285ed
commit: ca2b437e3fdab3a172e554095d9402113d2262a8 [41/107] mm: drop page_index and simplify folio_index
config: mips-randconfig-r081-20240523 (https://download.01.org/0day-ci/archive/20240523/202405231654.kL0A7Y39-lkp@xxxxxxxxx/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240523/202405231654.kL0A7Y39-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405231654.kL0A7Y39-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> fs/f2fs/data.c:2060:28: error: call to undeclared function 'page_index'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
           block_in_file = (sector_t)page_index(page);
                                     ^
   fs/f2fs/data.c:2060:28: note: did you mean 'pte_index'?
   include/linux/pgtable.h:67:29: note: 'pte_index' declared here
   static inline unsigned long pte_index(unsigned long address)
                               ^
   1 error generated.


vim +/page_index +2060 fs/f2fs/data.c

95ae251fe82838 Eric Biggers       2019-07-22  2044  
2df0ab045784a1 Chao Yu            2019-03-25  2045  static int f2fs_read_single_page(struct inode *inode, struct page *page,
2df0ab045784a1 Chao Yu            2019-03-25  2046  					unsigned nr_pages,
2df0ab045784a1 Chao Yu            2019-03-25  2047  					struct f2fs_map_blocks *map,
2df0ab045784a1 Chao Yu            2019-03-25  2048  					struct bio **bio_ret,
2df0ab045784a1 Chao Yu            2019-03-25  2049  					sector_t *last_block_in_bio,
2df0ab045784a1 Chao Yu            2019-03-25  2050  					bool is_readahead)
f1e8866016b53b Jaegeuk Kim        2015-04-09  2051  {
2df0ab045784a1 Chao Yu            2019-03-25  2052  	struct bio *bio = *bio_ret;
43b9d4b4d91c02 Jaegeuk Kim        2020-11-24  2053  	const unsigned blocksize = blks_to_bytes(inode, 1);
f1e8866016b53b Jaegeuk Kim        2015-04-09  2054  	sector_t block_in_file;
f1e8866016b53b Jaegeuk Kim        2015-04-09  2055  	sector_t last_block;
f1e8866016b53b Jaegeuk Kim        2015-04-09  2056  	sector_t last_block_in_file;
f1e8866016b53b Jaegeuk Kim        2015-04-09  2057  	sector_t block_nr;
2df0ab045784a1 Chao Yu            2019-03-25  2058  	int ret = 0;
f1e8866016b53b Jaegeuk Kim        2015-04-09  2059  
4969c06a0d83c9 Jaegeuk Kim        2019-07-01 @2060  	block_in_file = (sector_t)page_index(page);
f1e8866016b53b Jaegeuk Kim        2015-04-09  2061  	last_block = block_in_file + nr_pages;
43b9d4b4d91c02 Jaegeuk Kim        2020-11-24  2062  	last_block_in_file = bytes_to_blks(inode,
43b9d4b4d91c02 Jaegeuk Kim        2020-11-24  2063  			f2fs_readpage_limit(inode) + blocksize - 1);
f1e8866016b53b Jaegeuk Kim        2015-04-09  2064  	if (last_block > last_block_in_file)
f1e8866016b53b Jaegeuk Kim        2015-04-09  2065  		last_block = last_block_in_file;
f1e8866016b53b Jaegeuk Kim        2015-04-09  2066  
86109c9064daf2 Chao Yu            2019-03-07  2067  	/* just zeroing out page which is beyond EOF */
86109c9064daf2 Chao Yu            2019-03-07  2068  	if (block_in_file >= last_block)
86109c9064daf2 Chao Yu            2019-03-07  2069  		goto zero_out;
f1e8866016b53b Jaegeuk Kim        2015-04-09  2070  	/*
f1e8866016b53b Jaegeuk Kim        2015-04-09  2071  	 * Map blocks using the previous result first.
f1e8866016b53b Jaegeuk Kim        2015-04-09  2072  	 */
2df0ab045784a1 Chao Yu            2019-03-25  2073  	if ((map->m_flags & F2FS_MAP_MAPPED) &&
2df0ab045784a1 Chao Yu            2019-03-25  2074  			block_in_file > map->m_lblk &&
2df0ab045784a1 Chao Yu            2019-03-25  2075  			block_in_file < (map->m_lblk + map->m_len))
f1e8866016b53b Jaegeuk Kim        2015-04-09  2076  		goto got_it;
f1e8866016b53b Jaegeuk Kim        2015-04-09  2077  
f1e8866016b53b Jaegeuk Kim        2015-04-09  2078  	/*
f1e8866016b53b Jaegeuk Kim        2015-04-09  2079  	 * Then do more f2fs_map_blocks() calls until we are
f1e8866016b53b Jaegeuk Kim        2015-04-09  2080  	 * done with this page.
f1e8866016b53b Jaegeuk Kim        2015-04-09  2081  	 */
2df0ab045784a1 Chao Yu            2019-03-25  2082  	map->m_lblk = block_in_file;
2df0ab045784a1 Chao Yu            2019-03-25  2083  	map->m_len = last_block - block_in_file;
f1e8866016b53b Jaegeuk Kim        2015-04-09  2084  
cd8fc5226bef3a Christoph Hellwig  2022-11-28  2085  	ret = f2fs_map_blocks(inode, map, F2FS_GET_BLOCK_DEFAULT);
2df0ab045784a1 Chao Yu            2019-03-25  2086  	if (ret)
2df0ab045784a1 Chao Yu            2019-03-25  2087  		goto out;
f1e8866016b53b Jaegeuk Kim        2015-04-09  2088  got_it:
2df0ab045784a1 Chao Yu            2019-03-25  2089  	if ((map->m_flags & F2FS_MAP_MAPPED)) {
2df0ab045784a1 Chao Yu            2019-03-25  2090  		block_nr = map->m_pblk + block_in_file - map->m_lblk;
f1e8866016b53b Jaegeuk Kim        2015-04-09  2091  		SetPageMappedToDisk(page);
f1e8866016b53b Jaegeuk Kim        2015-04-09  2092  
c9b60788fc760d Chao Yu            2018-08-01  2093  		if (!f2fs_is_valid_blkaddr(F2FS_I_SB(inode), block_nr,
93770ab7a6e963 Chao Yu            2019-04-15  2094  						DATA_GENERIC_ENHANCE_READ)) {
10f966bbf521bb Chao Yu            2019-06-20  2095  			ret = -EFSCORRUPTED;
2df0ab045784a1 Chao Yu            2019-03-25  2096  			goto out;
2df0ab045784a1 Chao Yu            2019-03-25  2097  		}
f1e8866016b53b Jaegeuk Kim        2015-04-09  2098  	} else {
86109c9064daf2 Chao Yu            2019-03-07  2099  zero_out:
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01  2100  		zero_user_segment(page, 0, PAGE_SIZE);
95ae251fe82838 Eric Biggers       2019-07-22  2101  		if (f2fs_need_verity(inode, page->index) &&
95ae251fe82838 Eric Biggers       2019-07-22  2102  		    !fsverity_verify_page(page)) {
95ae251fe82838 Eric Biggers       2019-07-22  2103  			ret = -EIO;
95ae251fe82838 Eric Biggers       2019-07-22  2104  			goto out;
95ae251fe82838 Eric Biggers       2019-07-22  2105  		}
237c0790e54020 Jaegeuk Kim        2016-06-30  2106  		if (!PageUptodate(page))
f1e8866016b53b Jaegeuk Kim        2015-04-09  2107  			SetPageUptodate(page);
f1e8866016b53b Jaegeuk Kim        2015-04-09  2108  		unlock_page(page);
2df0ab045784a1 Chao Yu            2019-03-25  2109  		goto out;
f1e8866016b53b Jaegeuk Kim        2015-04-09  2110  	}
f1e8866016b53b Jaegeuk Kim        2015-04-09  2111  
f1e8866016b53b Jaegeuk Kim        2015-04-09  2112  	/*
f1e8866016b53b Jaegeuk Kim        2015-04-09  2113  	 * This page will go to BIO.  Do we need to send this
f1e8866016b53b Jaegeuk Kim        2015-04-09  2114  	 * BIO off first?
f1e8866016b53b Jaegeuk Kim        2015-04-09  2115  	 */
27aacd28ea3b89 Satya Tangirala    2020-07-02  2116  	if (bio && (!page_is_mergeable(F2FS_I_SB(inode), bio,
27aacd28ea3b89 Satya Tangirala    2020-07-02  2117  				       *last_block_in_bio, block_nr) ||
27aacd28ea3b89 Satya Tangirala    2020-07-02  2118  		    !f2fs_crypt_mergeable_bio(bio, inode, page->index, NULL))) {
f1e8866016b53b Jaegeuk Kim        2015-04-09  2119  submit_and_realloc:
bc29835a9d4860 Christoph Hellwig  2022-11-28  2120  		f2fs_submit_read_bio(F2FS_I_SB(inode), bio, DATA);
f1e8866016b53b Jaegeuk Kim        2015-04-09  2121  		bio = NULL;
f1e8866016b53b Jaegeuk Kim        2015-04-09  2122  	}
f1e8866016b53b Jaegeuk Kim        2015-04-09  2123  	if (bio == NULL) {
e2e59414aae2c8 Jaegeuk Kim        2018-06-21  2124  		bio = f2fs_grab_read_bio(inode, block_nr, nr_pages,
0683728adab251 Chao Yu            2020-02-18  2125  				is_readahead ? REQ_RAHEAD : 0, page->index,
7f59b277f79e8a Eric Biggers       2021-01-04  2126  				false);
1d353eb7e43853 Jaegeuk Kim        2016-07-12  2127  		if (IS_ERR(bio)) {
2df0ab045784a1 Chao Yu            2019-03-25  2128  			ret = PTR_ERR(bio);
1d353eb7e43853 Jaegeuk Kim        2016-07-12  2129  			bio = NULL;
2df0ab045784a1 Chao Yu            2019-03-25  2130  			goto out;
4375a33664de17 Jaegeuk Kim        2015-04-23  2131  		}
f1e8866016b53b Jaegeuk Kim        2015-04-09  2132  	}
f1e8866016b53b Jaegeuk Kim        2015-04-09  2133  
0ded69f632bb71 Jaegeuk Kim        2018-08-22  2134  	/*
0ded69f632bb71 Jaegeuk Kim        2018-08-22  2135  	 * If the page is under writeback, we need to wait for
0ded69f632bb71 Jaegeuk Kim        2018-08-22  2136  	 * its completion to see the correct decrypted data.
0ded69f632bb71 Jaegeuk Kim        2018-08-22  2137  	 */
0ded69f632bb71 Jaegeuk Kim        2018-08-22  2138  	f2fs_wait_on_block_writeback(inode, block_nr);
0ded69f632bb71 Jaegeuk Kim        2018-08-22  2139  
f1e8866016b53b Jaegeuk Kim        2015-04-09  2140  	if (bio_add_page(bio, page, blocksize, 0) < blocksize)
f1e8866016b53b Jaegeuk Kim        2015-04-09  2141  		goto submit_and_realloc;
f1e8866016b53b Jaegeuk Kim        2015-04-09  2142  
5f9abab42b60e6 Jaegeuk Kim        2018-10-16  2143  	inc_page_count(F2FS_I_SB(inode), F2FS_RD_DATA);
34a23525601a16 Chao Yu            2022-08-20  2144  	f2fs_update_iostat(F2FS_I_SB(inode), NULL, FS_DATA_READ_IO,
34a23525601a16 Chao Yu            2022-08-20  2145  							F2FS_BLKSIZE);
2df0ab045784a1 Chao Yu            2019-03-25  2146  	*last_block_in_bio = block_nr;
2df0ab045784a1 Chao Yu            2019-03-25  2147  out:
2df0ab045784a1 Chao Yu            2019-03-25  2148  	*bio_ret = bio;
2df0ab045784a1 Chao Yu            2019-03-25  2149  	return ret;
2df0ab045784a1 Chao Yu            2019-03-25  2150  }
2df0ab045784a1 Chao Yu            2019-03-25  2151  

:::::: The code at line 2060 was first introduced by commit
:::::: 4969c06a0d83c9c3dc50b8efcdc8eeedfce896f6 f2fs: support swap file w/ DIO

:::::: TO: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
:::::: CC: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux