Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit c12adb1

Browse files
ANDROID: incfs: fix code behind new ->d_revalidate() signature
In commit 5be1fa8 ("Pass parent directory inode and expected name to ->d_revalidate()") the signature of ->d_revalidate() changed with two new arguments added. Rework incfs code based on ecryptfs change. Bug: 408330333 Change-Id: I65c5d0662ed4e3a2bae107005cb7e1855af73bff Signed-off-by: Paul Lawrence <paullawrence@google.com> Test: incfs_test
1 parent e397706 commit c12adb1

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

fs/incfs/vfs.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,13 +1571,16 @@ static int dentry_revalidate(struct inode *dir, const struct qstr *name,
15711571
}
15721572

15731573
if (backing_dentry->d_flags & DCACHE_OP_REVALIDATE) {
1574-
/*
1575-
* TODO(b/408330333): ->d_revalidate() needs the inode of
1576-
* the parent directory and the expected dentry name from
1577-
* the "backing_dentry". FIXME!
1578-
*/
1579-
result = backing_dentry->d_op->d_revalidate(dir, name,
1580-
backing_dentry, flags);
1574+
struct inode_info *dir_info = get_incfs_node(dir);
1575+
struct inode *backing_dir = dir_info ? dir_info->n_backing_inode : NULL;
1576+
struct name_snapshot n;
1577+
1578+
if (!backing_dir)
1579+
goto out;
1580+
take_dentry_name_snapshot(&n, backing_dentry);
1581+
result = backing_dentry->d_op->d_revalidate(backing_dir,
1582+
&n.name, backing_dentry, flags);
1583+
release_dentry_name_snapshot(&n);
15811584
} else
15821585
result = 1;
15831586

0 commit comments

Comments
 (0)