diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-09-28 10:53:40 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-09-28 10:53:40 -0600 |
commit | eb736af992f3d3afd73b73432761f37850d08ce9 (patch) | |
tree | b70c3877241cee7d557cf1a4817af644f12caab9 | |
parent | a86b0d0010f0eec75bdb2c8ac29ca53b72c13cbc (diff) | |
download | nuttx-eb736af992f3d3afd73b73432761f37850d08ce9.tar.gz nuttx-eb736af992f3d3afd73b73432761f37850d08ce9.tar.bz2 nuttx-eb736af992f3d3afd73b73432761f37850d08ce9.zip |
Move inode and VFS utils from fs/. to fs/inode/.
-rw-r--r-- | nuttx/fs/Makefile | 9 | ||||
-rw-r--r-- | nuttx/fs/inode/fs_files.c (renamed from nuttx/fs/fs_files.c) | 0 | ||||
-rw-r--r-- | nuttx/fs/inode/fs_foreachinode.c (renamed from nuttx/fs/fs_foreachinode.c) | 0 | ||||
-rw-r--r-- | nuttx/fs/inode/fs_inode.c (renamed from nuttx/fs/fs_inode.c) | 0 | ||||
-rw-r--r-- | nuttx/fs/inode/fs_inodeaddref.c (renamed from nuttx/fs/fs_inodeaddref.c) | 0 | ||||
-rw-r--r-- | nuttx/fs/inode/fs_inodebasename.c (renamed from nuttx/fs/fs_inodebasename.c) | 0 | ||||
-rw-r--r-- | nuttx/fs/inode/fs_inodefind.c (renamed from nuttx/fs/fs_inodefind.c) | 0 | ||||
-rw-r--r-- | nuttx/fs/inode/fs_inoderelease.c (renamed from nuttx/fs/fs_inoderelease.c) | 0 | ||||
-rw-r--r-- | nuttx/fs/inode/fs_inoderemove.c (renamed from nuttx/fs/fs_inoderemove.c) | 0 | ||||
-rw-r--r-- | nuttx/fs/inode/fs_inodereserve.c (renamed from nuttx/fs/fs_inodereserve.c) | 0 | ||||
-rw-r--r-- | nuttx/include/nuttx/fs/fs.h | 34 | ||||
-rw-r--r-- | nuttx/include/nuttx/semaphore.h | 11 |
12 files changed, 23 insertions, 31 deletions
diff --git a/nuttx/fs/Makefile b/nuttx/fs/Makefile index ebe1ee32b..c5c61a6d2 100644 --- a/nuttx/fs/Makefile +++ b/nuttx/fs/Makefile @@ -67,17 +67,14 @@ CSRCS += fs_open.c fs_opendir.c fs_poll.c fs_read.c fs_readdir.c CSRCS += fs_rename.c fs_rewinddir.c fs_rmdir.c fs_seekdir.c fs_stat.c CSRCS += fs_statfs.c fs_select.c fs_unlink.c fs_write.c -CSRCS += fs_files.c fs_foreachinode.c fs_inode.c fs_inodeaddref.c -CSRCS += fs_inodebasename.c fs_inodefind.c fs_inoderelease.c -CSRCS += fs_inoderemove.c fs_inodereserve.c - CSRCS += fs_registerdriver.c fs_unregisterdriver.c CSRCS += fs_registerblockdriver.c fs_unregisterblockdriver.c CSRCS += fs_findblockdriver.c fs_openblockdriver.c fs_closeblockdriver.c -DEPPATH = +DEPPATH = --dep-path . VPATH = . +include inode/Make.defs include mmap/Make.defs # Stream support @@ -142,7 +139,7 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $(OBJS)) .depend: Makefile $(SRCS) - $(Q) $(MKDEP) --dep-path . $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep $(Q) touch $@ depend: .depend diff --git a/nuttx/fs/fs_files.c b/nuttx/fs/inode/fs_files.c index d9db965c7..d9db965c7 100644 --- a/nuttx/fs/fs_files.c +++ b/nuttx/fs/inode/fs_files.c diff --git a/nuttx/fs/fs_foreachinode.c b/nuttx/fs/inode/fs_foreachinode.c index 06412d6ea..06412d6ea 100644 --- a/nuttx/fs/fs_foreachinode.c +++ b/nuttx/fs/inode/fs_foreachinode.c diff --git a/nuttx/fs/fs_inode.c b/nuttx/fs/inode/fs_inode.c index 3eb89ab4f..3eb89ab4f 100644 --- a/nuttx/fs/fs_inode.c +++ b/nuttx/fs/inode/fs_inode.c diff --git a/nuttx/fs/fs_inodeaddref.c b/nuttx/fs/inode/fs_inodeaddref.c index b5c14e0b0..b5c14e0b0 100644 --- a/nuttx/fs/fs_inodeaddref.c +++ b/nuttx/fs/inode/fs_inodeaddref.c diff --git a/nuttx/fs/fs_inodebasename.c b/nuttx/fs/inode/fs_inodebasename.c index 4fa78e028..4fa78e028 100644 --- a/nuttx/fs/fs_inodebasename.c +++ b/nuttx/fs/inode/fs_inodebasename.c diff --git a/nuttx/fs/fs_inodefind.c b/nuttx/fs/inode/fs_inodefind.c index 88f34c87d..88f34c87d 100644 --- a/nuttx/fs/fs_inodefind.c +++ b/nuttx/fs/inode/fs_inodefind.c diff --git a/nuttx/fs/fs_inoderelease.c b/nuttx/fs/inode/fs_inoderelease.c index 5fef133de..5fef133de 100644 --- a/nuttx/fs/fs_inoderelease.c +++ b/nuttx/fs/inode/fs_inoderelease.c diff --git a/nuttx/fs/fs_inoderemove.c b/nuttx/fs/inode/fs_inoderemove.c index 9cc6e0907..9cc6e0907 100644 --- a/nuttx/fs/fs_inoderemove.c +++ b/nuttx/fs/inode/fs_inoderemove.c diff --git a/nuttx/fs/fs_inodereserve.c b/nuttx/fs/inode/fs_inodereserve.c index 72d2ff031..72d2ff031 100644 --- a/nuttx/fs/fs_inodereserve.c +++ b/nuttx/fs/inode/fs_inodereserve.c diff --git a/nuttx/include/nuttx/fs/fs.h b/nuttx/include/nuttx/fs/fs.h index 420c9c360..b59046fdd 100644 --- a/nuttx/include/nuttx/fs/fs.h +++ b/nuttx/include/nuttx/fs/fs.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/nuttx/fs/fs.h * - * Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -203,25 +203,28 @@ struct mountpt_operations /* Named OS resources are also maintained by the VFS. This includes: * * - Named semaphores: sem_open(), sem_close(), and sem_unlink() - * - POSIX Message Queues: mq_open() and mq_close() + * - POSIX Message Queues: mq_open(), mq_close(), and mq_unlink() * - Shared memory: shm_open() and shm_unlink(); * - * These are a special case in that they do not follow quite the same - * pattern as the other file system types in that they have no read or - * write methods. + * These are a special case in that they do not follow the same pattern + * as the other inode system types: * - * Each inode type carries a payload specific to the OS resource; - * Only the contents of struct special_operations is visible to the VFS. + * - All of these resources have their own open() and unlink() interfaces. + * All require special, additional operations at open() and unlink() + * time + * - None of the standard VFS operations can be used with semaphores + * or named messages queues. These OS resources have their own + * own open() and close methods that do not use file descriptors. + * - Only ftruncate() and close() make sense with the file descriptor + * returned by shm_open() + * + * Inode types are not defined here, but rather in: + * + * - include/nuttx/semaphore.h + * - include/nuttx/mqueue.h, and + * - include/nuttx/shm.h */ -struct inode; -struct special_operations -{ - int (*open)(FAR struct inode *inode); - int (*close)(FAR struct inode *inode); - int (*unlink)(FAR struct inode *inode, FAR const char *relpath); -}; - /* These are the various kinds of operations that can be associated with * an inode. */ @@ -233,7 +236,6 @@ union inode_ops_u FAR const struct block_operations *i_bops; /* Block driver operations */ FAR const struct mountpt_operations *i_mops; /* Operations on a mountpoint */ #endif - FAR const struct special_operations *i_xops; /* Generic operations on OS resources */ FAR const struct semaphore_operations *i_sops; /* Operations for named semaphores */ }; diff --git a/nuttx/include/nuttx/semaphore.h b/nuttx/include/nuttx/semaphore.h index a37c35d97..bca533c05 100644 --- a/nuttx/include/nuttx/semaphore.h +++ b/nuttx/include/nuttx/semaphore.h @@ -56,19 +56,12 @@ /* This is the named semaphore inode */ -struct inode; /* Forward reference */ struct semaphore_operations { - /* Common inode operations */ - - int (*open)(FAR struct inode *inode); - int (*close)(FAR struct inode *inode); - int (*unlink)(FAR struct inode *inode, FAR const char *relpath); - /* Payload unique to named semaphores */ - uint16_t ns_refs; /* Number of open references semaphore */ - sem_t ns_sem; /* The semaphore itself */ + uint16_t ns_refs; /* Number of open references to the semaphore */ + sem_t ns_sem; /* The semaphore itself */ }; /**************************************************************************** |