fs/hfs/hfs_fs.h
Source file repositories/reference/linux-study-clean/fs/hfs/hfs_fs.h
File Facts
- System
- Linux kernel
- Corpus path
fs/hfs/hfs_fs.h- Extension
.h- Size
- 9328 bytes
- Lines
- 293
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/slab.hlinux/types.hlinux/mutex.hlinux/buffer_head.hlinux/fs.hlinux/workqueue.hasm/byteorder.hlinux/uaccess.hhfs.h
Detected Declarations
struct hfs_inode_infostruct hfs_sb_infostruct hfs_find_datastruct file_kattrfunction HFS_UTC_OFFSETfunction __hfs_u_to_mtimefunction hfs_bitmap_dirty
Annotated Snippet
extern const struct file_operations hfs_dir_operations;
extern const struct inode_operations hfs_dir_inode_operations;
/* extent.c */
extern int hfs_ext_keycmp(const btree_key *key1, const btree_key *key2);
extern u16 hfs_ext_find_block(struct hfs_extent *ext, u16 off);
extern int hfs_free_fork(struct super_block *sb,
struct hfs_cat_file *file, int type);
extern int hfs_ext_write_extent(struct inode *inode);
extern int hfs_extend_file(struct inode *inode);
extern void hfs_file_truncate(struct inode *inode);
extern int hfs_get_block(struct inode *inode, sector_t block,
struct buffer_head *bh_result, int create);
/* inode.c */
extern const struct address_space_operations hfs_aops;
extern const struct address_space_operations hfs_btree_aops;
struct file_kattr;
int hfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa);
int hfs_write_begin(const struct kiocb *iocb, struct address_space *mapping,
loff_t pos, unsigned int len, struct folio **foliop,
void **fsdata);
extern struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name,
umode_t mode);
extern void hfs_inode_write_fork(struct inode *inode, struct hfs_extent *ext,
__be32 *log_size, __be32 *phys_size);
extern int hfs_write_inode(struct inode *inode, struct writeback_control *wbc);
extern int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
struct iattr *attr);
extern void hfs_inode_read_fork(struct inode *inode, struct hfs_extent *ext,
__be32 __log_size, __be32 phys_size,
u32 clump_size);
extern struct inode *hfs_iget(struct super_block *sb, struct hfs_cat_key *key,
hfs_cat_rec *rec);
extern void hfs_evict_inode(struct inode *inode);
extern void hfs_delete_inode(struct inode *inode);
/* attr.c */
extern const struct xattr_handler * const hfs_xattr_handlers[];
/* mdb.c */
extern bool is_hfs_cnid_counts_valid(struct super_block *sb);
extern int hfs_mdb_get(struct super_block *sb);
extern void hfs_mdb_commit(struct super_block *sb);
extern void hfs_mdb_close(struct super_block *sb);
extern void hfs_mdb_put(struct super_block *sb);
/* part_tbl.c */
extern int hfs_part_find(struct super_block *sb,
sector_t *part_start, sector_t *part_size);
/* string.c */
extern const struct dentry_operations hfs_dentry_operations;
extern int hfs_hash_dentry(const struct dentry *dentry, struct qstr *this);
extern int hfs_strcmp(const unsigned char *s1, unsigned int len1,
const unsigned char *s2, unsigned int len2);
extern int hfs_compare_dentry(const struct dentry *dentry,
unsigned int len, const char *str,
const struct qstr *name);
/* trans.c */
extern void hfs_asc2mac(struct super_block *sb,
struct hfs_name *out, const struct qstr *in);
extern int hfs_mac2asc(struct super_block *sb,
char *out, const struct hfs_name *in);
/* super.c */
extern void hfs_mark_mdb_dirty(struct super_block *sb);
/*
* There are two time systems. Both are based on seconds since
* a particular time/date.
* Unix: signed little-endian since 00:00 GMT, Jan. 1, 1970
* mac: unsigned big-endian since 00:00 GMT, Jan. 1, 1904
*
* HFS implementations are highly inconsistent, this one matches the
* traditional behavior of 64-bit Linux, giving the most useful
* time range between 1970 and 2106, by treating any on-disk timestamp
* under HFS_UTC_OFFSET (Jan 1 1970) as a time between 2040 and 2106.
*/
#define HFS_UTC_OFFSET 2082844800U
static inline time64_t __hfs_m_to_utime(__be32 mt)
{
time64_t ut = (u32)(be32_to_cpu(mt) - HFS_UTC_OFFSET);
return ut + sys_tz.tz_minuteswest * 60;
Annotation
- Immediate include surface: `linux/slab.h`, `linux/types.h`, `linux/mutex.h`, `linux/buffer_head.h`, `linux/fs.h`, `linux/workqueue.h`, `asm/byteorder.h`, `linux/uaccess.h`.
- Detected declarations: `struct hfs_inode_info`, `struct hfs_sb_info`, `struct hfs_find_data`, `struct file_kattr`, `function HFS_UTC_OFFSET`, `function __hfs_u_to_mtime`, `function hfs_bitmap_dirty`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.