summaryrefslogtreecommitdiff
path: root/fs/sdcardfs/super.c
diff options
context:
space:
mode:
authorDaniel Rosenberg <drosen@google.com>2016-05-18 16:57:10 -0700
committerDaniel Rosenberg <drosen@google.com>2017-01-26 15:53:30 -0800
commit640e5265032d2e36c8933f09657f34946fbf8259 (patch)
tree8354e22ab8855511f9af142506bc340b057a33a2 /fs/sdcardfs/super.c
parent1fb590f2d5ada66a89b82c7657b3002892c966b6 (diff)
ANDROID: sdcardfs: Added top to sdcardfs_inode_info
Adding packages to the package list and moving files takes a large amount of locks, and is currently a heavy operation. This adds a 'top' field to the inode_info, which points to the inode for the top most directory whose owner you would like to match. On permission checks and get_attr, we look up the owner based on the information at top. When we change a package mapping, we need only modify the information in the corresponding top inode_info's. When renaming, we must ensure top is set correctly in all children. This happens when an app specific folder gets moved outside of the folder for that app. Change-Id: Ib749c60b568e9a45a46f8ceed985c1338246ec6c Signed-off-by: Daniel Rosenberg <drosen@google.com>
Diffstat (limited to 'fs/sdcardfs/super.c')
-rw-r--r--fs/sdcardfs/super.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/sdcardfs/super.c b/fs/sdcardfs/super.c
index 1d6490128c99..0a465395aab7 100644
--- a/fs/sdcardfs/super.c
+++ b/fs/sdcardfs/super.c
@@ -126,6 +126,7 @@ static void sdcardfs_evict_inode(struct inode *inode)
*/
lower_inode = sdcardfs_lower_inode(inode);
sdcardfs_set_lower_inode(inode, NULL);
+ set_top(SDCARDFS_I(inode), inode);
iput(lower_inode);
}