* [f2fs-dev] Multi device fs and udev
@ 2021-12-05 17:37 Ananth Bhaskararaman
2021-12-07 21:43 ` Jaegeuk Kim
0 siblings, 1 reply; 3+ messages in thread
From: Ananth Bhaskararaman @ 2021-12-05 17:37 UTC (permalink / raw)
To: linux-f2fs-devel@lists.sourceforge.net
I have a multi-disk f2fs device, and when I run lsblk, it shows the fs
only on the main device.
I'd like all devices to show up with the mounted fs like btrfs
multi-device arrays.
I'd also like udev to recognise that both devices are used by this fs.
Right now, the second device just shows up as unknown.
I'm intereseted in adding this support myself.
I'd appreciate any tips on where I can get started with this.
Ananth
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] Multi device fs and udev
2021-12-05 17:37 [f2fs-dev] Multi device fs and udev Ananth Bhaskararaman
@ 2021-12-07 21:43 ` Jaegeuk Kim
2021-12-09 13:29 ` Ananth Bhaskararaman
0 siblings, 1 reply; 3+ messages in thread
From: Jaegeuk Kim @ 2021-12-07 21:43 UTC (permalink / raw)
To: Ananth Bhaskararaman; +Cc: linux-f2fs-devel@lists.sourceforge.net
On 12/05, Ananth Bhaskararaman wrote:
> I have a multi-disk f2fs device, and when I run lsblk, it shows the fs
> only on the main device.
> I'd like all devices to show up with the mounted fs like btrfs
> multi-device arrays.
> I'd also like udev to recognise that both devices are used by this fs.
> Right now, the second device just shows up as unknown.
>
> I'm intereseted in adding this support myself.
> I'd appreciate any tips on where I can get started with this.
Hi,
You can get the block list from f2fs superblock in the first 4KB.
740 struct f2fs_super_block {
741 __le32 magic; /* Magic Number */
742 __le16 major_ver; /* Major Version */
743 __le16 minor_ver; /* Minor Version */
744 __le32 log_sectorsize; /* log2 sector size in bytes */
745 __le32 log_sectors_per_block; /* log2 # of sectors per block */
746 __le32 log_blocksize; /* log2 block size in bytes */
747 __le32 log_blocks_per_seg; /* log2 # of blocks per segment */
748 __le32 segs_per_sec; /* # of segments per section */
749 __le32 secs_per_zone; /* # of sections per zone */
750 __le32 checksum_offset; /* checksum offset inside super block */
751 __le64 block_count; /* total # of user blocks */
752 __le32 section_count; /* total # of sections */
753 __le32 segment_count; /* total # of segments */
754 __le32 segment_count_ckpt; /* # of segments for checkpoint */
755 __le32 segment_count_sit; /* # of segments for SIT */
756 __le32 segment_count_nat; /* # of segments for NAT */
757 __le32 segment_count_ssa; /* # of segments for SSA */
758 __le32 segment_count_main; /* # of segments for main area */
759 __le32 segment0_blkaddr; /* start block address of segment 0 */
760 __le32 cp_blkaddr; /* start block address of checkpoint */
761 __le32 sit_blkaddr; /* start block address of SIT */
762 __le32 nat_blkaddr; /* start block address of NAT */
763 __le32 ssa_blkaddr; /* start block address of SSA */
764 __le32 main_blkaddr; /* start block address of main area */
765 __le32 root_ino; /* root inode number */
766 __le32 node_ino; /* node inode number */
767 __le32 meta_ino; /* meta inode number */
768 __u8 uuid[16]; /* 128-bit uuid for volume */
769 __le16 volume_name[MAX_VOLUME_NAME]; /* volume name */
770 __le32 extension_count; /* # of extensions below */
771 __u8 extension_list[F2FS_MAX_EXTENSION][8]; /* extension array */
772 __le32 cp_payload;
773 __u8 version[VERSION_LEN]; /* the kernel version */
774 __u8 init_version[VERSION_LEN]; /* the initial kernel version */
775 __le32 feature; /* defined features */
776 __u8 encryption_level; /* versioning level for encryption */
777 __u8 encrypt_pw_salt[16]; /* Salt used for string2key algorithm */
778 struct f2fs_device devs[MAX_DEVICES]; /* device list */
------------------------------------------
735 struct f2fs_device {
736 __u8 path[MAX_PATH_LEN];
737 __le32 total_segments;
738 } __attribute__((packed));
Here.
----------------------------------------
779 __le32 qf_ino[F2FS_MAX_QUOTAS]; /* quota inode numbers */
780 __u8 hot_ext_count; /* # of hot file extension */
781 __le16 s_encoding; /* Filename charset encoding */
782 __le16 s_encoding_flags; /* Filename charset encoding flags */
783 __u8 reserved[306]; /* valid reserved region */
784 __le32 crc; /* checksum of superblock */
785 } __attribute__((packed));
Thanks,
>
> Ananth
>
>
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-09 13:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-05 17:37 [f2fs-dev] Multi device fs and udev Ananth Bhaskararaman
2021-12-07 21:43 ` Jaegeuk Kim
2021-12-09 13:29 ` Ananth Bhaskararaman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.