- Added fat_mount_partition(partition_t*) helper function
- Extracts parent block device and start_lba from partition
- Calls fat_mount with extracted parameters
- Maintains compatibility with existing fat_mount signature
- Tests: 124/124 PASS
#include "fs.h"
#include "blockdev.h"
+#include "partition.h"
#include <stdint.h>
enum fat_type {
* Returns a mount result with root node and superblock, or {NULL, NULL} on failure. */
vfs_mount_result_t fat_mount(block_device_t* bdev, uint32_t partition_lba);
+/* Mount FAT filesystem from a partition (uses partition's parent and start_lba) */
+vfs_mount_result_t fat_mount_partition(partition_t* part);
+
/* Unmount a FAT filesystem and free its resources */
void fat_umount(struct fat_mount* fm);
#include "fat.h"
#include "fs.h"
#include "blockdev.h"
+#include "partition.h"
#include "heap.h"
#include "utils.h"
#include "console.h"
kfree(fm);
}
}
+
+vfs_mount_result_t fat_mount_partition(partition_t* part) {
+ if (!part || !part->parent) {
+ vfs_mount_result_t result = {NULL, NULL};
+ return result;
+ }
+ return fat_mount(part->parent, part->start_lba);
+}