aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2012-06-05 09:10:32 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 08:33:28 -0400
commita8277b9baa6268de386529a33061775bc716198b (patch)
treecdd127a78f7055b873ff79b2afdbb8d74382aac4 /fs/namei.c
parentf60dc3db6e24b7c36445cf1feb56b34c799074b3 (diff)
vfs: move O_DIRECT check to common code
Perform open_check_o_direct() in a common place in do_last after opening the file. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 183a769537fe..4bc4bc6a6938 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2305,22 +2305,15 @@ static struct file *atomic_open(struct nameidata *nd, struct dentry *dentry,
2305 * here. 2305 * here.
2306 */ 2306 */
2307 error = may_open(&filp->f_path, acc_mode, open_flag); 2307 error = may_open(&filp->f_path, acc_mode, open_flag);
2308 if (error) 2308 if (error) {
2309 goto out_fput; 2309 fput(filp);
2310 2310 filp = ERR_PTR(error);
2311 error = open_check_o_direct(filp); 2311 }
2312 if (error)
2313 goto out_fput;
2314 2312
2315out: 2313out:
2316 dput(dentry); 2314 dput(dentry);
2317 return filp; 2315 return filp;
2318 2316
2319out_fput:
2320 fput(filp);
2321 filp = ERR_PTR(error);
2322 goto out;
2323
2324no_open: 2317no_open:
2325 if (need_lookup) { 2318 if (need_lookup) {
2326 dentry = lookup_real(dir, dentry, nd); 2319 dentry = lookup_real(dir, dentry, nd);
@@ -2619,10 +2612,10 @@ finish_open_created:
2619 goto stale_open; 2612 goto stale_open;
2620 goto out; 2613 goto out;
2621 } 2614 }
2615opened:
2622 error = open_check_o_direct(filp); 2616 error = open_check_o_direct(filp);
2623 if (error) 2617 if (error)
2624 goto exit_fput; 2618 goto exit_fput;
2625opened:
2626 error = ima_file_check(filp, op->acc_mode); 2619 error = ima_file_check(filp, op->acc_mode);
2627 if (error) 2620 if (error)
2628 goto exit_fput; 2621 goto exit_fput;