diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-05-15 21:02:48 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 04:46:49 -0400 |
commit | 5ded75ec4c576577cae7d556e671d11d0c80c2fc (patch) | |
tree | 964c5d165f74933df96d6fa16f9bd866a7308727 /include/linux/fs.h | |
parent | 5f99f4e79abc64ed9d93a4b0158b21c64ff7f478 (diff) |
[readdir] convert ext3
new helper: dir_relax(inode). Call when you are in location that will
_not_ be invalidated by directory modifications (block boundary, in case
of ext*). Returns whether the directory has survived (dropping i_mutex
allows rmdir to kill the sucker; if it returns false to us, ->iterate()
is obviously done)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 40293a6ce804..aa9770c7e8df 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2725,5 +2725,11 @@ static inline bool dir_emit_dots(struct file *file, struct dir_context *ctx) | |||
2725 | } | 2725 | } |
2726 | return true; | 2726 | return true; |
2727 | } | 2727 | } |
2728 | static inline bool dir_relax(struct inode *inode) | ||
2729 | { | ||
2730 | mutex_unlock(&inode->i_mutex); | ||
2731 | mutex_lock(&inode->i_mutex); | ||
2732 | return !IS_DEADDIR(inode); | ||
2733 | } | ||
2728 | 2734 | ||
2729 | #endif /* _LINUX_FS_H */ | 2735 | #endif /* _LINUX_FS_H */ |