Find Jobs
Hire Freelancers

Creating a small File System

$10-30 USD

กำลังดำเนินการ
โพสต์ เกือบ 6 ปีที่ผ่านมา

$10-30 USD

ชำระเงินเมื่อส่งงาน
Write a module to create a small file system called "myfs" that does only a few operations including read and write. First, define your file system type using: static struct file_system_type myfs_type = { .owner = THIS_MODULE, .name = "myfs", .mount = myfs_mount, .kill_sb = kill_block_super, .fs_flags = FS_REQUIRES_DEV, }; See static struct file_system_type ext4_fs_type defined in fs/ext4/super.c as an example. Write a module to register/unregister your own file system: module_init(myfs_init_fs) module_exit(mtfs_exit_fs) myfs_init_fs will register myfs_type defined above while myfs_exit_fs will unregister. See module_init(ext4_init_fs) and module_exit(ext4_exit_fs) defined in fs/ext4/super.c as an example. 3318-4292 Implement myfs_mount() defined in myfs_type just like ext4_mount, except you need to pass your own func pointer myfs_fill_super which will be called in mount_bdev(). As we discussed in class, global variable super_blocks holds a list of super blocks using list_head and mount_bdev() gets a superblock which needs to be filled by myfs_fill_super. Hence, you need to implement myfs_fill_super(). Start with simple_fill_super() as an example to implement your own. ext4_fill_super is almost 1000 lines which you don't want to bother at this moment. Add your own super_operations to super_block and again the starting point is simple_super_operations while "super_operations ext4_sops" exists for ext4. simple_super_operations has nothing much in it so you need to add a couple of fields such as .alloc_inode by consulting ext4_ops. static struct super_operations myfs_super_operations = { .statfs = simple_statfs, .alloc_inode = ext4_alloc_inode, }; Add inode_operations to super_block as well. Again as simple_dir_inode_operations has not much in it, you need to check with ext4_ops to add a few fields. static struct inode_operations myfs_inode_operations = { .lookup = simple_lookup, .link = simple_link, .mkdir = simple_mkdir, }; Do similiar for basic file_operations for myfs_file_ops with a couple of additional fields: static struct file_operations myfs_file_operations = { .open = myfs_open, .read = myfs_read_file, .write = myfs_write_file, }; Don't forget to put in a magic number to distinguish your file system with others. See #define EXT4_SUPER_MAGIC 0xEF53 as an example. #define MYFS_SUPER_MAGIC 0x???? Afer all is said and done, /sbin/insmod the ko file and "mount -t myfs myfs /mnt";. Issue the following commands: cat /proc/filesystems; ls -l /mnt; mount; cat /mnt/myfile0; stat -f myfile0; ln /mnt/myfile0 /mnt/link0 ... Show all the output results including linking
รหัสโปรเจกต์: 16739235

เกี่ยวกับโปรเจกต์

โปรเจกต์ระยะไกล
ใช้งานอยู่ 6 ปีที่ผ่านมา

กำลังมองหาการสร้างรายได้ใช่ไหม?

ประโยชน์ของการประมูลกับ Freelancer

กำหนดงบประมาณและกรอบเวลาของคุณ
รับเงินจากการงานของคุณ
อธิบายข้อเสนอของคุณในภาพรวม
ลงทะเบียนและเสนอราคาฟรี

เกี่ยวกับลูกค้า

ปักธงของ UNITED STATES
Kearny, United States
5.0
2
ยืนยันวิธีการชำระเงินแล้ว
เป็นสมาชิกตั้งแต่ เม.ย. 19, 2018

การยืนยันลูกค้า

ขอบคุณ! เราได้ส่งลิงก์สำหรับเครดิตฟรีให้คุณทางอีเมลแล้ว
เกิดข้อผิดพลาดขณะส่งอีเมลของคุณ กรุณาลองอีกครั้ง
โลโก้ Freelancer Thailand / ภาษาไทย ช่วยเหลือและสนับสนุน FreelancerประเภทโปรเจคการประกวดFreelancerองค์กรแพ็กเกจสมาชิกโครงการ Freelancer ชั้นแนวหน้าการจัดการโปรเจคงานในพื้นที่Photo Anywhereหน้าจัดแสดงผลงานAPI สำหรับนักพัฒนาได้รับการยืนยันDesktop App เกี่ยวกับเกี่ยวกับเราวิธีใช้งานความปลอดภัยนักลงทุนแผนผังเว็บไซต์เรื่องราวข่าวออกสื่อทีมรางวัลข่าวประชาสัมพันธ์ร่วมงานกับเรา ข้อกำหนดนโยบายความเป็นส่วนตัวข้อกำหนดและเงื่อนไขนโยบายลิขสิทธิ์ข้อพึงปฏิบัติค่าธรรมเนียมและค่าบริการหุ้นส่วนEscrow.comLoadshiftWarrior Forum แอปโลโก้ Apple App Store โลโก้ Google Play
ไม่สามารถคัดลอกไปยังคลิปบอร์ดได้ โปรดลองอีกครั้งหลังปรับเปลี่ยนการอนุญาต
คัดลอกไปยังคลิปบอร์ดแล้ว
ผู้ใช้ที่ลงทะเบียน งานที่มีการโพสต์ทั้งหมด
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
กำลังโหลดตัวอย่าง
ได้รับอนุญาตสำหรับตำแหน่งทางภูมิศาสตร์
เซสชั่นการเข้าสู่ระบบของคุณหมดอายุและคุณได้ออกจากระบบแล้ว กรุณาเข้าสู่ระบบอีกครั้ง