[ceph-client:tls_logger 7/19] net/ceph/ceph_san_pagefrag.c:14: warning: Function parameter or struct member 'pf' not described in 'cephsan_pagefrag_init'

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

 



tree:   https://github.com/ceph/ceph-client.git tls_logger
head:   75b56e556ea415e29a13a8b7e98d302fbbec4c01
commit: f8434cc50705f961b879b491d7ea5524b5da1ca1 [7/19] ceph_san: moving to magzaines
config: i386-buildonly-randconfig-001-20250318 (https://download.01.org/0day-ci/archive/20250318/202503181619.RZqFxBO6-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.0 (https://github.com/llvm/llvm-project 24a30daaa559829ad079f2ff7f73eb4e18095f88)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250318/202503181619.RZqFxBO6-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/202503181619.RZqFxBO6-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> net/ceph/ceph_san_pagefrag.c:14: warning: Function parameter or struct member 'pf' not described in 'cephsan_pagefrag_init'
>> net/ceph/ceph_san_pagefrag.c:54: warning: Function parameter or struct member 'pf' not described in 'cephsan_pagefrag_alloc'
>> net/ceph/ceph_san_pagefrag.c:108: warning: Function parameter or struct member 'pf' not described in 'cephsan_pagefrag_free'
>> net/ceph/ceph_san_pagefrag.c:119: warning: Function parameter or struct member 'pf' not described in 'cephsan_pagefrag_deinit'


vim +14 net/ceph/ceph_san_pagefrag.c

     5	
     6	/**
     7	 * cephsan_pagefrag_init - Initialize the pagefrag allocator.
     8	 *
     9	 * Allocates a 4MB contiguous buffer and resets head and tail pointers.
    10	 *
    11	 * Return: 0 on success, negative error code on failure.
    12	 */
    13	int cephsan_pagefrag_init(struct cephsan_pagefrag *pf)
  > 14	{
    15	    pf->pages = alloc_pages(GFP_KERNEL, get_order(CEPHSAN_PAGEFRAG_SIZE));
    16	    if (!pf->pages)
    17	        return -ENOMEM;
    18	
    19	    pf->buffer = page_address(pf->pages);
    20	    pf->head = 0;
    21	    pf->tail = 0;
    22	    return 0;
    23	}
    24	EXPORT_SYMBOL(cephsan_pagefrag_init);
    25	
    26	/**
    27	 * cephsan_pagefrag_init_with_buffer - Initialize pagefrag with an existing buffer
    28	 * @pf: pagefrag allocator to initialize
    29	 * @buffer: pre-allocated buffer to use
    30	 * @size: size of the buffer
    31	 *
    32	 * Return: 0 on success
    33	 */
    34	int cephsan_pagefrag_init_with_buffer(struct cephsan_pagefrag *pf, void *buffer, size_t size)
    35	{
    36	    pf->pages = NULL; /* No pages allocated, using provided buffer */
    37	    pf->buffer = buffer;
    38	    pf->head = 0;
    39	    pf->tail = 0;
    40	    return 0;
    41	}
    42	EXPORT_SYMBOL(cephsan_pagefrag_init_with_buffer);
    43	
    44	/**
    45	 * cephsan_pagefrag_alloc - Allocate bytes from the pagefrag buffer.
    46	 * @n: number of bytes to allocate.
    47	 *
    48	 * Allocates @n bytes if there is sufficient free space in the buffer.
    49	 * Advances the head pointer by @n bytes (wrapping around if needed).
    50	 *
    51	 * Return: pointer to the allocated memory, or NULL if not enough space.
    52	 */
    53	u64 cephsan_pagefrag_alloc(struct cephsan_pagefrag *pf, unsigned int n)
  > 54	{
    55	    /* Case 1: tail > head */
    56	    if (pf->tail > pf->head) {
    57	        if (pf->tail - pf->head >= n) {
    58	            unsigned int prev_head = pf->head;
    59	            pf->head += n;
    60	            return ((u64)n << 32) | prev_head;
    61	        } else {
    62	            pr_err("Not enough space in pagefrag buffer\n");
    63	            return 0;
    64	        }
    65	    }
    66	    /* Case 2: tail <= head */
    67	    if (pf->head + n <= CEPHSAN_PAGEFRAG_SIZE) {
    68	        /* Normal allocation */
    69	        unsigned int prev_head = pf->head;
    70	        pf->head += n;
    71	        return ((u64)n << 32) | prev_head;
    72	    } else {
    73	        /* Need to wrap around */
    74	        if (n <= pf->tail) {
    75	            pf->head = n;
    76	            n += CEPHSAN_PAGEFRAG_SIZE - pf->head;
    77	            return ((u64)n << 32) | 0;
    78	        } else {
    79	            pr_err("Not enough space for wrap-around allocation\n");
    80	            return 0;
    81	        }
    82	    }
    83	    pr_err("impossible: Not enough space in pagefrag buffer\n");
    84	    return 0;
    85	}
    86	EXPORT_SYMBOL(cephsan_pagefrag_alloc);
    87	
    88	/**
    89	 * cephsan_pagefrag_get_ptr - Get buffer pointer from pagefrag allocation result
    90	 * @pf: pagefrag allocator
    91	 * @val: return value from cephsan_pagefrag_alloc
    92	 *
    93	 * Return: pointer to allocated buffer region
    94	 */
    95	void *cephsan_pagefrag_get_ptr(struct cephsan_pagefrag *pf, u64 val)
    96	{
    97	    return pf->buffer + (val & 0xFFFFFFFF);
    98	}
    99	EXPORT_SYMBOL(cephsan_pagefrag_get_ptr);
   100	
   101	/**
   102	 * cephsan_pagefrag_free - Free bytes in the pagefrag allocator.
   103	 * @n: number of bytes to free.
   104	 *
   105	 * Advances the tail pointer by @n bytes (wrapping around if needed).
   106	 */
   107	void cephsan_pagefrag_free(struct cephsan_pagefrag *pf, unsigned int n)
 > 108	{
   109	    pf->tail = (pf->tail + n) & (CEPHSAN_PAGEFRAG_SIZE - 1);
   110	}
   111	EXPORT_SYMBOL(cephsan_pagefrag_free);
   112	
   113	/**
   114	 * cephsan_pagefrag_deinit - Deinitialize the pagefrag allocator.
   115	 *
   116	 * Frees the allocated buffer and resets the head and tail pointers.
   117	 */
   118	void cephsan_pagefrag_deinit(struct cephsan_pagefrag *pf)
 > 119	{

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




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux