summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/rfs/rtems-rfs-link.h
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2010-03-04 06:36:51 +0000
committerChris Johns <chrisj@rtems.org>2010-03-04 06:36:51 +0000
commit8ec7abb551a23bdf47509189145885a364810006 (patch)
tree7b5fa486b93583479b97f05a51c7370dd0c2d69f /cpukit/libfs/src/rfs/rtems-rfs-link.h
parentThis commit was generated by cvs2svn to compensate for changes in r22694, (diff)
downloadrtems-8ec7abb551a23bdf47509189145885a364810006.tar.bz2
010-03-04 Chris Johns <chrisj@rtems.org>
* libcsupport/include/rtems/libio.h, libcsupport/src/_rename_r.c: Add a rename file op and have rename use it. * libfs/Makefile.am, libfs/src/dosfs/msdos_rename.c, libfs/src/imfs/imfs_rename.c: New files to support the rename file op. * libfs/src/imfs/imfs.h: Add rename interface. * libfs/src/imfs/imfs_init.c: Add rename handler. * libfs/src/imfs/miniimfs_init.c: Fix up ops struct. * libfs/src/dosfs/msdos.h: Add msdos_rename and remove msdos_file_link. * libfs/src/dosfs/msdos_create.c: Remove the link call. * libfs/src/dosfs/msdos_eval.c: Fix a path parsing bug. * libfs/src/dosfs/msdos_init.c: Add rename handler and clean up the struct naming. * libfs/src/rfs/rtems-rfs-link.c, libfs/src/rfs/rtems-rfs-link.h: Change the link call to allow linking of directories if told to and change the unlink to handle unlink directories that are not empty so rename can be supported. * libfs/src/rfs/rtems-rfs-rtems-dir.c: Fix the link/unlink calls. * libfs/src/rfs/rtems-rfs-rtems.c: Add a rename handler. Fix the link/unlink calls. * libfs/src/dosfs/msdos_dir.c, libfs/src/dosfs/msdos_format.c, libfs/src/dosfs/msdos_misc.c, httpd/asp.c, libfs/src/nfsclient/src/nfs.c: Work around a newlib warning when using the is*() family of calls.
Diffstat (limited to 'cpukit/libfs/src/rfs/rtems-rfs-link.h')
-rw-r--r--cpukit/libfs/src/rfs/rtems-rfs-link.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-link.h b/cpukit/libfs/src/rfs/rtems-rfs-link.h
index d80db0195c..359360f0fd 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-link.h
+++ b/cpukit/libfs/src/rfs/rtems-rfs-link.h
@@ -26,20 +26,33 @@
#include <rtems/rfs/rtems-rfs-inode.h>
/**
- * Create a link.
+ * Directory unlink modes.
+ */
+typedef enum rtems_rfs_unlink_dir_e
+{
+ rtems_rfs_unlink_dir_denied, /**< Not allowed to unlink a directory. */
+ rtems_rfs_unlink_dir_if_empty, /**< Unlink if the directory is empty. */
+ rtems_rfs_unlink_dir_allowed /**< Unlinking of directories is allowed. */
+} rtems_rfs_unlink_dir;
+
+/**
+ * Create a link. Do not link directories unless renaming or you will create
+ * loops in the file system.
*
* @param fs The file system.
* @param name The name of the link.
* @param length The length of the name.
* @param parent The inode number of the parent directory.
* @param target The inode of the target.
+ * @param link_dir If true directories can be linked. Useful when renaming.
* @return int The error number (errno). No error if 0.
*/
int rtems_rfs_link (rtems_rfs_file_system* fs,
const char* name,
int length,
rtems_rfs_ino parent,
- rtems_rfs_ino target);
+ rtems_rfs_ino target,
+ bool link_dir);
/**
* Unlink the node from the parent directory. A directory offset for the target
@@ -50,14 +63,14 @@ int rtems_rfs_link (rtems_rfs_file_system* fs,
* @param parent The inode number of the parent directory.
* @param target The inode of the target.
* @param doff Parent directory entry offset for the target entry.
- * @param dir If true unlinking of directory nodes is allowed.
+ * @param dir_mode Directory unlink mode.
* @return int The error number (errno). No error if 0.
*/
int rtems_rfs_unlink (rtems_rfs_file_system* fs,
rtems_rfs_ino parent,
rtems_rfs_ino target,
uint32_t doff,
- bool dir);
+ rtems_rfs_unlink_dir dir_mode);
/**
* Symbolic link is an inode that has a path attached.