diff options
| author | Alexander Viro <viro@math.psu.edu> | 2002-02-18 22:11:33 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@penguin.transmeta.com> | 2002-02-18 22:11:33 -0800 |
| commit | 9e87dd22c04524941fd5346d5bf17f47a9dbae2e (patch) | |
| tree | c5f8f7704407b03fbefb9e60b3c64bb5d0f99cdd /include | |
| parent | e3a17d17d6d356f73505d9d696546c122157e466 (diff) | |
[PATCH] (2/4) 2.5.5-pre1 fixes
helper for safe access to parent's inumber
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/fs.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index aa4e95913890..1411debc77dc 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1508,6 +1508,15 @@ extern int generic_osync_inode(struct inode *, int); extern int inode_change_ok(struct inode *, struct iattr *); extern int inode_setattr(struct inode *, struct iattr *); +static inline ino_t parent_ino(struct dentry *dentry) +{ + ino_t res; + spin_lock(&dcache_lock); + res = dentry->d_parent->d_inode->i_ino; + spin_unlock(&dcache_lock); + return res; +} + #endif /* __KERNEL__ */ #endif /* _LINUX_FS_H */ |
