summaryrefslogtreecommitdiff
path: root/core/include/fs.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-06-25 20:36:59 -0700
committerH. Peter Anvin <hpa@zytor.com>2010-06-25 20:36:59 -0700
commit4deec2c8fb4f93204187f54f9b722072be537832 (patch)
treecd539c52dbe8c2980bb61b632580014479b6cd60 /core/include/fs.h
parent4b038f7218b382a146a101b685264ca425c13811 (diff)
downloadsyslinux-4deec2c8fb4f93204187f54f9b722072be537832.tar.gz
core, fs: handle .. resolution in the filesystem core
Some filesystems, including btrfs, don't have .. directory entries. We already handle . in the filesystem core, handle .. as well. This means keeping chains of parent inodes for all open inodes, at least for the duration of a path search; we might as well hang onto them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core/include/fs.h')
-rw-r--r--core/include/fs.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/include/fs.h b/core/include/fs.h
index f1d35bbb..bb629c91 100644
--- a/core/include/fs.h
+++ b/core/include/fs.h
@@ -94,6 +94,7 @@ struct extent {
*/
struct inode {
struct fs_info *fs; /* The filesystem this inode is associated with */
+ struct inode *parent; /* Parent directory, if any */
int refcnt;
int mode; /* FILE , DIR or SYMLINK */
uint32_t size;
@@ -157,11 +158,8 @@ static inline struct inode *get_inode(struct inode *inode)
inode->refcnt++;
return inode;
}
-static inline void put_inode(struct inode *inode)
-{
- if (! --inode->refcnt)
- free(inode);
-}
+
+void put_inode(struct inode *inode);
static inline void malloc_error(char *obj)
{