Linux 文件系统之ext4
星空探索
linux
展开
-
Linux ramfs, rootfs and initramfs
ramfs, rootfs and initramfs October 17, 2005 Rob Landley <rob@landley.net> =============================What is ramfs?--------------Ramfs is a very simple filesystem that exports Linux's disk...原创 2019-08-09 10:34:54 · 750 阅读 · 0 评论 -
ext4 log1
ext4_map_blocks(): inode 8, flag 0, max_blocks 1,logical block 0ext4_map_blocks(): inode 8, flag 0, max_blocks 1,logical block 0ext4_map_blocks(): inode 8, flag 0, max_blocks 1,logical block 1ex原创 2018-01-08 14:29:56 · 217 阅读 · 0 评论 -
ext4 block map log
blocks 0/1 requested for inode 8 size=88584192blocks 1/1 requested for inode 8 size=88584192blocks 2/1 requested for inode 8 size=88584192blocks 3/1 requested for inode 8 size=88584192bloc原创 2018-01-08 14:28:30 · 266 阅读 · 0 评论 -
ext4 extent 寻址方案
Extent Tree In ext4, the file to logical block map has been replaced with an extent tree. Under the old scheme, allocating a contiguous run of 1,000 blocks requires an indirect block to map all 1,000原创 2018-01-06 21:18:36 · 737 阅读 · 0 评论 -
ext4 直接和间接块寻址
Direct/Indirect Block Addressing In ext2/3, file block numbers were mapped to logical block numbers by means of an (up to) three level 1-1 block map. To find the logical block that stores a particul原创 2018-01-06 19:43:27 · 1311 阅读 · 0 评论 -
ext4 fs format
$ sudo mke2fs -t ext4 /dev/sdcmke2fs 1.42.9 (4-Feb-2014)/dev/sdc is entire device, not just one partition!Proceed anyway? (y,n) yFilesystem label=OS type: LinuxBlock size=4096 (log=2)Fra原创 2018-01-06 10:42:41 · 459 阅读 · 0 评论 -
ext4 block info
Disk /dev/sdc: 15.5 GB, 15472047104 bytes32 heads, 63 sectors/track, 14989 cylinders, total 30218842 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512原创 2018-01-06 10:35:07 · 210 阅读 · 0 评论 -
ext4 节点映射块
/* * The ext4_map_blocks() function tries to look up the requested blocks, * and returns if the blocks are already mapped. * * Otherwise it takes the write lock of the i_data_sem and allocate原创 2018-01-05 20:26:12 · 601 阅读 · 0 评论 -
ext4 定位块所在的块组
/* * The free blocks are managed by bitmaps. A file system contains several * blocks groups. Each group contains 1 bitmap block for blocks, 1 bitmap * block for inodes, N blocks for the inode原创 2018-01-05 20:17:46 · 475 阅读 · 0 评论 -
ext4 读取块组下的节点位图
/* * Read the inode allocation bitmap for a given block_group, reading * into the specified slot in the superblock's bitmap cache. * Return buffer_head of bitmap on success or NULL. */static stru原创 2018-01-05 20:08:06 · 880 阅读 · 0 评论 -
ext4 分配节点 核心层操作
static struct inode *alloc_inode(struct super_block *sb){ struct inode *inode; if (sb->s_op->alloc_inode) inode = sb->s_op->alloc_inode(sb); else inode = kmem_cach原创 2018-01-05 19:58:53 · 627 阅读 · 0 评论 -
ext4 分配节点ext4_alloc_inode
/* * Called inside transaction, so use GFP_NOFS */static struct inode *ext4_alloc_inode(struct super_block *sb){ struct ext4_inode_info *ei; ei = kmem_cache_alloc(ext4_inode_cachep原创 2018-01-05 19:44:40 · 756 阅读 · 0 评论 -
EXT4之mount可选项
static const match_table_t tokens = { {Opt_bsd_df, "bsddf"}, {Opt_minix_df, "minixdf"}, {Opt_grpid, "grpid"}, {Opt_grpid, "bsdgroups"}, {Opt_nogrpid, "nogrpid"}, {Opt_nogrpid, "sysvgroups"原创 2018-01-03 09:16:26 · 2477 阅读 · 0 评论 -
ext4 EXT4 features
EXT4 features Compatibility Any existing Ext3 filesystem can be mounted as Ext4 without requiring any on-disk format changes. However, it is possible to upgrade an Ext3 filesystem to take advantage翻译 2018-01-09 11:12:08 · 591 阅读 · 0 评论 -
ext4 General Information
General Information Ext4 was released as a functionally complete and stable filesystem in Linux 2.6.28, and it's getting included in all the modern distros (in some cases as the default fs), so if you转载 2018-01-09 11:15:49 · 179 阅读 · 0 评论 -
ext4 创建文件系统
Creating ext4 filesystems Creating a new ext4 filesystem is very easy once you have upgraded to e2fsprogs 1.41 or later. Simply type: # mke2fs -t ext4 /dev/DEV or # mkfs.ext4 /dev/DEV Once the files原创 2018-01-09 11:17:07 · 3268 阅读 · 0 评论 -
ext4 inode 分配
原创 2019-08-08 11:31:09 · 348 阅读 · 0 评论 -
ext4 节点inode.i_block描述
The Contents of inode.i_block Depending on the type of file an inode describes, the 60 bytes of storage in inode.i_block can be used in different ways. In general, regular files and directories will原创 2018-01-09 13:49:24 · 1119 阅读 · 0 评论 -
ext4 节点表
Inode Table In a regular UNIX filesystem, the inode stores all the metadata pertaining to the file (time stamps, block maps, extended attributes, etc), not the directory entry. To find the informatio原创 2018-01-09 13:46:40 · 538 阅读 · 0 评论 -
ext5 块和节点表
Block and inode Bitmaps The data block bitmap tracks the usage of data blocks within the block group. The inode bitmap records which entries in the inode table are in use. As with most bitmaps, one bi原创 2018-01-09 13:43:19 · 654 阅读 · 0 评论 -
ext4 块组介绍
Block Group Descriptors Each block group on the filesystem has one of these descriptors associated with it. As noted in the Layout section above, the group descriptors (if present) are the second ite原创 2018-01-09 13:39:26 · 910 阅读 · 0 评论 -
EXT4 超级块介绍
The Super Block The superblock records various information about the enclosing filesystem, such as block counts, inode counts, supported features, maintenance information, and more. If the sparse_supe原创 2018-01-09 13:35:48 · 1742 阅读 · 0 评论 -
ext4 Overview
Overview An ext4 file system is split into a series of block groups. To reduce performance difficulties due to fragmentation, the block allocator tries very hard to keep each file's blocks within t原创 2018-01-09 11:25:58 · 442 阅读 · 0 评论 -
ext4 Terminology
Terminology ext4 divides a storage device into an array of logical blocks both to reduce bookkeeping overhead and to increase throughput by forcing larger transfer sizes. Generally, the block size原创 2018-01-09 11:24:17 · 227 阅读 · 0 评论 -
ext4_register_li_request
int ext4_register_li_request(struct super_block *sb, ext4_group_t first_not_zeroed){ struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_li_request *elr = NULL; ext4_group_t ngroups =原创 2017-03-07 08:16:26 · 315 阅读 · 0 评论 -
ext4_run_lazyinit_thread
ext4_run_lazyinit_threadstatic int ext4_run_lazyinit_thread(void){ ext4_lazyinit_task = kthread_run(ext4_lazyinit_thread, ext4_li_info, "ext4lazyinit"); if (IS_ERR(ext4_lazyinit_task)原创 2017-03-07 08:15:54 · 849 阅读 · 0 评论 -
ext4 块读取ext4_bread
ext4_breadstruct buffer_head *ext4_bread(handle_t *handle, struct inode *inode, ext4_lblk_t block, int map_flags){ struct buffer_head *bh; bh = ext4_getblk(handle, inode,原创 2017-03-07 08:15:04 · 683 阅读 · 0 评论 -
ext4 ext4_map_blocks
struct ext4_map_blocks { ext4_fsblk_t m_pblk; ext4_lblk_t m_lblk; unsigned int m_len; unsigned int m_flags;};/* * The ext4_map_blocks() function tries to look up the reques原创 2017-03-07 08:13:29 · 1373 阅读 · 0 评论 -
ext4 ext4_init_fs
static int __init ext4_init_fs(void){ int i, err; ratelimit_state_init(&ext4_mount_msg_ratelimit, 30 * HZ, 64); ext4_li_info = NULL; mutex_init(&ext4_li_mtx); /* Build-time check f原创 2017-03-06 10:15:40 · 589 阅读 · 0 评论 -
ext4 ext4_mount
ext4_mountstatic struct dentry *ext4_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data){ return mount_bdev(fs_type, flags, dev_name, data, ext4_fill原创 2017-03-06 10:14:16 · 1201 阅读 · 0 评论 -
ext4 ext4_fill_super
ext4_fill_superstatic int ext4_fill_super(struct super_block *sb, void *data, int silent){ char *orig_data = kstrdup(data, GFP_KERNEL); struct buffer_head *bh; struct ext4_super_block *e原创 2017-03-06 10:12:27 · 2488 阅读 · 0 评论 -
ext4 ext4_getblk
/* * `handle' can be NULL if create is zero */struct buffer_head *ext4_getblk(handle_t *handle, struct inode *inode, ext4_lblk_t block, int map_flags){ struct ext4_map_blocks map; str原创 2017-03-06 10:11:36 · 514 阅读 · 0 评论 -
ext4 目录inode操作ext4_dir_inode_operations
ext4_dir_inode_operationsconst struct inode_operations ext4_dir_inode_operations = { .create = ext4_create, .lookup = ext4_lookup, .link = ext4_link, .unlink = ext4_unlink, .symlink =原创 2017-03-05 14:29:25 · 651 阅读 · 0 评论 -
ext4 文件inode操作ext4_file_inode_operations
ext4_file_inode_operationsconst struct inode_operations ext4_file_inode_operations = { .setattr = ext4_setattr, .getattr = ext4_getattr, .listxattr = ext4_listxattr, .get_acl = ext4_ge原创 2017-03-05 14:27:07 · 625 阅读 · 0 评论 -
ext4 目录文件 ext4_dir_operations
ext4_dir_operationsconst struct file_operations ext4_dir_operations = { .llseek = ext4_dir_llseek, .read = generic_read_dir, .iterate_shared = ext4_readdir, .unlocked_ioctl = ext4_ioctl,原创 2017-03-05 14:25:13 · 798 阅读 · 0 评论 -
ext4 普通文件接口 ext4_file_operations
ext4_file_operationsconst struct file_operations ext4_file_operations = { .llseek = ext4_llseek, .read_iter = generic_file_read_iter, .write_iter = ext4_file_write_iter, .unlocked_ioctl =原创 2017-03-05 14:23:32 · 995 阅读 · 0 评论 -
ext4_init_sysfs
int __init ext4_init_sysfs(void){ int ret; kobject_set_name(&ext4_kset.kobj, "ext4"); ext4_kset.kobj.parent = fs_kobj; ret = kset_register(&ext4_kset); if (ret) return ret; re原创 2017-03-07 08:16:56 · 326 阅读 · 0 评论 -
ext4_mpage_readpages
int ext4_mpage_readpages(struct address_space *mapping, struct list_head *pages, struct page *page, unsigned nr_pages){ struct bio *bio = NULL; sector_t last_block_in_bio = 0; st原创 2017-03-07 08:17:18 · 1253 阅读 · 0 评论 -
ext4_file_open
static int ext4_file_open(struct inode * inode, struct file * filp){ struct super_block *sb = inode->i_sb; struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); struct vfsmount *mnt = filp->f_path.原创 2017-03-07 08:18:16 · 749 阅读 · 0 评论 -
ext4 ext4_super_block
struct ext4_super_block/* * Structure of the super block */struct ext4_super_block {/*00*/ __le32 s_inodes_count; /* Inodes count */ __le32 s_blocks_count_lo; /* Blocks count */ __le32原创 2017-03-07 08:27:36 · 1125 阅读 · 0 评论