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:
Xiang Xiao 2021-08-18 01:11:04 +08:00 committed by Gustavo Henrique Nihei
parent 3421a0be38
commit af72376773
38 changed files with 0 additions and 39 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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