summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2010-02-28 22:36:28 +0000
committerChris Johns <chrisj@rtems.org>2010-02-28 22:36:28 +0000
commitd3cfd63fd313db5590fee7de6d90d78feeac2815 (patch)
treed62a99c4149ac36e8cbf02262d8257f31e01dff7 /cpukit/libfs
parent2010-02-28 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-d3cfd63fd313db5590fee7de6d90d78feeac2815.tar.bz2
2010-03-01 Chris Johns <chrisj@rtems.org>
* libfs/src/rfs/rtems-rfs-buffer.h: Add `rtems_rfs_buffer_handle_reset'.
Diffstat (limited to 'cpukit/libfs')
-rw-r--r--cpukit/libfs/src/rfs/rtems-rfs-buffer.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-buffer.h b/cpukit/libfs/src/rfs/rtems-rfs-buffer.h
index 480bce360d..a93a900332 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-buffer.h
+++ b/cpukit/libfs/src/rfs/rtems-rfs-buffer.h
@@ -186,6 +186,22 @@ int rtems_rfs_buffer_handle_release (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle);
/**
+ * Reset a handle.
+ *
+ * @param fs The file system data.
+ * @param handle The buffer handle to reset.
+ * @return int The error number (errno). No error if 0.
+ */
+static inline int
+rtems_rfs_buffer_handle_reset (rtems_rfs_buffer_handle* handle)
+{
+ handle->dirty = false;
+ handle->bnum = 0;
+ handle->buffer = NULL;
+ return 0;
+}
+
+/**
* Open a handle.
*
* @param fs The file system data.
@@ -196,9 +212,7 @@ static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
- handle->dirty = false;
- handle->bnum = 0;
- handle->buffer = NULL;
+ rtems_rfs_buffer_handle_reset (handle);
return 0;
}