All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Howells <dhowells@redhat.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [dhowells-fs:netfs-writeback 10/12] fs/netfs/main.c:113:6: error: call to undeclared function 'mempool_init_slab_pool'; ISO C99 and later do not support implicit function declarations
Date: Sat, 16 Mar 2024 07:07:39 +0800	[thread overview]
Message-ID: <202403160648.2OM4lIMG-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-writeback
head:   be938ad004e7a8f28cc6fc8500c120c7687339f7
commit: ada115ace095d0356bbe99f34838822434d0f2df [10/12] netfs: Use mempools for allocating requests and subrequests
config: i386-buildonly-randconfig-001-20240316 (https://download.01.org/0day-ci/archive/20240316/202403160648.2OM4lIMG-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240316/202403160648.2OM4lIMG-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/202403160648.2OM4lIMG-lkp@intel.com/

All errors (new ones prefixed by >>):

>> fs/netfs/main.c:113:6: error: call to undeclared function 'mempool_init_slab_pool'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     113 |         if (mempool_init_slab_pool(&netfs_request_pool, 100, netfs_request_slab) < 0)
         |             ^
>> fs/netfs/main.c:146:2: error: call to undeclared function 'mempool_exit'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     146 |         mempool_exit(&netfs_subrequest_pool);
         |         ^
   fs/netfs/main.c:162:2: error: call to undeclared function 'mempool_exit'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     162 |         mempool_exit(&netfs_subrequest_pool);
         |         ^
>> fs/netfs/main.c:28:11: error: tentative definition has type 'mempool_t' (aka 'struct mempool_s') that is never completed
      28 | mempool_t netfs_request_pool;
         |           ^
   include/linux/netfs.h:23:16: note: forward declaration of 'struct mempool_s'
      23 | typedef struct mempool_s mempool_t;
         |                ^
   fs/netfs/main.c:29:11: error: tentative definition has type 'mempool_t' (aka 'struct mempool_s') that is never completed
      29 | mempool_t netfs_subrequest_pool;
         |           ^
   include/linux/netfs.h:23:16: note: forward declaration of 'struct mempool_s'
      23 | typedef struct mempool_s mempool_t;
         |                ^
   5 errors generated.
--
>> fs/netfs/objects.c:31:10: error: call to undeclared function 'mempool_alloc'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      31 |                 rreq = mempool_alloc(ctx->ops->request_pool ?: &netfs_request_pool, GFP_KERNEL);
         |                        ^
>> fs/netfs/objects.c:31:8: error: incompatible integer to pointer conversion assigning to 'struct netfs_io_request *' from 'int' [-Wint-conversion]
      31 |                 rreq = mempool_alloc(ctx->ops->request_pool ?: &netfs_request_pool, GFP_KERNEL);
         |                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> fs/netfs/objects.c:59:4: error: call to undeclared function 'mempool_free'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      59 |                         mempool_free(rreq, rreq->netfs_ops->request_pool ?: &netfs_request_pool);
         |                         ^
   fs/netfs/objects.c:95:2: error: call to undeclared function 'mempool_free'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      95 |         mempool_free(rreq, rreq->netfs_ops->request_pool ?: &netfs_request_pool);
         |         ^
   fs/netfs/objects.c:155:12: error: call to undeclared function 'mempool_alloc'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     155 |                 subreq = mempool_alloc(rreq->netfs_ops->subrequest_pool ?: &netfs_subrequest_pool,
         |                          ^
>> fs/netfs/objects.c:155:10: error: incompatible integer to pointer conversion assigning to 'struct netfs_io_subrequest *' from 'int' [-Wint-conversion]
     155 |                 subreq = mempool_alloc(rreq->netfs_ops->subrequest_pool ?: &netfs_subrequest_pool,
         |                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     156 |                                        GFP_KERNEL);
         |                                        ~~~~~~~~~~~
   fs/netfs/objects.c:190:2: error: call to undeclared function 'mempool_free'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     190 |         mempool_free(subreq, rreq->netfs_ops->subrequest_pool ?: &netfs_subrequest_pool);
         |         ^
   7 errors generated.


vim +/mempool_init_slab_pool +113 fs/netfs/main.c

    25	
    26	static struct kmem_cache *netfs_request_slab;
    27	static struct kmem_cache *netfs_subrequest_slab;
  > 28	mempool_t netfs_request_pool;
    29	mempool_t netfs_subrequest_pool;
    30	
    31	#ifdef CONFIG_PROC_FS
    32	LIST_HEAD(netfs_io_requests);
    33	DEFINE_SPINLOCK(netfs_proc_lock);
    34	
    35	static const char *netfs_origins[nr__netfs_io_origin] = {
    36		[NETFS_READAHEAD]		= "RA",
    37		[NETFS_READPAGE]		= "RP",
    38		[NETFS_READ_FOR_WRITE]		= "RW",
    39		[NETFS_COPY_TO_CACHE]		= "CC",
    40		[NETFS_WRITEBACK]		= "WB",
    41		[NETFS_WRITETHROUGH]		= "WT",
    42		[NETFS_UNBUFFERED_WRITE]	= "UW",
    43		[NETFS_DIO_READ]		= "DR",
    44		[NETFS_DIO_WRITE]		= "DW",
    45	};
    46	
    47	/*
    48	 * Generate a list of I/O requests in /proc/fs/netfs/requests
    49	 */
    50	static int netfs_requests_seq_show(struct seq_file *m, void *v)
    51	{
    52		struct netfs_io_request *rreq;
    53	
    54		if (v == &netfs_io_requests) {
    55			seq_puts(m,
    56				 "REQUEST  OR REF FL ERR  OPS COVERAGE\n"
    57				 "======== == === == ==== === =========\n"
    58				 );
    59			return 0;
    60		}
    61	
    62		rreq = list_entry(v, struct netfs_io_request, proc_link);
    63		seq_printf(m,
    64			   "%08x %s %3d %2lx %4d %3d @%04llx %zx/%zx",
    65			   rreq->debug_id,
    66			   netfs_origins[rreq->origin],
    67			   refcount_read(&rreq->ref),
    68			   rreq->flags,
    69			   rreq->error,
    70			   atomic_read(&rreq->nr_outstanding),
    71			   rreq->start, rreq->submitted, rreq->len);
    72		seq_putc(m, '\n');
    73		return 0;
    74	}
    75	
    76	static void *netfs_requests_seq_start(struct seq_file *m, loff_t *_pos)
    77		__acquires(rcu)
    78	{
    79		rcu_read_lock();
    80		return seq_list_start_head(&netfs_io_requests, *_pos);
    81	}
    82	
    83	static void *netfs_requests_seq_next(struct seq_file *m, void *v, loff_t *_pos)
    84	{
    85		return seq_list_next(v, &netfs_io_requests, _pos);
    86	}
    87	
    88	static void netfs_requests_seq_stop(struct seq_file *m, void *v)
    89		__releases(rcu)
    90	{
    91		rcu_read_unlock();
    92	}
    93	
    94	static const struct seq_operations netfs_requests_seq_ops = {
    95		.start  = netfs_requests_seq_start,
    96		.next   = netfs_requests_seq_next,
    97		.stop   = netfs_requests_seq_stop,
    98		.show   = netfs_requests_seq_show,
    99	};
   100	#endif /* CONFIG_PROC_FS */
   101	
   102	static int __init netfs_init(void)
   103	{
   104		int ret = -ENOMEM;
   105	
   106		netfs_request_slab = kmem_cache_create("netfs_request",
   107						       sizeof(struct netfs_io_request), 0,
   108						       SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT,
   109						       NULL);
   110		if (!netfs_request_slab)
   111			goto error_req;
   112	
 > 113		if (mempool_init_slab_pool(&netfs_request_pool, 100, netfs_request_slab) < 0)
   114			goto error_reqpool;
   115	
   116		netfs_subrequest_slab = kmem_cache_create("netfs_subrequest",
   117							  sizeof(struct netfs_io_subrequest), 0,
   118							  SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT,
   119							  NULL);
   120		if (!netfs_subrequest_slab)
   121			goto error_subreq;
   122	
   123		if (mempool_init_slab_pool(&netfs_subrequest_pool, 100, netfs_subrequest_slab) < 0)
   124			goto error_subreqpool;
   125	
   126		if (!proc_mkdir("fs/netfs", NULL))
   127			goto error_proc;
   128		if (!proc_create_seq("fs/netfs/requests", S_IFREG | 0444, NULL,
   129				     &netfs_requests_seq_ops))
   130			goto error_procfile;
   131	#ifdef CONFIG_FSCACHE_STATS
   132		if (!proc_create_single("fs/netfs/stats", S_IFREG | 0444, NULL,
   133					netfs_stats_show))
   134			goto error_procfile;
   135	#endif
   136	
   137		ret = fscache_init();
   138		if (ret < 0)
   139			goto error_fscache;
   140		return 0;
   141	
   142	error_fscache:
   143	error_procfile:
   144		remove_proc_entry("fs/netfs", NULL);
   145	error_proc:
 > 146		mempool_exit(&netfs_subrequest_pool);
   147	error_subreqpool:
   148		kmem_cache_destroy(netfs_subrequest_slab);
   149	error_subreq:
   150		mempool_exit(&netfs_request_pool);
   151	error_reqpool:
   152		kmem_cache_destroy(netfs_request_slab);
   153	error_req:
   154		return ret;
   155	}
   156	fs_initcall(netfs_init);
   157	

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

                 reply	other threads:[~2024-03-15 23:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202403160648.2OM4lIMG-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dhowells@redhat.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.