fs/jffs2/compr.h
Source file repositories/reference/linux-study-clean/fs/jffs2/compr.h
File Facts
- System
- Linux kernel
- Corpus path
fs/jffs2/compr.h- Extension
.h- Size
- 3713 bytes
- Lines
- 120
- 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.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/vmalloc.hlinux/list.hlinux/types.hlinux/string.hlinux/slab.hlinux/errno.hlinux/fs.hlinux/jffs2.hjffs2_fs_i.hjffs2_fs_sb.hnodelist.h
Detected Declarations
struct jffs2_compressorfunction jffs2_rubinmips_initfunction jffs2_rubinmips_exitfunction jffs2_dynrubin_exitfunction jffs2_rtime_initfunction jffs2_rtime_exitfunction jffs2_zlib_initfunction jffs2_zlib_exitfunction jffs2_lzo_initfunction jffs2_lzo_exit
Annotated Snippet
struct jffs2_compressor {
struct list_head list;
int priority; /* used by prirority comr. mode */
char *name;
char compr; /* JFFS2_COMPR_XXX */
int (*compress)(unsigned char *data_in, unsigned char *cpage_out,
uint32_t *srclen, uint32_t *destlen);
int (*decompress)(unsigned char *cdata_in, unsigned char *data_out,
uint32_t cdatalen, uint32_t datalen);
int usecount;
int disabled; /* if set the compressor won't compress */
unsigned char *compr_buf; /* used by size compr. mode */
uint32_t compr_buf_size; /* used by size compr. mode */
uint32_t stat_compr_orig_size;
uint32_t stat_compr_new_size;
uint32_t stat_compr_blocks;
uint32_t stat_decompr_blocks;
};
int jffs2_register_compressor(struct jffs2_compressor *comp);
int jffs2_unregister_compressor(struct jffs2_compressor *comp);
int jffs2_compressors_init(void);
int jffs2_compressors_exit(void);
uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
unsigned char *data_in, unsigned char **cpage_out,
uint32_t *datalen, uint32_t *cdatalen);
int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
uint16_t comprtype, unsigned char *cdata_in,
unsigned char *data_out, uint32_t cdatalen, uint32_t datalen);
void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig);
/* Compressor modules */
/* These functions will be called by jffs2_compressors_init/exit */
#ifdef CONFIG_JFFS2_RUBIN
int jffs2_rubinmips_init(void);
void jffs2_rubinmips_exit(void);
int jffs2_dynrubin_init(void);
void jffs2_dynrubin_exit(void);
#else
static inline int jffs2_rubinmips_init(void) { return 0; }
static inline void jffs2_rubinmips_exit(void) {}
static inline int jffs2_dynrubin_init(void) { return 0; }
static inline void jffs2_dynrubin_exit(void) {}
#endif
#ifdef CONFIG_JFFS2_RTIME
extern int jffs2_rtime_init(void);
extern void jffs2_rtime_exit(void);
#else
static inline int jffs2_rtime_init(void) { return 0; }
static inline void jffs2_rtime_exit(void) {}
#endif
#ifdef CONFIG_JFFS2_ZLIB
extern int jffs2_zlib_init(void);
extern void jffs2_zlib_exit(void);
#else
static inline int jffs2_zlib_init(void) { return 0; }
static inline void jffs2_zlib_exit(void) {}
#endif
#ifdef CONFIG_JFFS2_LZO
extern int jffs2_lzo_init(void);
extern void jffs2_lzo_exit(void);
#else
static inline int jffs2_lzo_init(void) { return 0; }
static inline void jffs2_lzo_exit(void) {}
#endif
#endif /* __JFFS2_COMPR_H__ */
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/vmalloc.h`, `linux/list.h`, `linux/types.h`, `linux/string.h`, `linux/slab.h`, `linux/errno.h`, `linux/fs.h`.
- Detected declarations: `struct jffs2_compressor`, `function jffs2_rubinmips_init`, `function jffs2_rubinmips_exit`, `function jffs2_dynrubin_exit`, `function jffs2_rtime_init`, `function jffs2_rtime_exit`, `function jffs2_zlib_init`, `function jffs2_zlib_exit`, `function jffs2_lzo_init`, `function jffs2_lzo_exit`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.