fold put_filp() into fput()

Just check FMODE_OPENED in __fput() and be done with that...

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
このコミットが含まれているのは:
Al Viro
2018-07-09 11:14:39 -04:00
コミット 4d27f3266f
4個のファイルの変更10行の追加21行の削除

ファイルの表示

@@ -3531,7 +3531,7 @@ static struct file *path_openat(struct nameidata *nd,
s = path_init(nd, flags);
if (IS_ERR(s)) {
put_filp(file);
fput(file);
return ERR_CAST(s);
}
while (!(error = link_path_walk(s, nd)) &&
@@ -3547,7 +3547,7 @@ static struct file *path_openat(struct nameidata *nd,
out2:
if (!(opened & FILE_OPENED)) {
BUG_ON(!error);
put_filp(file);
fput(file);
}
if (unlikely(error)) {
if (error == -EOPENSTALE) {