All of lore.kernel.org
 help / color / mirror / Atom feed
* [riteshharjani:ext2_dir_buffer_cache_rfc_wip1 15/15] fs/ext2/dir.c:440:26: warning: no previous declaration for 'ext2_find_entry_old'
@ 2023-09-27 20:06 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-09-27 20:06 UTC (permalink / raw)
  To: Ritesh Harjani (IBM); +Cc: oe-kbuild-all

tree:   https://github.com/riteshharjani/linux ext2_dir_buffer_cache_rfc_wip1
head:   3b878bc4805dd97f67ee17c6450059a4a7f2b261
commit: 3b878bc4805dd97f67ee17c6450059a4a7f2b261 [15/15] ext2: everything else to make it work
config: i386-randconfig-141-20230927 (https://download.01.org/0day-ci/archive/20230928/202309280449.KISthPfu-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230928/202309280449.KISthPfu-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309280449.KISthPfu-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/ext2/dir.c:440:26: warning: no previous declaration for 'ext2_find_entry_old' [-Wmissing-declarations]
    struct ext2_dir_entry_2 *ext2_find_entry_old (struct inode *dir,
                             ^~~~~~~~~~~~~~~~~~~
   fs/ext2/dir.c: In function 'ext2_delete_entry':
   fs/ext2/dir.c:818:15: warning: unused variable 'chunksize' [-Wunused-variable]
     unsigned int chunksize = ext2_chunk_size(dir);
                  ^~~~~~~~~
   At top level:
   fs/ext2/dir.c:555:12: warning: 'ext2_handle_dirsync' defined but not used [-Wunused-function]
    static int ext2_handle_dirsync(struct inode *dir)
               ^~~~~~~~~~~~~~~~~~~
   fs/ext2/dir.c:549:12: warning: 'ext2_prepare_chunk' defined but not used [-Wunused-function]
    static int ext2_prepare_chunk(struct page *page, loff_t pos, unsigned len)
               ^~~~~~~~~~~~~~~~~~
   fs/ext2/dir.c:84:13: warning: 'ext2_commit_chunk' defined but not used [-Wunused-function]
    static void ext2_commit_chunk(struct page *page, loff_t pos, unsigned len)
                ^~~~~~~~~~~~~~~~~


vim +/ext2_find_entry_old +440 fs/ext2/dir.c

   423	
   424	/*
   425	 *	ext2_find_entry()
   426	 *
   427	 * finds an entry in the specified directory with the wanted name. It
   428	 * returns the page in which the entry was found (as a parameter - res_page),
   429	 * and the entry itself. Page is returned mapped and unlocked.
   430	 * Entry is guaranteed to be valid.
   431	 *
   432	 * On Success ext2_put_page() should be called on *res_page.
   433	 *
   434	 * NOTE: Calls to ext2_get_page()/ext2_put_page() must be nested according to
   435	 * the rules documented in kmap_local_page()/kunmap_local().
   436	 *
   437	 * ext2_find_entry() and ext2_dotdot() act as a call to ext2_get_page() and
   438	 * should be treated as a call to ext2_get_page() for nesting purposes.
   439	 */
 > 440	struct ext2_dir_entry_2 *ext2_find_entry_old (struct inode *dir,
   441				const struct qstr *child, struct page **res_page)
   442	{
   443		const char *name = child->name;
   444		int namelen = child->len;
   445		unsigned reclen = EXT2_DIR_REC_LEN(namelen);
   446		unsigned long start, n;
   447		unsigned long npages = dir_pages(dir);
   448		struct page *page = NULL;
   449		struct ext2_inode_info *ei = EXT2_I(dir);
   450		ext2_dirent * de;
   451	
   452		if (npages == 0)
   453			goto out;
   454	
   455		/* OFFSET_CACHE */
   456		*res_page = NULL;
   457	
   458		start = ei->i_dir_start_lookup;
   459		if (start >= npages)
   460			start = 0;
   461		n = start;
   462		do {
   463			char *kaddr = ext2_get_page(dir, n, 0, &page);
   464			if (IS_ERR(kaddr))
   465				return ERR_CAST(kaddr);
   466	
   467			de = (ext2_dirent *) kaddr;
   468			kaddr += ext2_last_byte(dir, n) - reclen;
   469			while ((char *) de <= kaddr) {
   470				if (de->rec_len == 0) {
   471					ext2_error(dir->i_sb, __func__,
   472						"zero-length directory entry");
   473					ext2_put_page(page, de);
   474					goto out;
   475				}
   476				if (ext2_match(namelen, name, de))
   477					goto found;
   478				de = ext2_next_entry(de);
   479			}
   480			ext2_put_page(page, kaddr);
   481	
   482			if (++n >= npages)
   483				n = 0;
   484			/* next page is past the blocks we've got */
   485			if (unlikely(n > (dir->i_blocks >> (PAGE_SHIFT - 9)))) {
   486				ext2_error(dir->i_sb, __func__,
   487					"dir %lu size %lld exceeds block count %llu",
   488					dir->i_ino, dir->i_size,
   489					(unsigned long long)dir->i_blocks);
   490				goto out;
   491			}
   492		} while (n != start);
   493	out:
   494		return ERR_PTR(-ENOENT);
   495	
   496	found:
   497		*res_page = page;
   498		ei->i_dir_start_lookup = n;
   499		return de;
   500	}
   501	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-27 20:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-27 20:06 [riteshharjani:ext2_dir_buffer_cache_rfc_wip1 15/15] fs/ext2/dir.c:440:26: warning: no previous declaration for 'ext2_find_entry_old' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.