From d3cfd63fd313db5590fee7de6d90d78feeac2815 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Sun, 28 Feb 2010 22:36:28 +0000 Subject: [PATCH] 2010-03-01 Chris Johns * libfs/src/rfs/rtems-rfs-buffer.h: Add `rtems_rfs_buffer_handle_reset'. --- cpukit/ChangeLog | 4 ++++ cpukit/libfs/src/rfs/rtems-rfs-buffer.h | 20 +++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 033f044f6a..86d023c92b 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,7 @@ +2010-03-01 Chris Johns + + * libfs/src/rfs/rtems-rfs-buffer.h: Add `rtems_rfs_buffer_handle_reset'. + 2010-02-28 Joel Sherrill * libmisc/shell/shell_script.c: Fix typo. 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 @@ -185,6 +185,22 @@ int rtems_rfs_buffer_handle_request (rtems_rfs_file_system* fs, 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. * @@ -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; }