fs: Remove magic field from partition_info_s
since it is wrong and impossible to return file system magic number from the block or mtd layer. Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
3421a0be38
commit
af72376773
@ -218,7 +218,6 @@ static int cxd56_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->density / PAGE_SIZE;
|
||||
info->sectorsize = PAGE_SIZE;
|
||||
info->startsector = 0;
|
||||
|
@ -355,7 +355,6 @@ static int lc823450_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nblocks;
|
||||
info->sectorsize = priv->blocksize;
|
||||
info->startsector = 0;
|
||||
|
@ -893,7 +893,6 @@ static int lpc43_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_SPIFI_SECTOR512
|
||||
info->numsectors = priv->nblocks <<
|
||||
(SPIFI_BLKSHIFT - SPIFI_512SHIFT);
|
||||
|
@ -251,7 +251,6 @@ static int ameba_flash_ioctl(FAR struct mtd_dev_s *dev,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors *
|
||||
AMEBA_SECTOR_SIZE / AMEBA_PAGE_SIZE;
|
||||
info->sectorsize = AMEBA_PAGE_SIZE;
|
||||
|
@ -400,7 +400,6 @@ static int tiva_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = TIVA_VIRTUAL_NPAGES;
|
||||
info->sectorsize = TIVA_FLASH_PAGESIZE;
|
||||
info->startsector = 0;
|
||||
|
@ -313,7 +313,6 @@ int bl602_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->config->flash_size /
|
||||
SPIFLASH_BLOCKSIZE;
|
||||
info->sectorsize = SPIFLASH_BLOCKSIZE;
|
||||
|
@ -880,7 +880,6 @@ static int esp32c3_ioctl(struct mtd_dev_s *dev, int cmd,
|
||||
struct partition_info_s *info = (struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = SPI_FLASH_SIZE / SPI_FLASH_BLK_SIZE;
|
||||
info->sectorsize = SPI_FLASH_BLK_SIZE;
|
||||
info->startsector = 0;
|
||||
|
@ -1936,7 +1936,6 @@ static int esp32_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = MTD_SIZE(priv) / MTD_BLKSIZE(priv);
|
||||
info->sectorsize = MTD_BLKSIZE(priv);
|
||||
info->startsector = 0;
|
||||
|
@ -584,7 +584,6 @@ static int imxrt_flexspi_nor_ioctl(FAR struct mtd_dev_s *dev,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = 32768; /* 8MB only */
|
||||
info->sectorsize = NOR_PAGE_SIZE;
|
||||
info->startsector = 0;
|
||||
|
@ -638,7 +638,6 @@ static int at24c_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#if CONFIG_AT24XX_MTD_BLOCKSIZE > AT24XX_PAGESIZE
|
||||
info->numsectors = (CONFIG_AT24XX_SIZE * 1024 / 8) /
|
||||
CONFIG_AT24XX_MTD_BLOCKSIZE;
|
||||
|
@ -645,7 +645,6 @@ static int at25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
|
@ -811,7 +811,6 @@ static int at45db_ioctl(FAR struct mtd_dev_s *mtd,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->npages;
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
info->startsector = 0;
|
||||
|
@ -442,7 +442,6 @@ static int filemtd_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nblocks *
|
||||
priv->erasesize / priv->blocksize;
|
||||
info->sectorsize = priv->blocksize;
|
||||
|
@ -951,7 +951,6 @@ static int gd25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors *
|
||||
GD25_SECTOR_SIZE / GD25_PAGE_SIZE;
|
||||
info->sectorsize = GD25_PAGE_SIZE;
|
||||
|
@ -787,7 +787,6 @@ static int gd5f_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
|
@ -960,7 +960,6 @@ static int is25xp_ioctl(FAR struct mtd_dev_s *dev,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
|
@ -1042,7 +1042,6 @@ static int m25p_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
|
@ -812,7 +812,6 @@ static int nand_ioctl(struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = nandmodel_getdevblocks(model) *
|
||||
nandmodel_getbyteblocksize(model) /
|
||||
model->pagesize;
|
||||
|
@ -420,7 +420,6 @@ static int part_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->neraseblocks * priv->blkpererase;
|
||||
info->sectorsize = priv->blocksize;
|
||||
info->startsector = priv->firstblock;
|
||||
|
@ -333,7 +333,6 @@ static int progmem_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = up_progmem_neraseblocks() <<
|
||||
(priv->ersshift - priv->blkshift);
|
||||
info->sectorsize = 1 << priv->blkshift;
|
||||
|
@ -302,7 +302,6 @@ static int mtd_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->rwb.nblocks;
|
||||
info->sectorsize = priv->rwb.blocksize;
|
||||
info->startsector = 0;
|
||||
|
@ -1089,7 +1089,6 @@ static int mx25l_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_MX25L_SECTOR512
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - MX25L_SECTOR512_SHIFT);
|
||||
|
@ -759,7 +759,6 @@ int mx25rxx_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_MX25RXX_SECTOR512
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - MX25RXX_SECTOR512_SHIFT);
|
||||
|
@ -817,7 +817,6 @@ static int mx35_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
|
@ -1407,7 +1407,6 @@ static int n25qxxx_ioctl(FAR struct mtd_dev_s *dev,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_N25QXXX_SECTOR512
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - N25QXXX_SECTOR512_SHIFT);
|
||||
|
@ -405,7 +405,6 @@ static int ram_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nblocks *
|
||||
CONFIG_RAMMTD_ERASESIZE /
|
||||
CONFIG_RAMMTD_BLOCKSIZE;
|
||||
|
@ -960,7 +960,6 @@ static int ramtron_ioctl(FAR struct mtd_dev_s *dev,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors *
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
|
@ -1453,7 +1453,6 @@ static int s25fl1_ioctl(FAR struct mtd_dev_s *dev,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_S25FL1_SECTOR512
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - S25FL1_SECTOR512_SHIFT);
|
||||
|
@ -549,7 +549,6 @@ static int s512_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->neblocks * priv->stdperblock;
|
||||
info->sectorsize = SECTOR_512;
|
||||
info->startsector = 0;
|
||||
|
@ -265,7 +265,6 @@ static int skel_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = 8192;
|
||||
info->sectorsize = 512;
|
||||
info->startsector = 0;
|
||||
|
@ -1201,7 +1201,6 @@ static int sst25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_SST25_SECTOR512
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - SST25_SECTOR_SHIFT);
|
||||
|
@ -899,7 +899,6 @@ static int sst25xx_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors *
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
|
@ -904,7 +904,6 @@ static int sst26_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->nsectors *
|
||||
(priv->sectorshift - priv->pageshift);
|
||||
info->sectorsize = 1 << priv->pageshift;
|
||||
|
@ -742,7 +742,6 @@ static int sst39vf_ioctl(FAR struct mtd_dev_s *dev,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = priv->chip->nsectors;
|
||||
info->sectorsize = priv->chip->sectorsize;
|
||||
info->startsector = 0;
|
||||
|
@ -1329,7 +1329,6 @@ static int w25_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_W25_SECTOR512
|
||||
info->numsectors = priv->nsectors <<
|
||||
(W25_SECTOR_SHIFT - W25_SECTOR512_SHIFT);
|
||||
|
@ -1413,7 +1413,6 @@ static int w25qxxxjv_ioctl(FAR struct mtd_dev_s *dev,
|
||||
(FAR struct partition_info_s *)arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
#ifdef CONFIG_W25QXXXJV_SECTOR512
|
||||
info->numsectors = priv->nsectors <<
|
||||
(priv->sectorshift - W25QXXXJV_SECTOR512_SHIFT);
|
||||
|
@ -223,7 +223,6 @@ static int part_ioctl(FAR struct inode *inode, int cmd, unsigned long arg)
|
||||
(FAR struct partition_info_s *)ptr_arg;
|
||||
if (info != NULL)
|
||||
{
|
||||
info->magic = 0;
|
||||
info->numsectors = dev->nsectors;
|
||||
info->sectorsize = dev->sectorsize;
|
||||
info->startsector = dev->firstsector;
|
||||
|
@ -226,8 +226,6 @@ struct geometry
|
||||
|
||||
struct partition_info_s
|
||||
{
|
||||
uint32_t magic; /* File system magic, 0 for RAW
|
||||
* (see <sys/statfs.h>) */
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user