From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Ananth Bhaskararaman <antsub@gmail.com>
Cc: "linux-f2fs-devel@lists.sourceforge.net"
<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [f2fs-dev] Multi device fs and udev
Date: Tue, 7 Dec 2021 13:43:48 -0800 [thread overview]
Message-ID: <Ya/VlEjA/AfUlsP8@google.com> (raw)
In-Reply-To: <00F7D971-AEE1-4EBC-86AE-CA9BAB947D96@getmailspring.com>
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
next prev parent reply other threads:[~2021-12-07 21:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-05 17:37 [f2fs-dev] Multi device fs and udev Ananth Bhaskararaman
2021-12-07 21:43 ` Jaegeuk Kim [this message]
2021-12-09 13:29 ` Ananth Bhaskararaman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ya/VlEjA/AfUlsP8@google.com \
--to=jaegeuk@kernel.org \
--cc=antsub@gmail.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.