From 5ded75ec4c576577cae7d556e671d11d0c80c2fc Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 15 May 2013 21:02:48 -0400 Subject: [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 --- include/linux/fs.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux/fs.h') 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) } return true; } +static inline bool dir_relax(struct inode *inode) +{ + mutex_unlock(&inode->i_mutex); + mutex_lock(&inode->i_mutex); + return !IS_DEADDIR(inode); +} #endif /* _LINUX_FS_H */ -- cgit v1.2.3