以下是关于zfs和zpool的伪原创内容,保持了原文的结构和大意,同时进行了改写:
// 创建一个zpool $ modprobe zfs $ zpool create -f -m /sample sample -o ashift=12 /dev/sdc $ zfs create sample/fs1 -o mountpoint=/sample/fs1 -o atime=off -o canmount=on -o compression=lz4 -o quota=100G -o recordsize=8k -o logbias=throughput <p>// 手动卸载和挂载 $ umount /sample/fs1 $ zfs mount sample/fs1
zpool和zfs参数获取:
// 获取zfs pool的默认参数 $ zpool get all</p><p>// 获取zfs pool挂载文件系统的参数 $ zfs get all
zfs和内核之间的桥梁super_operations:
const Struct super_operations zpl_super_operations = { .alloc_inode = zpl_inode_alloc, .destroy_inode = zpl_inode_destroy, .dirty_inode = zpl_dirty_inode, .write_inode = NULL, .evict_inode = zpl_evict_inode, .put_super = zpl_put_super, .sync_fs = zpl_sync_fs, .statfs = zpl_statfs, .remount_fs = zpl_remount_fs, .show_devname = zpl_show_devname, .show_options = zpl_show_options, .show_stats = NULL, };</p><p>struct file_system_type zpl_fs_type = { .owner = THIS_MODULE, .name = ZFS_DRIVER, .mount = zpl_mount, .kill_sb = zpl_kill_sb, };
inode_operations:
extern const struct inode_operations zpl_inode_operations; extern const struct inode_operations zpl_dir_inode_operations; extern const struct inode_operations zpl_symlink_inode_operations; extern const struct inode_operations zpl_special_inode_operations; extern dentry_operations_t zpl_dentry_operations; extern const struct address_space_operations zpl_address_space_operations; extern const struct file_operations zpl_file_operations; extern const struct file_operations zpl_dir_file_operations;</p><p>/<em> zpl_super.c </em>/ extern void zpl_prune_sb(int64_t nr_to_scan, void *arg); extern const struct super_operations zpl_super_operations; extern const struct export_operations zpl_export_operations; extern struct file_system_type zpl_fs_type;</p><p>const struct inode_operations zpl_inode_operations = { .setattr = zpl_setattr, .getattr = zpl_getattr,</p><h1>ifdef HAVE_GENERIC_SETXATTR</h1><div class="code" style="position:relative; padding:0px; margin:0px;"><div class="code" style="position:relative; padding:0px; margin:0px;"><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">.setxattr = generic_setxattr, .getxattr = generic_getxattr, .removexattr = generic_removexattr,
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END