Hi Sergei,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on xfs-linux/for-next]
[also build test WARNING on hnaz-linux-mm/master v5.9]
[cannot apply to block/for-next linus/master next-20201021]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Sergei-Shtepa/block-layer-filter...
base:
https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git for-next
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.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/0day-ci/linux/commit/dbf569c929b7f5795312a2a87bb61f2cb...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Sergei-Shtepa/block-layer-filter-and-block-device-snapshot-module/20201021-170553
git checkout dbf569c929b7f5795312a2a87bb61f2cb91a9b44
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/mutex.h:15,
from drivers/block/blk-snap/common.h:13,
from drivers/block/blk-snap/blk_deferred.c:3:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with
null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET
&& (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro
'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/block/blk-snap/blk_deferred.c: At top level:
> drivers/block/blk-snap/blk_deferred.c:140:13: warning: no
previous prototype for '_blk_deferred_bio_alloc' [-Wmissing-prototypes]
140 | struct bio *_blk_deferred_bio_alloc(int nr_iovecs)
| ^~~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/blk_deferred.c:198:10: warning: no
previous prototype for '_blk_deferred_submit_pages' [-Wmissing-prototypes]
198 | sector_t _blk_deferred_submit_pages(struct block_device *blk_dev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/mutex.h:15,
from drivers/block/blk-snap/common.h:13,
from drivers/block/blk-snap/blk_descr_file.c:3:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with
null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET
&& (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro
'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/block/blk-snap/blk_descr_file.c: At top level:
> drivers/block/blk-snap/blk_descr_file.c:39:6: warning: no
previous prototype for '_blk_descr_file_cleanup' [-Wmissing-prototypes]
39 | void _blk_descr_file_cleanup(void *descr_array, size_t count)
| ^~~~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/mutex.h:15,
from drivers/block/blk-snap/common.h:13,
from drivers/block/blk-snap/blk_descr_mem.c:3:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with
null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET
&& (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro
'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/block/blk-snap/blk_descr_mem.c: At top level:
> drivers/block/blk-snap/blk_descr_mem.c:23:6: warning: no previous
prototype for 'blk_descr_mem_cleanup' [-Wmissing-prototypes]
23 | void
blk_descr_mem_cleanup(void *descr_array, size_t count)
| ^~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/mutex.h:15,
from drivers/block/blk-snap/common.h:13,
from drivers/block/blk-snap/blk_redirect.c:3:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with
null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET
&& (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro
'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/block/blk-snap/blk_redirect.c: At top level:
> drivers/block/blk-snap/blk_redirect.c:44:13: warning: no previous
prototype for '_blk_dev_redirect_bio_alloc' [-Wmissing-prototypes]
44
| struct bio *_blk_dev_redirect_bio_alloc(int nr_iovecs, void *bi_private)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/blk_redirect.c:58:31: warning: no previous
prototype for '_redirect_bio_allocate_list' [-Wmissing-prototypes]
58
| struct blk_redirect_bio_list *_redirect_bio_allocate_list(struct bio *new_bio)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/blk_redirect.c:72:5: warning: no previous
prototype for 'bio_endio_list_push' [-Wmissing-prototypes]
72 | int
bio_endio_list_push(struct blk_redirect_bio *rq_redir, struct bio *new_bio)
| ^~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/blk_redirect.c:97:6: warning: no previous
prototype for 'bio_endio_list_cleanup' [-Wmissing-prototypes]
97 |
void bio_endio_list_cleanup(struct blk_redirect_bio_list *curr)
| ^~~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/mutex.h:15,
from drivers/block/blk-snap/common.h:13,
from drivers/block/blk-snap/cbt_map.c:3:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with
null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET
&& (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro
'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/block/blk-snap/cbt_map.c: At top level:
> drivers/block/blk-snap/cbt_map.c:6:5: warning: no previous
prototype for 'cbt_map_allocate' [-Wmissing-prototypes]
6 | int
cbt_map_allocate(struct cbt_map *cbt_map, unsigned int cbt_sect_in_block_degree,
| ^~~~~~~~~~~~~~~~
> drivers/block/blk-snap/cbt_map.c:45:6: warning: no previous
prototype for 'cbt_map_deallocate' [-Wmissing-prototypes]
45 | void
cbt_map_deallocate(struct cbt_map *cbt_map)
| ^~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/cbt_map.c:92:6: warning: no previous
prototype for 'cbt_map_destroy_cb' [-Wmissing-prototypes]
92 | void
cbt_map_destroy_cb(struct kref *kref)
| ^~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/cbt_map.c:132:5: warning: no previous
prototype for '_cbt_map_set' [-Wmissing-prototypes]
132 | int
_cbt_map_set(struct cbt_map *cbt_map, sector_t sector_start, sector_t sector_cnt,
| ^~~~~~~~~~~~
--
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/mutex.h:15,
from drivers/block/blk-snap/common.h:13,
from drivers/block/blk-snap/ctrl_fops.c:3:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with
null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET
&& (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro
'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/block/blk-snap/ctrl_fops.c: At top level:
> drivers/block/blk-snap/ctrl_fops.c:140:5: warning: no previous
prototype for 'ioctl_compatibility_flags' [-Wmissing-prototypes]
140 |
int ioctl_compatibility_flags(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:159:5: warning: no previous
prototype for 'ioctl_get_version' [-Wmissing-prototypes]
159 | int
ioctl_get_version(unsigned long arg)
| ^~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:174:5: warning: no previous
prototype for 'ioctl_tracking_add' [-Wmissing-prototypes]
174 | int
ioctl_tracking_add(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:188:5: warning: no previous
prototype for 'ioctl_tracking_remove' [-Wmissing-prototypes]
188 | int
ioctl_tracking_remove(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:200:5: warning: no previous
prototype for 'ioctl_tracking_collect' [-Wmissing-prototypes]
200 | int
ioctl_tracking_collect(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:263:5: warning: no previous
prototype for 'ioctl_tracking_block_size' [-Wmissing-prototypes]
263 |
int ioctl_tracking_block_size(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:276:5: warning: no previous
prototype for 'ioctl_tracking_read_cbt_map' [-Wmissing-prototypes]
276
| int ioctl_tracking_read_cbt_map(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:294:5: warning: no previous
prototype for 'ioctl_tracking_mark_dirty_blocks' [-Wmissing-prototypes]
294 | int ioctl_tracking_mark_dirty_blocks(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:334:5: warning: no previous
prototype for 'ioctl_snapshot_create' [-Wmissing-prototypes]
334 | int
ioctl_snapshot_create(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:401:5: warning: no previous
prototype for 'ioctl_snapshot_destroy' [-Wmissing-prototypes]
401 | int
ioctl_snapshot_destroy(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:426:5: warning: no previous
prototype for 'ioctl_snapstore_create' [-Wmissing-prototypes]
426 | int
ioctl_snapstore_create(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:468:5: warning: no previous
prototype for 'ioctl_snapstore_file' [-Wmissing-prototypes]
468 | int
ioctl_snapstore_file(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:504:5: warning: no previous
prototype for 'ioctl_snapstore_memory' [-Wmissing-prototypes]
504 | int
ioctl_snapstore_memory(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:520:5: warning: no previous
prototype for 'ioctl_snapstore_cleanup' [-Wmissing-prototypes]
520 |
int ioctl_snapstore_cleanup(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:547:5: warning: no previous
prototype for 'ioctl_snapstore_file_multidev' [-Wmissing-prototypes]
547 | int ioctl_snapstore_file_multidev(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:596:5: warning: no previous
prototype for 'ioctl_snapshot_errno' [-Wmissing-prototypes]
596 | int
ioctl_snapshot_errno(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/ctrl_fops.c:623:5: warning: no previous
prototype for 'ioctl_collect_snapimages' [-Wmissing-prototypes]
623 |
int ioctl_collect_snapimages(unsigned long arg)
| ^~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/mutex.h:15,
from drivers/block/blk-snap/common.h:13,
from drivers/block/blk-snap/main.c:2:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with
null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET
&& (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro
'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/block/blk-snap/main.c: At top level:
> drivers/block/blk-snap/main.c:17:12: warning: no previous
prototype for 'blk_snap_init' [-Wmissing-prototypes]
17 | int __init
blk_snap_init(void)
| ^~~~~~~~~~~~~
> drivers/block/blk-snap/main.c:52:13: warning: no previous
prototype for 'blk_snap_exit' [-Wmissing-prototypes]
52 | void __exit
blk_snap_exit(void)
| ^~~~~~~~~~~~~
--
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/mutex.h:15,
from drivers/block/blk-snap/common.h:13,
from drivers/block/blk-snap/snapimage.c:3:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with
null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET
&& (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro
'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/block/blk-snap/snapimage.c: At top level:
> drivers/block/blk-snap/snapimage.c:56:5: warning: no previous
prototype for '_snapimage_open' [-Wmissing-prototypes]
56 | int
_snapimage_open(struct block_device *bdev, fmode_t mode)
| ^~~~~~~~~~~~~~~
> drivers/block/blk-snap/snapimage.c:97:5: warning: no previous
prototype for '_snapimage_getgeo' [-Wmissing-prototypes]
97 | int
_snapimage_getgeo(struct block_device *bdev, struct hd_geometry *geo)
| ^~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/snapimage.c:143:6: warning: no previous
prototype for '_snapimage_close' [-Wmissing-prototypes]
143 | void
_snapimage_close(struct gendisk *disk, fmode_t mode)
| ^~~~~~~~~~~~~~~~
> drivers/block/blk-snap/snapimage.c:165:5: warning: no previous
prototype for '_snapimage_ioctl' [-Wmissing-prototypes]
165 | int
_snapimage_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long
arg)
| ^~~~~~~~~~~~~~~~
> drivers/block/blk-snap/snapimage.c:231:5: warning: no previous
prototype for '_snapimage_request_write' [-Wmissing-prototypes]
231 |
int _snapimage_request_write(struct snapimage *image, struct blk_redirect_bio *rq_redir)
| ^~~~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/snapimage.c:277:6: warning: no previous
prototype for '_snapimage_processing' [-Wmissing-prototypes]
277 | void
_snapimage_processing(struct snapimage *image)
| ^~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/snapimage.c:299:5: warning: no previous
prototype for 'snapimage_processor_waiting' [-Wmissing-prototypes]
299
| int snapimage_processor_waiting(struct snapimage *image)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/snapimage.c:316:5: warning: no previous
prototype for 'snapimage_processor_thread' [-Wmissing-prototypes]
316 |
int snapimage_processor_thread(void *data)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/snapimage.c:361:6: warning: no previous
prototype for '_snapimage_bio_complete_cb' [-Wmissing-prototypes]
361 |
void _snapimage_bio_complete_cb(void *complete_param, struct bio *bio, int err)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/snapimage.c:373:5: warning: no previous
prototype for '_snapimage_throttling' [-Wmissing-prototypes]
373 | int
_snapimage_throttling(struct defer_io *defer_io)
| ^~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/snapimage.c:557:5: warning: no previous
prototype for 'snapimage_create' [-Wmissing-prototypes]
557 | int
snapimage_create(dev_t original_dev)
| ^~~~~~~~~~~~~~~~
> drivers/block/blk-snap/snapimage.c:782:6: warning: no previous
prototype for 'snapimage_destroy_for' [-Wmissing-prototypes]
782 | void
snapimage_destroy_for(dev_t *p_dev, int count)
| ^~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/mutex.h:15,
from drivers/block/blk-snap/common.h:13,
from drivers/block/blk-snap/snapstore.c:3:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of pointer with
null pointer [-Wextra]
169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET
&& (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro
'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
drivers/block/blk-snap/snapstore.c: At top level:
> drivers/block/blk-snap/snapstore.c:12:6: warning: no previous
prototype for '_snapstore_check_halffill' [-Wmissing-prototypes]
12 |
bool _snapstore_check_halffill(struct snapstore *snapstore, sector_t *fill_status)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/snapstore.c:31:6: warning: no previous
prototype for '_snapstore_destroy' [-Wmissing-prototypes]
31 | void
_snapstore_destroy(struct snapstore *snapstore)
| ^~~~~~~~~~~~~~~~~~
> drivers/block/blk-snap/snapstore.c:251:19: warning: no previous
prototype for '_snapstore_find' [-Wmissing-prototypes]
251 | struct
snapstore *_snapstore_find(uuid_t *id)
| ^~~~~~~~~~~~~~~
> drivers/block/blk-snap/snapstore.c:350:5: warning: no previous
prototype for 'rangelist_add' [-Wmissing-prototypes]
350 | int
rangelist_add(struct list_head *rglist, struct blk_range *rg)
| ^~~~~~~~~~~~~
..
vim +/_blk_deferred_bio_alloc +140 drivers/block/blk-snap/blk_deferred.c
139
140 struct bio *_blk_deferred_bio_alloc(int nr_iovecs)
141 {
142 struct bio *new_bio = bio_alloc_bioset(GFP_NOIO, nr_iovecs,
&blk_deferred_bioset);
143
144 if (new_bio == NULL)
145 return NULL;
146
147 new_bio->bi_end_io = blk_deferred_bio_endio;
148 new_bio->bi_private = ((void *)new_bio) - sizeof(struct dio_bio_complete);
149
150 return new_bio;
151 }
152
153 static void blk_deferred_complete(struct blk_deferred_request *dio_req, sector_t
portion_sect_cnt,
154 int result)
155 {
156 atomic64_add(portion_sect_cnt, &dio_req->sect_processed);
157
158 if (dio_req->sect_len == atomic64_read(&dio_req->sect_processed))
159 complete(&dio_req->complete);
160
161 if (result != SUCCESS) {
162 dio_req->result = result;
163 pr_err("Failed to process defer IO request. errno=%d\n", result);
164 }
165 }
166
167 void blk_deferred_bio_endio(struct bio *bio)
168 {
169 int local_err;
170 struct dio_bio_complete *complete_param = (struct dio_bio_complete
*)bio->bi_private;
171
172 if (complete_param == NULL) {
173 //bio already complete
174 } else {
175 if (bio->bi_status != BLK_STS_OK)
176 local_err = -EIO;
177 else
178 local_err = SUCCESS;
179
180 blk_deferred_complete(complete_param->dio_req,
complete_param->bio_sect_len,
181 local_err);
182 bio->bi_private = NULL;
183 }
184
185 bio_put(bio);
186 }
187
188 static inline size_t _page_count_calculate(sector_t size_sector)
189 {
190 size_t page_count = size_sector / (PAGE_SIZE / SECTOR_SIZE);
191
192 if (unlikely(size_sector & ((PAGE_SIZE / SECTOR_SIZE) - 1)))
193 page_count += 1;
194
195 return page_count;
196 }
197
198 sector_t _blk_deferred_submit_pages(struct block_device *blk_dev,
199 struct blk_deferred_request *dio_req, int direction,
200 sector_t arr_ofs, struct page **page_array, sector_t ofs_sector,
201 sector_t size_sector)
202 {
203 struct bio *bio = NULL;
204 int nr_iovecs;
205 int page_inx = arr_ofs >> (PAGE_SHIFT - SECTOR_SHIFT);
206 sector_t process_sect = 0;
207
208 nr_iovecs = _page_count_calculate(size_sector);
209
210 while (NULL == (bio = _blk_deferred_bio_alloc(nr_iovecs))) {
211 size_sector = (size_sector >> 1) & ~((PAGE_SIZE / SECTOR_SIZE) - 1);
212 if (size_sector == 0)
213 return 0;
214
215 nr_iovecs = _page_count_calculate(size_sector);
216 }
217
218 bio_set_dev(bio, blk_dev);
219
220 if (direction == READ)
221 bio_set_op_attrs(bio, REQ_OP_READ, 0);
222 else
223 bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
224
225 bio->bi_iter.bi_sector = ofs_sector;
226
227 { //add first
228 sector_t unordered = arr_ofs & ((PAGE_SIZE / SECTOR_SIZE) - 1);
229 sector_t bvec_len_sect =
230 min_t(sector_t, ((PAGE_SIZE / SECTOR_SIZE) - unordered), size_sector);
231 struct page *page = page_array[page_inx];
232 unsigned int len = (unsigned int)from_sectors(bvec_len_sect);
233 unsigned int offset = (unsigned int)from_sectors(unordered);
234
235 if (unlikely(page == NULL)) {
236 pr_err("NULL found in page array");
237 bio_put(bio);
238 return 0;
239 }
240 if (unlikely(bio_add_page(bio, page, len, offset) != len)) {
241 bio_put(bio);
242 return 0;
243 }
244 ++page_inx;
245 process_sect += bvec_len_sect;
246 }
247
248 while (process_sect < size_sector) {
249 sector_t bvec_len_sect =
250 min_t(sector_t, (PAGE_SIZE / SECTOR_SIZE), (size_sector - process_sect));
251 struct page *page = page_array[page_inx];
252 unsigned int len = (unsigned int)from_sectors(bvec_len_sect);
253
254
255 if (unlikely(page == NULL)) {
256 pr_err("NULL found in page array");
257 break;
258 }
259 if (unlikely(bio_add_page(bio, page, len, 0) != len))
260 break;
261
262 ++page_inx;
263 process_sect += bvec_len_sect;
264 }
265
266 ((struct dio_bio_complete *)bio->bi_private)->dio_req = dio_req;
267 ((struct dio_bio_complete *)bio->bi_private)->bio_sect_len = process_sect;
268
269 submit_bio_direct(bio);
270
271 return process_sect;
272 }
273
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org