diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2008-08-02 01:04:36 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-10-23 05:12:52 -0400 |
| commit | 421748ecde8e69a6364e5ae66eb3bf87e1f995c0 (patch) | |
| tree | 50ef878f8c46b1ec729625ed678d04aaeaaee6dd /fs/ecryptfs | |
| parent | a63bb99660d82dfe7c51588e1f9aadefb756ba51 (diff) | |
[PATCH] assorted path_lookup() -> kern_path() conversions
more nameidata eviction
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ecryptfs')
| -rw-r--r-- | fs/ecryptfs/main.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index 046e027a4cb1..64d2ba980df4 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
| @@ -471,31 +471,26 @@ out: | |||
| 471 | */ | 471 | */ |
| 472 | static int ecryptfs_read_super(struct super_block *sb, const char *dev_name) | 472 | static int ecryptfs_read_super(struct super_block *sb, const char *dev_name) |
| 473 | { | 473 | { |
| 474 | struct path path; | ||
| 474 | int rc; | 475 | int rc; |
| 475 | struct nameidata nd; | ||
| 476 | struct dentry *lower_root; | ||
| 477 | struct vfsmount *lower_mnt; | ||
| 478 | 476 | ||
| 479 | memset(&nd, 0, sizeof(struct nameidata)); | 477 | rc = kern_path(dev_name, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &path); |
| 480 | rc = path_lookup(dev_name, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &nd); | ||
| 481 | if (rc) { | 478 | if (rc) { |
| 482 | ecryptfs_printk(KERN_WARNING, "path_lookup() failed\n"); | 479 | ecryptfs_printk(KERN_WARNING, "path_lookup() failed\n"); |
| 483 | goto out; | 480 | goto out; |
| 484 | } | 481 | } |
| 485 | lower_root = nd.path.dentry; | 482 | ecryptfs_set_superblock_lower(sb, path.dentry->d_sb); |
| 486 | lower_mnt = nd.path.mnt; | 483 | sb->s_maxbytes = path.dentry->d_sb->s_maxbytes; |
| 487 | ecryptfs_set_superblock_lower(sb, lower_root->d_sb); | 484 | sb->s_blocksize = path.dentry->d_sb->s_blocksize; |
| 488 | sb->s_maxbytes = lower_root->d_sb->s_maxbytes; | 485 | ecryptfs_set_dentry_lower(sb->s_root, path.dentry); |
| 489 | sb->s_blocksize = lower_root->d_sb->s_blocksize; | 486 | ecryptfs_set_dentry_lower_mnt(sb->s_root, path.mnt); |
| 490 | ecryptfs_set_dentry_lower(sb->s_root, lower_root); | 487 | rc = ecryptfs_interpose(path.dentry, sb->s_root, sb, 0); |
| 491 | ecryptfs_set_dentry_lower_mnt(sb->s_root, lower_mnt); | ||
| 492 | rc = ecryptfs_interpose(lower_root, sb->s_root, sb, 0); | ||
| 493 | if (rc) | 488 | if (rc) |
| 494 | goto out_free; | 489 | goto out_free; |
| 495 | rc = 0; | 490 | rc = 0; |
| 496 | goto out; | 491 | goto out; |
| 497 | out_free: | 492 | out_free: |
| 498 | path_put(&nd.path); | 493 | path_put(&path); |
| 499 | out: | 494 | out: |
| 500 | return rc; | 495 | return rc; |
| 501 | } | 496 | } |
