fs: Fix mtd/sector512.c:554:19: error: incomplete definition of type 'struct partition_info_s'

by moving geometry and partition_info_s to include/fs/ioctl.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2024-11-03 02:45:21 +08:00 committed by Xiang Xiao
parent 6ba8c1e9f9
commit 9882e0e9c3
3 changed files with 35 additions and 32 deletions

View File

@ -30,6 +30,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/compiler.h> #include <nuttx/compiler.h>
#include <nuttx/fs/ioctl.h>
#include <nuttx/fs/uio.h> #include <nuttx/fs/uio.h>
#include <sys/uio.h> #include <sys/uio.h>
@ -251,33 +252,6 @@ struct file_operations
/* This structure provides information about the state of a block driver */ /* This structure provides information about the state of a block driver */
#ifndef CONFIG_DISABLE_MOUNTPOINT #ifndef CONFIG_DISABLE_MOUNTPOINT
struct geometry
{
bool geo_available; /* true: The device is available */
bool geo_mediachanged; /* true: The media has changed since last query */
bool geo_writeenabled; /* true: It is okay to write to this device */
blkcnt_t geo_nsectors; /* Number of sectors on the device */
blksize_t geo_sectorsize; /* Size of one sector */
/* NULL-terminated string representing the device model */
char geo_model[NAME_MAX + 1];
};
struct partition_info_s
{
size_t numsectors; /* Number of sectors in the partition */
size_t sectorsize; /* Size in bytes of a single sector */
off_t startsector; /* Offset to the first section/block of the
* managed sub-region */
/* NULL-terminated string representing the name of the parent node of the
* partition.
*/
char parent[NAME_MAX + 1];
};
/* This structure is provided by block devices when they register with the /* This structure is provided by block devices when they register with the
* system. It is used by file systems to perform filesystem transfers. It * system. It is used by file systems to perform filesystem transfers. It
* differs from the normal driver vtable in several ways -- most notably in * differs from the normal driver vtable in several ways -- most notably in

View File

@ -28,6 +28,8 @@
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdbool.h>
#include <sys/types.h> #include <sys/types.h>
/**************************************************************************** /****************************************************************************
@ -757,6 +759,33 @@
* Public Type Definitions * Public Type Definitions
****************************************************************************/ ****************************************************************************/
struct geometry
{
bool geo_available; /* true: The device is available */
bool geo_mediachanged; /* true: The media has changed since last query */
bool geo_writeenabled; /* true: It is okay to write to this device */
blkcnt_t geo_nsectors; /* Number of sectors on the device */
blksize_t geo_sectorsize; /* Size of one sector */
/* NULL-terminated string representing the device model */
char geo_model[NAME_MAX + 1];
};
struct partition_info_s
{
size_t numsectors; /* Number of sectors in the partition */
size_t sectorsize; /* Size in bytes of a single sector */
off_t startsector; /* Offset to the first section/block of the
* managed sub-region */
/* NULL-terminated string representing the name of the parent node of the
* partition.
*/
char parent[NAME_MAX + 1];
};
struct pipe_peek_s struct pipe_peek_s
{ {
FAR void *buf; FAR void *buf;

View File

@ -30,14 +30,14 @@
#include <nuttx/compiler.h> #include <nuttx/compiler.h>
#ifdef CONFIG_LIBC_LZF #ifdef CONFIG_LIBC_LZF
#include <lzf.h> # include <lzf.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
#ifndef CONFIG_DISABLE_MOUNTPOINT #ifndef CONFIG_DISABLE_MOUNTPOINT
#include <nuttx/fs/fs.h> # include <nuttx/fs/fs.h>
#ifdef CONFIG_MTD # ifdef CONFIG_MTD
#include <nuttx/mtd/mtd.h> # include <nuttx/mtd/mtd.h>
#endif # endif
#endif #endif
/**************************************************************************** /****************************************************************************