[PATCH] Reference counting for file system locations

Sebastian Huber sebastian.huber at embedded-brains.de
Sat Feb 18 11:02:31 UTC 2012


In order to help the review I want to highlight the most important 
changes and files.

The central new data structure is:

+/**
+ * @brief Global file system location.
+ *
+ * @ingroup LibIO
+ *
+ * The global file system locations are used for
+ * - the mount point location in the mount table entry,
+ * - the file system root location in the mount table entry,
+ * - the root directory location in the user environment, and
+ * - the current directory location in the user environment.
+ *
+ * During the path evaluation global start locations are obtained to ensure
+ * that the current file system will be not unmounted in the meantime.
+ *
+ * To support a release within critical sections of the operating system a
+ * deferred release is supported. This is similar to malloc() and free().
+ *
+ * @see rtems_filesystem_global_location_obtain() and
+ * rtems_filesystem_global_location_release().
+ */
+typedef struct rtems_filesystem_global_location_t {
+ rtems_filesystem_location_info_t location;
+ int reference_count;
+ struct rtems_filesystem_global_location_t *deferred_released_next;
+ int deferred_released_count;
+} rtems_filesystem_global_location_t;

The support functions for this data structure are in:

http://git.rtems.org/sebh/rtems.git/tree/cpukit/libcsupport/src/sup_fs_location.c?h=fsrefcount

The new path evaluation is implemented here:

http://git.rtems.org/sebh/rtems.git/tree/cpukit/libcsupport/src/sup_fs_eval_path.c?h=fsrefcount
http://git.rtems.org/sebh/rtems.git/tree/cpukit/libcsupport/src/sup_fs_eval_path_generic.c?h=fsrefcount

To see how it works have a look at:

http://git.rtems.org/sebh/rtems.git/tree/cpukit/libcsupport/src/open.c?h=fsrefcount
http://git.rtems.org/sebh/rtems.git/tree/cpukit/libfs/src/imfs/imfs_eval.c?h=fsrefcount

The changes in the test suite are also important.  Everything else are 
mostly mechanic changes.

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the devel mailing list