fs/xfs/xfs_inode.h
Source file repositories/reference/linux-study-clean/fs/xfs/xfs_inode.h
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/xfs_inode.h- Extension
.h- Size
- 20379 bytes
- Lines
- 677
- 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.
- 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
xfs_inode_buf.hxfs_inode_fork.hxfs_inode_util.h
Detected Declarations
struct xfs_dinodestruct xfs_inodestruct xfs_bufstruct xfs_bmbt_irecstruct xfs_inode_log_itemstruct xfs_mountstruct xfs_transstruct xfs_dquotenum layout_break_reasonfunction xfs_inode_on_unlinked_listfunction xfs_inode_has_attr_forkfunction xfs_ifork_ptrfunction xfs_inode_fork_bofffunction xfs_inode_data_fork_sizefunction xfs_inode_attr_fork_sizefunction xfs_inode_fork_sizefunction I_INOfunction XFS_ISIZEfunction xfs_new_eoffunction __xfs_iflags_setfunction xfs_iflags_setfunction xfs_iflags_clearfunction __xfs_iflags_testfunction xfs_iflags_testfunction xfs_iflags_test_and_clearfunction xfs_iflags_test_and_setfunction xfs_is_reflink_inodefunction xfs_is_metadir_inodefunction xfs_is_internal_inodefunction xfs_is_zoned_inodefunction xfs_is_cow_inodefunction xfs_inode_has_filedatafunction xfs_inode_has_cow_datafunction xfs_inode_has_bigtimefunction xfs_inode_has_large_extent_countsfunction xfs_inode_has_bigrtallocfunction xfs_inode_can_hw_atomic_writefunction xfs_inode_can_sw_atomic_writefunction xfs_itruncate_extentsfunction xfs_update_stable_writesfunction xfs_finish_inode_setupfunction xfs_inode_unlinked_incomplete
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
* All Rights Reserved.
*/
#ifndef __XFS_INODE_H__
#define __XFS_INODE_H__
#include "xfs_inode_buf.h"
#include "xfs_inode_fork.h"
#include "xfs_inode_util.h"
/*
* Kernel only inode definitions
*/
struct xfs_dinode;
struct xfs_inode;
struct xfs_buf;
struct xfs_bmbt_irec;
struct xfs_inode_log_item;
struct xfs_mount;
struct xfs_trans;
struct xfs_dquot;
typedef struct xfs_inode {
/* Inode linking and identification information. */
struct xfs_mount *i_mount; /* fs mount struct ptr */
struct xfs_dquot *i_udquot; /* user dquot */
struct xfs_dquot *i_gdquot; /* group dquot */
struct xfs_dquot *i_pdquot; /* project dquot */
/* Inode location stuff */
struct xfs_imap i_imap; /* location for xfs_imap() */
/* Extent information. */
struct xfs_ifork *i_cowfp; /* copy on write extents */
struct xfs_ifork i_df; /* data fork */
struct xfs_ifork i_af; /* attribute fork */
/* Transaction and locking information. */
struct xfs_inode_log_item *i_itemp; /* logging information */
struct rw_semaphore i_lock; /* inode lock */
atomic_t i_pincount; /* inode pin count */
struct llist_node i_gclist; /* deferred inactivation list */
/*
* Bitsets of inode metadata that have been checked and/or are sick.
* Callers must hold i_flags_lock before accessing this field.
*/
uint16_t i_checked;
uint16_t i_sick;
spinlock_t i_flags_lock; /* inode i_flags lock */
/* Miscellaneous state. */
unsigned long i_flags; /* see defined flags below */
uint64_t i_delayed_blks; /* count of delay alloc blks */
xfs_fsize_t i_disk_size; /* number of bytes in file */
xfs_rfsblock_t i_nblocks; /* # of direct & btree blocks */
prid_t i_projid; /* owner's project id */
xfs_extlen_t i_extsize; /* basic/minimum extent size */
/*
* i_used_blocks is used for zoned rtrmap inodes,
* i_cowextsize is used for other v3 inodes,
* i_flushiter for v1/2 inodes
*/
union {
uint32_t i_used_blocks; /* used blocks in RTG */
xfs_extlen_t i_cowextsize; /* basic cow extent size */
uint16_t i_flushiter; /* incremented on flush */
};
uint8_t i_forkoff; /* attr fork offset >> 3 */
enum xfs_metafile_type i_metatype; /* XFS_METAFILE_* */
uint16_t i_diflags; /* XFS_DIFLAG_... */
uint64_t i_diflags2; /* XFS_DIFLAG2_... */
struct timespec64 i_crtime; /* time created */
/*
* Unlinked list pointers. These point to the next and previous inodes
* in the AGI unlinked bucket list, respectively. These fields can
* only be updated with the AGI locked.
*
* i_next_unlinked caches di_next_unlinked.
*/
xfs_agino_t i_next_unlinked;
/*
* If the inode is not on an unlinked list, this field is zero. If the
* inode is the first element in an unlinked list, this field is
* NULLAGINO. Otherwise, i_prev_unlinked points to the previous inode
* in the unlinked list.
Annotation
- Immediate include surface: `xfs_inode_buf.h`, `xfs_inode_fork.h`, `xfs_inode_util.h`.
- Detected declarations: `struct xfs_dinode`, `struct xfs_inode`, `struct xfs_buf`, `struct xfs_bmbt_irec`, `struct xfs_inode_log_item`, `struct xfs_mount`, `struct xfs_trans`, `struct xfs_dquot`, `enum layout_break_reason`, `function xfs_inode_on_unlinked_list`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source 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.