aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-17 21:44:00 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-17 21:44:00 -0500
commit0110c350c86d511be2130cb2a30dcbb76c4af750 (patch)
treed343a9e0fcb586a7110b13d411b314d33d404c08 /fs/namei.c
parentd9cb5bfcc3339f1a63df8fe0af8cece33c83c3af (diff)
parent9763f7a4a5f7b1a7c480fa06d01b2bad25163c0a (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull more vfs updates from Al Viro: "In this pile: - autofs-namespace series - dedupe stuff - more struct path constification" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (40 commits) ocfs2: implement the VFS clone_range, copy_range, and dedupe_range features ocfs2: charge quota for reflinked blocks ocfs2: fix bad pointer cast ocfs2: always unlock when completing dio writes ocfs2: don't eat io errors during _dio_end_io_write ocfs2: budget for extent tree splits when adding refcount flag ocfs2: prohibit refcounted swapfiles ocfs2: add newlines to some error messages ocfs2: convert inode refcount test to a helper simple_write_end(): don't zero in short copy into uptodate exofs: don't mess with simple_write_{begin,end} 9p: saner ->write_end() on failing copy into non-uptodate page fix gfs2_stuffed_write_end() on short copies fix ceph_write_end() nfs_write_end(): fix handling of short copies vfs: refactor clone/dedupe_file_range common functions fs: try to clone files first in vfs_copy_file_range vfs: misc struct path constification namespace.c: constify struct path passed to a bunch of primitives quota: constify struct path in quota_on ...
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 2b55ea142273..1c372debcbbe 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1200,7 +1200,7 @@ static int follow_managed(struct path *path, struct nameidata *nd)
1200 if (managed & DCACHE_MANAGE_TRANSIT) { 1200 if (managed & DCACHE_MANAGE_TRANSIT) {
1201 BUG_ON(!path->dentry->d_op); 1201 BUG_ON(!path->dentry->d_op);
1202 BUG_ON(!path->dentry->d_op->d_manage); 1202 BUG_ON(!path->dentry->d_op->d_manage);
1203 ret = path->dentry->d_op->d_manage(path->dentry, false); 1203 ret = path->dentry->d_op->d_manage(path, false);
1204 if (ret < 0) 1204 if (ret < 0)
1205 break; 1205 break;
1206 } 1206 }
@@ -1263,10 +1263,10 @@ int follow_down_one(struct path *path)
1263} 1263}
1264EXPORT_SYMBOL(follow_down_one); 1264EXPORT_SYMBOL(follow_down_one);
1265 1265
1266static inline int managed_dentry_rcu(struct dentry *dentry) 1266static inline int managed_dentry_rcu(const struct path *path)
1267{ 1267{
1268 return (dentry->d_flags & DCACHE_MANAGE_TRANSIT) ? 1268 return (path->dentry->d_flags & DCACHE_MANAGE_TRANSIT) ?
1269 dentry->d_op->d_manage(dentry, true) : 0; 1269 path->dentry->d_op->d_manage(path, true) : 0;
1270} 1270}
1271 1271
1272/* 1272/*
@@ -1282,7 +1282,7 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
1282 * Don't forget we might have a non-mountpoint managed dentry 1282 * Don't forget we might have a non-mountpoint managed dentry
1283 * that wants to block transit. 1283 * that wants to block transit.
1284 */ 1284 */
1285 switch (managed_dentry_rcu(path->dentry)) { 1285 switch (managed_dentry_rcu(path)) {
1286 case -ECHILD: 1286 case -ECHILD:
1287 default: 1287 default:
1288 return false; 1288 return false;
@@ -1392,8 +1392,7 @@ int follow_down(struct path *path)
1392 if (managed & DCACHE_MANAGE_TRANSIT) { 1392 if (managed & DCACHE_MANAGE_TRANSIT) {
1393 BUG_ON(!path->dentry->d_op); 1393 BUG_ON(!path->dentry->d_op);
1394 BUG_ON(!path->dentry->d_op->d_manage); 1394 BUG_ON(!path->dentry->d_op->d_manage);
1395 ret = path->dentry->d_op->d_manage( 1395 ret = path->dentry->d_op->d_manage(path, false);
1396 path->dentry, false);
1397 if (ret < 0) 1396 if (ret < 0)
1398 return ret == -EISDIR ? 0 : ret; 1397 return ret == -EISDIR ? 0 : ret;
1399 } 1398 }
@@ -2863,7 +2862,7 @@ bool may_open_dev(const struct path *path)
2863 !(path->mnt->mnt_sb->s_iflags & SB_I_NODEV); 2862 !(path->mnt->mnt_sb->s_iflags & SB_I_NODEV);
2864} 2863}
2865 2864
2866static int may_open(struct path *path, int acc_mode, int flag) 2865static int may_open(const struct path *path, int acc_mode, int flag)
2867{ 2866{
2868 struct dentry *dentry = path->dentry; 2867 struct dentry *dentry = path->dentry;
2869 struct inode *inode = dentry->d_inode; 2868 struct inode *inode = dentry->d_inode;
@@ -2913,7 +2912,7 @@ static int may_open(struct path *path, int acc_mode, int flag)
2913 2912
2914static int handle_truncate(struct file *filp) 2913static int handle_truncate(struct file *filp)
2915{ 2914{
2916 struct path *path = &filp->f_path; 2915 const struct path *path = &filp->f_path;
2917 struct inode *inode = path->dentry->d_inode; 2916 struct inode *inode = path->dentry->d_inode;
2918 int error = get_write_access(inode); 2917 int error = get_write_access(inode);
2919 if (error) 2918 if (error)