Skip to content

Commit

Permalink
fs: Fix mtd/sector512.c:554:19: error: incomplete definition of type …
Browse files Browse the repository at this point in the history
…'struct partition_info_s'

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

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
  • Loading branch information
xiaoxiang781216 committed Nov 3, 2024
1 parent 6ba8c1e commit 9882e0e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 32 deletions.
28 changes: 1 addition & 27 deletions include/nuttx/fs/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <nuttx/config.h>

#include <nuttx/compiler.h>
#include <nuttx/fs/ioctl.h>
#include <nuttx/fs/uio.h>

#include <sys/uio.h>
Expand Down Expand Up @@ -251,33 +252,6 @@ struct file_operations
/* This structure provides information about the state of a block driver */

#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
* system. It is used by file systems to perform filesystem transfers. It
* differs from the normal driver vtable in several ways -- most notably in
Expand Down
29 changes: 29 additions & 0 deletions include/nuttx/fs/ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
****************************************************************************/

#include <nuttx/config.h>

#include <stdbool.h>
#include <sys/types.h>

/****************************************************************************
Expand Down Expand Up @@ -757,6 +759,33 @@
* 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
{
FAR void *buf;
Expand Down
10 changes: 5 additions & 5 deletions include/nuttx/streams.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
#include <nuttx/compiler.h>

#ifdef CONFIG_LIBC_LZF
#include <lzf.h>
# include <lzf.h>
#endif
#include <stdio.h>
#ifndef CONFIG_DISABLE_MOUNTPOINT
#include <nuttx/fs/fs.h>
#ifdef CONFIG_MTD
#include <nuttx/mtd/mtd.h>
#endif
# include <nuttx/fs/fs.h>
# ifdef CONFIG_MTD
# include <nuttx/mtd/mtd.h>
# endif
#endif

/****************************************************************************
Expand Down

0 comments on commit 9882e0e

Please sign in to comment.