[PATCH 19/21] dosfs: Avoid deprecated routine

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Aug 6 07:14:51 UTC 2018


Update #3358.
---
 cpukit/libfs/src/dosfs/fat.c        | 2 ++
 cpukit/libfs/src/dosfs/fat.h        | 1 +
 cpukit/libfs/src/dosfs/msdos_dir.c  | 2 +-
 cpukit/libfs/src/dosfs/msdos_file.c | 2 +-
 4 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/cpukit/libfs/src/dosfs/fat.c b/cpukit/libfs/src/dosfs/fat.c
index 8701a21d9a..cb45f91efe 100644
--- a/cpukit/libfs/src/dosfs/fat.c
+++ b/cpukit/libfs/src/dosfs/fat.c
@@ -505,6 +505,8 @@ fat_init_volume_info(fat_fs_info_t *fs_info, const char *device)
         rtems_set_errno_and_return_minus_one(ENXIO);
     }
 
+    vol->dev = stat_buf.st_dev;
+
     /* Read boot record */
     /* FIXME: Asserts FAT_MAX_BPB_SIZE < bdbuf block size */
     sc = rtems_bdbuf_read( vol->dd, 0, &block);
diff --git a/cpukit/libfs/src/dosfs/fat.h b/cpukit/libfs/src/dosfs/fat.h
index 4839cb7613..064b4747a9 100644
--- a/cpukit/libfs/src/dosfs/fat.h
+++ b/cpukit/libfs/src/dosfs/fat.h
@@ -331,6 +331,7 @@ typedef struct fat_vol_s
     uint8_t            afat;           /* the number of active FAT */
     int                fd;             /* the disk device file descriptor */
     rtems_disk_device *dd;             /* disk device (see libblock) */
+    dev_t              dev;            /* device identifier of disk */
     void              *private_data;   /* reserved */
 } fat_vol_t;
 
diff --git a/cpukit/libfs/src/dosfs/msdos_dir.c b/cpukit/libfs/src/dosfs/msdos_dir.c
index 535d5f56f0..a13caafa7e 100644
--- a/cpukit/libfs/src/dosfs/msdos_dir.c
+++ b/cpukit/libfs/src/dosfs/msdos_dir.c
@@ -383,7 +383,7 @@ msdos_dir_stat(
 
     msdos_fs_lock(fs_info);
 
-    buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
+    buf->st_dev = fs_info->fat.vol.dev;
     buf->st_ino = fat_fd->ino;
     buf->st_mode  = S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO;
     buf->st_rdev = 0ll;
diff --git a/cpukit/libfs/src/dosfs/msdos_file.c b/cpukit/libfs/src/dosfs/msdos_file.c
index d7b170a01a..205631217f 100644
--- a/cpukit/libfs/src/dosfs/msdos_file.c
+++ b/cpukit/libfs/src/dosfs/msdos_file.c
@@ -130,7 +130,7 @@ msdos_file_stat(
 
     msdos_fs_lock(fs_info);
 
-    buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
+    buf->st_dev = fs_info->fat.vol.dev;
     buf->st_ino = fat_fd->ino;
     buf->st_mode  = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
     buf->st_rdev = 0ll;
-- 
2.13.7




More information about the devel mailing list