[sbates130272-p2pmem:p2pdma_user_cmb_v10 5/8] block/bio.c:1227:16: error: implicit declaration of function 'iov_iter_get_pages_flags'; did you mean 'iov_iter_get_pages_alloc'?

From: kernel test robot
Date: Wed Sep 07 2022 - 17:15:40 EST


tree: https://github.com/sbates130272/linux-p2pmem.git p2pdma_user_cmb_v10
head: efd6fef685a844fb4eec90383861b3a0bd48545f
commit: 59e0a213f965c1cdbef34cf99527eae8072e255b [5/8] block: set FOLL_PCI_P2PDMA in __bio_iov_iter_get_pages()
config: powerpc-allnoconfig (https://download.01.org/0day-ci/archive/20220908/202209080503.f1YVsG0F-lkp@xxxxxxxxx/config)
compiler: powerpc-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/sbates130272/linux-p2pmem/commit/59e0a213f965c1cdbef34cf99527eae8072e255b
git remote add sbates130272-p2pmem https://github.com/sbates130272/linux-p2pmem.git
git fetch --no-tags sbates130272-p2pmem p2pdma_user_cmb_v10
git checkout 59e0a213f965c1cdbef34cf99527eae8072e255b
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

block/bio.c: In function '__bio_iov_iter_get_pages':
>> block/bio.c:1227:16: error: implicit declaration of function 'iov_iter_get_pages_flags'; did you mean 'iov_iter_get_pages_alloc'? [-Werror=implicit-function-declaration]
1227 | size = iov_iter_get_pages_flags(iter, pages,
| ^~~~~~~~~~~~~~~~~~~~~~~~
| iov_iter_get_pages_alloc
cc1: some warnings being treated as errors


vim +1227 block/bio.c

1186
1187 /**
1188 * __bio_iov_iter_get_pages - pin user or kernel pages and add them to a bio
1189 * @bio: bio to add pages to
1190 * @iter: iov iterator describing the region to be mapped
1191 *
1192 * Pins pages from *iter and appends them to @bio's bvec array. The
1193 * pages will have to be released using put_page() when done.
1194 * For multi-segment *iter, this function only adds pages from the
1195 * next non-empty segment of the iov iterator.
1196 */
1197 static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter)
1198 {
1199 unsigned short nr_pages = bio->bi_max_vecs - bio->bi_vcnt;
1200 unsigned short entries_left = bio->bi_max_vecs - bio->bi_vcnt;
1201 struct bio_vec *bv = bio->bi_io_vec + bio->bi_vcnt;
1202 struct page **pages = (struct page **)bv;
1203 unsigned int gup_flags = 0;
1204 ssize_t size, left;
1205 unsigned len, i = 0;
1206 size_t offset, trim;
1207 int ret = 0;
1208
1209 /*
1210 * Move page array up in the allocated memory for the bio vecs as far as
1211 * possible so that we can start filling biovecs from the beginning
1212 * without overwriting the temporary page array.
1213 */
1214 BUILD_BUG_ON(PAGE_PTRS_PER_BVEC < 2);
1215 pages += entries_left * (PAGE_PTRS_PER_BVEC - 1);
1216
1217 if (bio->bi_bdev && blk_queue_pci_p2pdma(bio->bi_bdev->bd_disk->queue))
1218 gup_flags |= FOLL_PCI_P2PDMA;
1219
1220 /*
1221 * Each segment in the iov is required to be a block size multiple.
1222 * However, we may not be able to get the entire segment if it spans
1223 * more pages than bi_max_vecs allows, so we have to ALIGN_DOWN the
1224 * result to ensure the bio's total size is correct. The remainder of
1225 * the iov data will be picked up in the next bio iteration.
1226 */
> 1227 size = iov_iter_get_pages_flags(iter, pages,
1228 UINT_MAX - bio->bi_iter.bi_size,
1229 nr_pages, &offset, gup_flags);
1230 if (unlikely(size <= 0))
1231 return size ? size : -EFAULT;
1232
1233 nr_pages = DIV_ROUND_UP(offset + size, PAGE_SIZE);
1234
1235 trim = size & (bdev_logical_block_size(bio->bi_bdev) - 1);
1236 iov_iter_revert(iter, trim);
1237
1238 size -= trim;
1239 if (unlikely(!size)) {
1240 ret = -EFAULT;
1241 goto out;
1242 }
1243
1244 for (left = size, i = 0; left > 0; left -= len, i++) {
1245 struct page *page = pages[i];
1246
1247 len = min_t(size_t, PAGE_SIZE - offset, left);
1248 if (bio_op(bio) == REQ_OP_ZONE_APPEND) {
1249 ret = bio_iov_add_zone_append_page(bio, page, len,
1250 offset);
1251 if (ret)
1252 break;
1253 } else
1254 bio_iov_add_page(bio, page, len, offset);
1255
1256 offset = 0;
1257 }
1258
1259 iov_iter_revert(iter, left);
1260 out:
1261 while (i < nr_pages)
1262 put_page(pages[i++]);
1263
1264 return ret;
1265 }
1266

--
0-DAY CI Kernel Test Service
https://01.org/lkp