[rtems commit] dosfs: Avoid deprecated routine
Sebastian Huber
sebh at rtems.org
Tue Aug 7 05:43:22 UTC 2018
Module: rtems
Branch: master
Commit: ab96aec60a1ea393f42dcc8f6fde78ed7b3705d9
Changeset: http://git.rtems.org/rtems/commit/?id=ab96aec60a1ea393f42dcc8f6fde78ed7b3705d9
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Sat Aug 4 10:56:46 2018 +0200
dosfs: Avoid deprecated routine
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 8701a21..cb45f91 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 4839cb7..064b474 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 535d5f5..a13caaf 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 d7b170a..2056312 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;
More information about the vc
mailing list