summaryrefslogtreecommitdiff
path: root/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-01-11 09:16:29 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-01-11 09:16:29 +0100
commit1a59b922011f77e42b56f13c55431cd3dbd973a1 (patch)
tree1715abe7b851f08634af0c5b84dcf35779e80bb9 /rtems
parentab1736aebddda8e776032ff49d73f3800e684bb5 (diff)
rtems_yaffs: Add dev field to OS context
Diffstat (limited to 'rtems')
-rw-r--r--rtems/rtems_yaffs.c2
-rw-r--r--rtems/rtems_yaffs.h15
2 files changed, 13 insertions, 4 deletions
diff --git a/rtems/rtems_yaffs.c b/rtems/rtems_yaffs.c
index 3e9c44d..3bea242 100644
--- a/rtems/rtems_yaffs.c
+++ b/rtems/rtems_yaffs.c
@@ -398,11 +398,13 @@ static int ryfs_fstat(const rtems_filesystem_location_info_t *loc, struct stat *
int rv = 0;
struct yaffs_obj *obj = ryfs_get_object_by_location(loc);
struct yaffs_dev *dev = obj->my_dev;
+ rtems_yaffs_os_context *os_context = dev->os_context;
ylock(dev);
obj = yaffs_get_equivalent_obj(obj);
if (obj != NULL) {
+ buf->st_dev = os_context->dev;
buf->st_ino = obj->obj_id;
buf->st_mode = obj->yst_mode;
buf->st_nlink = (nlink_t) yaffs_get_obj_link_count(obj);
diff --git a/rtems/rtems_yaffs.h b/rtems/rtems_yaffs.h
index dce8204..e94fba7 100644
--- a/rtems/rtems_yaffs.h
+++ b/rtems/rtems_yaffs.h
@@ -53,6 +53,13 @@ typedef struct {
rtems_yaffs_os_handler lock;
rtems_yaffs_os_handler unlock;
rtems_yaffs_os_handler unmount;
+
+ /**
+ * @brief The device containing the file system instance.
+ *
+ * This will be used for the st_dev field in stat().
+ */
+ dev_t dev;
} rtems_yaffs_os_context;
/**
@@ -83,12 +90,12 @@ typedef struct {
/**
* @brief YAFFS mount handler.
*
- * The @a data pointer must point to a completely initizialized
+ * The @a data pointer must point to a completely initialized
* rtems_yaffs_mount_data structure. The ownership of the YAFFS device
* structure changes. This structure is now owned by the file system layer.
*
* @retval 0 Successful operation.
- * @retval -1 An error occured. The @c errno indicates the error.
+ * @retval -1 An error occurred. The @c errno indicates the error.
*/
int rtems_yaffs_mount_handler(
rtems_filesystem_mount_table_entry_t *mt_entry,
@@ -98,13 +105,13 @@ int rtems_yaffs_mount_handler(
/**
* @brief Initializes the default per file system context @a os_context.
*
- * A binary semaphore with priority inheritence will be used to ensure mutual
+ * A binary semaphore with priority inheritance will be used to ensure mutual
* exclusion.
*
* The umount handler will release all resources of the default context.
*
* @retval 0 Successful operation.
- * @retval -1 An error occured. The @c errno indicates the error.
+ * @retval -1 An error occurred. The @c errno indicates the error.
*/
int rtems_yaffs_initialize_default_os_context(
rtems_yaffs_default_os_context *os_context