diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-03-14 17:22:02 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-03-14 17:22:02 -0600 |
commit | 3a81a51177d8aa06ffb2065d997220c076c916de (patch) | |
tree | 2e6c7c3a33800517677fb9fa986bd8773579d4cc /nuttx/fs/nxffs | |
parent | e3fa0599d86506b6b79723ddffeca038440e40a6 (diff) | |
download | px4-nuttx-3a81a51177d8aa06ffb2065d997220c076c916de.tar.gz px4-nuttx-3a81a51177d8aa06ffb2065d997220c076c916de.tar.bz2 px4-nuttx-3a81a51177d8aa06ffb2065d997220c076c916de.zip |
Pass the umount2() flags to every unbind() implementation. That is where the the decision to umount or not will be made.
Diffstat (limited to 'nuttx/fs/nxffs')
-rw-r--r-- | nuttx/fs/nxffs/nxffs.h | 5 | ||||
-rw-r--r-- | nuttx/fs/nxffs/nxffs_initialize.c | 14 |
2 files changed, 15 insertions, 4 deletions
diff --git a/nuttx/fs/nxffs/nxffs.h b/nuttx/fs/nxffs/nxffs.h index 87bc06227..89adb6dac 100644 --- a/nuttx/fs/nxffs/nxffs.h +++ b/nuttx/fs/nxffs/nxffs.h @@ -1,7 +1,7 @@ /**************************************************************************** * fs/nxffs/nxffs.h * - * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * References: Linux/Documentation/filesystems/romfs.txt @@ -1098,7 +1098,8 @@ int nxffs_readdir(FAR struct inode *mountpt, FAR struct fs_dirent_s *dir); int nxffs_rewinddir(FAR struct inode *mountpt, FAR struct fs_dirent_s *dir); int nxffs_bind(FAR struct inode *blkdriver, FAR const void *data, FAR void **handle); -int nxffs_unbind(FAR void *handle, FAR struct inode **blkdriver); +int nxffs_unbind(FAR void *handle, FAR struct inode **blkdriver, + unsigned int flags); int nxffs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf); int nxffs_stat(FAR struct inode *mountpt, FAR const char *relpath, FAR struct stat *buf); diff --git a/nuttx/fs/nxffs/nxffs_initialize.c b/nuttx/fs/nxffs/nxffs_initialize.c index d7d55f077..13081b6c1 100644 --- a/nuttx/fs/nxffs/nxffs_initialize.c +++ b/nuttx/fs/nxffs/nxffs_initialize.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/nxffs/nxffs_initialize.c * - * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * References: Linux/Documentation/filesystems/romfs.txt @@ -550,11 +550,21 @@ int nxffs_bind(FAR struct inode *blkdriver, FAR const void *data, * ****************************************************************************/ -int nxffs_unbind(FAR void *handle, FAR struct inode **blkdriver) +int nxffs_unbind(FAR void *handle, FAR struct inode **blkdriver, + unsigned int flags) { #ifndef CONFIG_NXFFS_PREALLOCATED # error "No design to support dynamic allocation of volumes" #else + /* This implementation currently only supports unmounting if there are no + * open file references. + */ + + if (flags != 0) + { + return -ENOSYS; + } + return g_volume.ofiles ? -EBUSY : OK; #endif } |