include/linux/fserror.h

Source file repositories/reference/linux-study-clean/include/linux/fserror.h

File Facts

System
Linux kernel
Corpus path
include/linux/fserror.h
Extension
.h
Size
1833 bytes
Lines
76
Domain
Core OS
Bucket
Core Kernel Interface
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 fserror_event {
	struct work_struct work;
	struct super_block *sb;
	struct inode *inode;
	loff_t pos;
	u64 len;
	enum fserror_type type;

	/* negative error number */
	int error;
};

void fserror_report(struct super_block *sb, struct inode *inode,
		    enum fserror_type type, loff_t pos, u64 len, int error,
		    gfp_t gfp);

static inline void fserror_report_io(struct inode *inode,
				     enum fserror_type type, loff_t pos,
				     u64 len, int error, gfp_t gfp)
{
	fserror_report(inode->i_sb, inode, type, pos, len, error, gfp);
}

static inline void fserror_report_data_lost(struct inode *inode, loff_t pos,
					    u64 len, gfp_t gfp)
{
	fserror_report(inode->i_sb, inode, FSERR_DATA_LOST, pos, len, -EIO,
		       gfp);
}

static inline void fserror_report_file_metadata(struct inode *inode, int error,
						gfp_t gfp)
{
	fserror_report(inode->i_sb, inode, FSERR_METADATA, 0, 0, error, gfp);
}

static inline void fserror_report_metadata(struct super_block *sb, int error,
					   gfp_t gfp)
{
	fserror_report(sb, NULL, FSERR_METADATA, 0, 0, error, gfp);
}

static inline void fserror_report_shutdown(struct super_block *sb, gfp_t gfp)
{
	fserror_report(sb, NULL, FSERR_METADATA, 0, 0, -ESHUTDOWN, gfp);
}

#endif /* _LINUX_FSERROR_H__ */

Annotation

Implementation Notes