fs/squashfs/page_actor.h

Source file repositories/reference/linux-study-clean/fs/squashfs/page_actor.h

File Facts

System
Linux kernel
Corpus path
fs/squashfs/page_actor.h
Extension
.h
Size
1601 bytes
Lines
60
Domain
Core OS
Bucket
VFS And Filesystem Core
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct squashfs_page_actor {
	union {
		void		**buffer;
		struct page	**page;
	};
	void	*pageaddr;
	void	*tmp_buffer;
	void    *(*squashfs_first_page)(struct squashfs_page_actor *);
	void    *(*squashfs_next_page)(struct squashfs_page_actor *);
	void    (*squashfs_finish_page)(struct squashfs_page_actor *);
	struct page *last_page;
	int	pages;
	int	length;
	int	next_page;
	int	alloc_buffer;
	int	returned_pages;
	pgoff_t	next_index;
};

extern struct squashfs_page_actor *squashfs_page_actor_init(void **buffer,
				int pages, int length);
extern struct squashfs_page_actor *squashfs_page_actor_init_special(
				struct squashfs_sb_info *msblk,
				struct page **page, int pages, int length,
				loff_t start_index);
static inline struct page *squashfs_page_actor_free(struct squashfs_page_actor *actor)
{
	struct page *last_page = actor->next_page == actor->pages ? actor->last_page : ERR_PTR(-EIO);

	kfree(actor->tmp_buffer);
	kfree(actor);

	return last_page;
}
static inline void *squashfs_first_page(struct squashfs_page_actor *actor)
{
	return actor->squashfs_first_page(actor);
}
static inline void *squashfs_next_page(struct squashfs_page_actor *actor)
{
	return actor->squashfs_next_page(actor);
}
static inline void squashfs_finish_page(struct squashfs_page_actor *actor)
{
	actor->squashfs_finish_page(actor);
}
static inline void squashfs_actor_nobuff(struct squashfs_page_actor *actor)
{
	actor->alloc_buffer = 0;
}
#endif

Annotation

Implementation Notes