From 3a81a51177d8aa06ffb2065d997220c076c916de Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 14 Mar 2015 17:22:02 -0600 Subject: Pass the umount2() flags to every unbind() implementation. That is where the the decision to umount or not will be made. --- nuttx/fs/nxffs/nxffs.h | 5 +++-- nuttx/fs/nxffs/nxffs_initialize.c | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'nuttx/fs/nxffs') 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 * * 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 * * 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 } -- cgit v1.2.3