mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 14:13:01 -04:00
[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>
This commit is contained in:
parent
5f99f4e79a
commit
5ded75ec4c
2 changed files with 70 additions and 93 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue