diff --git a/fs/Makefile b/fs/Makefile index ebe1ee32b3f..c5c61a6d256 100644 --- a/fs/Makefile +++ b/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/fs/fs_files.c b/fs/inode/fs_files.c similarity index 100% rename from fs/fs_files.c rename to fs/inode/fs_files.c diff --git a/fs/fs_foreachinode.c b/fs/inode/fs_foreachinode.c similarity index 100% rename from fs/fs_foreachinode.c rename to fs/inode/fs_foreachinode.c diff --git a/fs/fs_inode.c b/fs/inode/fs_inode.c similarity index 100% rename from fs/fs_inode.c rename to fs/inode/fs_inode.c diff --git a/fs/fs_inodeaddref.c b/fs/inode/fs_inodeaddref.c similarity index 100% rename from fs/fs_inodeaddref.c rename to fs/inode/fs_inodeaddref.c diff --git a/fs/fs_inodebasename.c b/fs/inode/fs_inodebasename.c similarity index 100% rename from fs/fs_inodebasename.c rename to fs/inode/fs_inodebasename.c diff --git a/fs/fs_inodefind.c b/fs/inode/fs_inodefind.c similarity index 100% rename from fs/fs_inodefind.c rename to fs/inode/fs_inodefind.c diff --git a/fs/fs_inoderelease.c b/fs/inode/fs_inoderelease.c similarity index 100% rename from fs/fs_inoderelease.c rename to fs/inode/fs_inoderelease.c diff --git a/fs/fs_inoderemove.c b/fs/inode/fs_inoderemove.c similarity index 100% rename from fs/fs_inoderemove.c rename to fs/inode/fs_inoderemove.c diff --git a/fs/fs_inodereserve.c b/fs/inode/fs_inodereserve.c similarity index 100% rename from fs/fs_inodereserve.c rename to fs/inode/fs_inodereserve.c diff --git a/include/nuttx/fs/fs.h b/include/nuttx/fs/fs.h index 420c9c360fc..b59046fddaf 100644 --- a/include/nuttx/fs/fs.h +++ b/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 * * 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/include/nuttx/semaphore.h b/include/nuttx/semaphore.h index a37c35d9700..bca533c051f 100644 --- a/include/nuttx/semaphore.h +++ b/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 */ }; /****************************************************************************