Files
u-boot/include/linux/pagevec.h
Simon Glass ff4a549a34 linux: Add compatibility headers for ext4l extents_status
Add Linux compatibility header stubs needed to compile
extents_status.c:

- backing-dev.h: Backing device info stub
- dax.h: Direct Access (DAX) stubs
- iomap.h: I/O mapping operations and structures
- mman.h: Memory mapping flags
- mount.h: VFS mount structures
- pagevec.h: Page vector batching
- pfn_t.h: Page frame number type
- posix_acl_xattr.h: POSIX ACL xattr definitions
- proc_fs.h: Proc filesystem stub
- uio.h: User I/O vector definitions
- xattr.h: Extended attributes
- trace/events/ext4.h: Trace event stubs

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-12-18 12:34:17 -07:00

47 lines
975 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* include/linux/pagevec.h
*
* In many places it is efficient to batch an operation up against multiple
* folios. A folio_batch is a container which is used for that.
*/
#ifndef _LINUX_PAGEVEC_H
#define _LINUX_PAGEVEC_H
#include <linux/types.h>
/* Minimal stub - pagevec is used for batching page operations */
#define PAGEVEC_SIZE 16
struct folio;
struct folio_batch {
unsigned char nr;
unsigned char i;
bool percpu_pvec_drained;
struct folio *folios[PAGEVEC_SIZE];
};
static inline void folio_batch_init(struct folio_batch *fbatch)
{
fbatch->nr = 0;
fbatch->i = 0;
fbatch->percpu_pvec_drained = false;
}
static inline unsigned int folio_batch_count(struct folio_batch *fbatch)
{
return fbatch->nr;
}
static inline unsigned int folio_batch_add(struct folio_batch *fbatch,
struct folio *folio)
{
fbatch->folios[fbatch->nr++] = folio;
return PAGEVEC_SIZE - fbatch->nr;
}
#endif /* _LINUX_PAGEVEC_H */