diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-03-14 16:48:45 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-03-14 16:48:45 -0600 |
commit | e3fa0599d86506b6b79723ddffeca038440e40a6 (patch) | |
tree | 8929732aae71de32ef20b3fc60a6fa548b768051 /nuttx/fs | |
parent | 42132b61b6b0add6342560394d578cf2c727b29c (diff) | |
download | px4-nuttx-e3fa0599d86506b6b79723ddffeca038440e40a6.tar.gz px4-nuttx-e3fa0599d86506b6b79723ddffeca038440e40a6.tar.bz2 px4-nuttx-e3fa0599d86506b6b79723ddffeca038440e40a6.zip |
Add umount2(). umount() is now a macro that just calls umount2() with flags = 0.
Diffstat (limited to 'nuttx/fs')
-rw-r--r-- | nuttx/fs/mount/Make.defs | 2 | ||||
-rw-r--r-- | nuttx/fs/mount/fs_automount.c | 6 | ||||
-rw-r--r-- | nuttx/fs/mount/fs_mount.c | 2 | ||||
-rw-r--r-- | nuttx/fs/mount/fs_umount2.c (renamed from nuttx/fs/mount/fs_umount.c) | 9 |
4 files changed, 9 insertions, 10 deletions
diff --git a/nuttx/fs/mount/Make.defs b/nuttx/fs/mount/Make.defs index 26a6c0fd1..56596e81d 100644 --- a/nuttx/fs/mount/Make.defs +++ b/nuttx/fs/mount/Make.defs @@ -38,7 +38,7 @@ ifneq ($(CONFIG_NFILE_DESCRIPTORS),0) ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y) -CSRCS += fs_mount.c fs_umount.c fs_foreachmountpoint.c +CSRCS += fs_mount.c fs_umount2.c fs_foreachmountpoint.c ifeq ($(CONFIG_FS_AUTOMOUNTER),y) CSRCS += fs_automount.c diff --git a/nuttx/fs/mount/fs_automount.c b/nuttx/fs/mount/fs_automount.c index e8207cb42..1efa80ada 100644 --- a/nuttx/fs/mount/fs_automount.c +++ b/nuttx/fs/mount/fs_automount.c @@ -290,7 +290,7 @@ static int automount_unmount(FAR struct automounter_state_s *priv) /* Un-mount the volume */ - ret = umount(lower->mountpoint); + ret = umount2(lower->mountpoint, MNT_FORCE); if (ret < 0) { int errcode = get_errno(); @@ -305,7 +305,7 @@ static int automount_unmount(FAR struct automounter_state_s *priv) { fvdbg("WARNING: Volume is busy, try again later\n"); - /* Start a timer to retry the umount after a delay */ + /* Start a timer to retry the umount2 after a delay */ ret = wd_start(priv->wdog, lower->udelay, automount_timeout, 1, (uint32_t)((uintptr_t)priv)); @@ -323,7 +323,7 @@ static int automount_unmount(FAR struct automounter_state_s *priv) else { - fvdbg("ERROR: umount failed: %d\n", errcode); + fvdbg("ERROR: umount2 failed: %d\n", errcode); return -errcode; } } diff --git a/nuttx/fs/mount/fs_mount.c b/nuttx/fs/mount/fs_mount.c index 4263f618b..9921bbe6f 100644 --- a/nuttx/fs/mount/fs_mount.c +++ b/nuttx/fs/mount/fs_mount.c @@ -353,7 +353,7 @@ int mount(FAR const char *source, FAR const char *target, /* We can release our reference to the blkdrver_inode, if the filesystem * wants to retain the blockdriver inode (which it should), then it must * have called inode_addref(). There is one reference on mountpt_inode - * that will persist until umount() is called. + * that will persist until umount2() is called. */ #ifdef BDFS_SUPPORT diff --git a/nuttx/fs/mount/fs_umount.c b/nuttx/fs/mount/fs_umount2.c index e7ea1c2d4..6d0609f9e 100644 --- a/nuttx/fs/mount/fs_umount.c +++ b/nuttx/fs/mount/fs_umount2.c @@ -1,7 +1,7 @@ /**************************************************************************** - * fs/mount/fs_umount.c + * fs/mount/fs_umount2.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -70,7 +70,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: umount + * Name: umount2 * * Description: * umount() detaches the filesystem mounted at the path specified by @@ -87,7 +87,7 @@ * ****************************************************************************/ -int umount(const char *target) +int umount2(FAR const char *target, unsigned int flags) { FAR struct inode *mountpt_inode; FAR struct inode *blkdrvr_inode = NULL; @@ -203,4 +203,3 @@ errout: set_errno(errcode); return ERROR; } - |