aboutsummaryrefslogtreecommitdiff
path: root/fs/sdcardfs/sdcardfs.h
Commit message (Collapse)AuthorAgeFilesLines
* ANDROID: sdcardfs: Protect set_topDaniel Rosenberg2019-07-201-8/+18
| | | | | | | | | | | | | | | If the top is changed while we're attempting to use it, it's possible that the reference will be put while we are in the process of grabbing a reference. Now we grab a spinlock to protect grabbing our reference count. Additionally, we now set the inode_info's top value to point to it's own data when initializing, which makes tracking changes easier. Change-Id: If15748c786ce4c0480ab8c5051a92523aff284d2 Signed-off-by: Daniel Rosenberg <drosen@google.com>
* ANDROID: sdcardfs: Add option to not link obbDaniel Rosenberg2018-12-211-0/+1
| | | | | | | | | | | | Add mount option unshared_obb to not link the obb folders of multiple users together. Bug: 27915347 Test: mount with option. Check if altering one obb alters the other Signed-off-by: Daniel Rosenberg <drosen@google.com> Change-Id: I3956e06bd0a222b0bbb2768c9a8a8372ada85e1e
* ANDROID: sdcardfs: Add option to drop unused dentriesDaniel Rosenberg2018-12-211-0/+1
| | | | | | | | | | This adds the nocache mount option, which will cause sdcardfs to always drop dentries that are not in use, preventing cached entries from holding on to lower dentries, which could cause strange behavior when bypassing the sdcardfs layer and directly changing the lower fs. Change-Id: I70268584a20b989ae8cfdd278a2e4fa1605217fb Signed-off-by: Daniel Rosenberg <drosen@google.com>
* ANDROID: sdcardfs: Don't use OVERRIDE_CRED macroDaniel Rosenberg2018-11-271-26/+0
| | | | | | | | | | | The macro hides some control flow, making it easier to run into bugs. bug: 111642636 Change-Id: I37ec207c277d97c4e7f1e8381bc9ae743ad78435 Reported-by: Jann Horn <jannh@google.com> Signed-off-by: Daniel Rosenberg <drosen@google.com>
* ANDROID: sdcardfs: Move default_normal to superblockDaniel Rosenberg2018-01-201-4/+6
| | | | | | | | | Moving default_normal from mount info to superblock info as it doesn't need to change between mount points. Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 72158116 Change-Id: I16c6a0577c601b4f7566269f7e189fcf697afd4e
* ANDROID: sdcardfs: Add default_normal optionDaniel Rosenberg2018-01-051-1/+2
| | | | | | | | | The default_normal option causes mounts with the gid set to AID_SDCARD_RW to have user specific gids, as in the normal case. Signed-off-by: Daniel Rosenberg <drosen@google.com> Change-Id: I9619b8ac55f41415df943484dc8db1ea986cef6f Bug: 64672411
* ANDROID: Sdcardfs: Move gid derivation under flagDaniel Rosenberg2017-09-131-0/+1
| | | | | | | | | This moves the code to adjust the gid/uid of lower filesystem files under the mount flag derive_gid. Signed-off-by: Daniel Rosenberg <drosen@google.com> Change-Id: I44eaad4ef67c7fcfda3b6ea3502afab94442610c Bug: 63245673
* ANDROID: sdcardfs: remove dead function open_flags_to_access_mode()Greg Hackmann2017-06-221-1/+0
| | | | | | | | | | smatch warns about the suspicious formatting in the last line of open_flags_to_access_mode(). It turns out the only caller was deleted over a year ago by "ANDROID: sdcardfs: Bring up to date with Android M permissions:", so we can "fix" the function's formatting by deleting it. Change-Id: Id85946f3eb01722eef35b1815f405a6fda3aa4ff Signed-off-by: Greg Hackmann <ghackmann@google.com>
* ANDROID: sdcardfs: Add linux/kref.h includeDmitry Shmidt2017-05-181-0/+1
| | | | | Change-Id: I8be0f6fc7aa6dc1d639d2d22b230783c68574389 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* ANDROID: sdcardfs: Move top to its own structDaniel Rosenberg2017-05-181-37/+67
| | | | | | | | | | Move top, and the associated data, to its own struct. This way, we can properly track refcounts on top without interfering with the inode's accounting. Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 38045152 Change-Id: I1968e480d966c3f234800b72e43670ca11e1d3fd
* sdcardfs: indentationMister Oyster2017-04-161-7/+9
|
* ANDROID: sdcardfs: Fix style issues in macrosDaniel Rosenberg2017-04-131-10/+10
| | | | | | Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35331000 Change-Id: I89c4035029dc2236081a7685c55cac595d9e7ebf
* ANDROID: sdcardfs: Use pr_[...] instead of printkDaniel Rosenberg2017-04-131-1/+1
| | | | | | Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35331000 Change-Id: Ibc635ec865750530d32b87067779f681fe58a003
* ANDROID: sdcardfs: Fix formattingDaniel Rosenberg2017-04-131-50/+59
| | | | | | | | | This fixes various spacing and bracket related issues pointed out by checkpatch. Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35331000 Change-Id: I6e248833a7a04e3899f3ae9462d765cfcaa70c96
* ANDROID: sdcardfs: Use d_invalidate instead of drop_recurisveDaniel Rosenberg2017-04-131-2/+0
| | | | | | | | | | | drop_recursive did not properly remove stale dentries. Instead, we use the vfs's d_invalidate, which does the proper cleanup. Additionally, remove the no longer used drop_recursive, and fixup_top_recursive that that are no longer used. Signed-off-by: Daniel Rosenberg <drosen@google.com> Change-Id: Ibff61b0c34b725b024a050169047a415bc90f0d8
* ANDROID: sdcardfs: Switch to internal case insensitive compareDaniel Rosenberg2017-04-131-2/+5
| | | | | | | | | | | | | | | There were still a few places where we called into a case insensitive lookup that was not defined by sdcardfs. Moving them all to the same place will allow us to switch the implementation in the future. Additionally, the check in fixup_perms_recursive did not take into account the length of both strings, causing extraneous matches when the name we were looking for was a prefix of the child name. Signed-off-by: Daniel Rosenberg <drosen@google.com> Change-Id: I45ce768cd782cb4ea1ae183772781387c590ecc2
* ANDROID: sdcardfs: support direct-IO (DIO) operationsDaniel Rosenberg2017-04-131-0/+1
| | | | | | | | | | | This comes from the wrapfs patch 2e346c83b26e Wrapfs: support direct-IO (DIO) operations Signed-off-by: Li Mengyang <li.mengyang@stonybrook.edu> Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu> Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 34133558 Change-Id: I3fd779c510ab70d56b1d918f99c20421b524cdc4
* ANDROID: sdcardfs: Switch strcasecmp for internal callDaniel Rosenberg2017-04-131-2/+15
| | | | | | | | | This moves our uses of strcasecmp over to an internal call so we can easily change implementations later if we so desire. Additionally, we leverage qstr's where appropriate to save time on comparisons. Change-Id: I32fdc4fd0cd3b7b735dcfd82f60a2516fd8272a5 Signed-off-by: Daniel Rosenberg <drosen@google.com>
* ANDROID: sdcardfs: Add GID Derivation to sdcardfsDaniel Rosenberg2017-04-131-6/+19
| | | | | | | | | | | | | | | This changes sdcardfs to modify the user and group in the underlying filesystem depending on its usage. Ownership is set by Android user, and package, as well as if the file is under obb or cache. Other files can be labeled by extension. Those values are set via the configfs interace. To add an entry, mkdir -p [configfs root]/sdcardfs/extensions/[gid]/[ext] Bug: 34262585 Change-Id: I4e030ce84f094a678376349b1a96923e5076a0f4 Signed-off-by: Daniel Rosenberg <drosen@google.com>
* ANDROID: sdcardfs: add support for user permission isolationDaniel Rosenberg2017-04-131-1/+16
| | | | | | | | | | | This allows you to hide the existence of a package from a user by adding them to an exclude list. If a user creates that package's folder and is on the exclude list, they will not see that package's id. Bug: 34542611 Change-Id: I9eb82e0bf2457d7eb81ee56153b9c7d2f6646323 Signed-off-by: Daniel Rosenberg <drosen@google.com>
* sdcardfs: Use per mount permissionsDaniel Rosenberg2017-04-131-16/+28
| | | | | | | | | | | | | | | | | | This switches sdcardfs over to using permission2. Instead of mounting several sdcardfs instances onto the same underlaying directory, you bind mount a single mount several times, and remount with the options you want. These are stored in the private mount data, allowing you to maintain the same tree, but have different permissions for different mount points. Warning functions have been added for permission, as it should never be called, and the correct behavior is unclear. Change-Id: I841b1d70ec60cf2b866fa48edeb74a0b0f8334f5 Signed-off-by: Daniel Rosenberg <drosen@google.com>
* sdcardfs: Add gid and mask to private mount dataDaniel Rosenberg2017-04-131-0/+8
| | | | | | | | | | Adds support for mount2, remount2, and the functions to allocate/clone/copy the private data The next patch will switch over to actually using it. Change-Id: I8a43da26021d33401f655f0b2784ead161c575e3 Signed-off-by: Daniel Rosenberg <drosen@google.com>
* sdcardfs: User new permission2 functionsDaniel Rosenberg2017-04-131-2/+2
| | | | | Change-Id: Ic7e0fb8fdcebb31e657b079fe02ac834c4a50db9 Signed-off-by: Daniel Rosenberg <drosen@google.com>
* sdcardfs: Added top to sdcardfs_inode_infoDaniel Rosenberg2017-04-131-4/+36
| | | | | | | | | | | | | | | | | | | 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>
* sdcardfs: Switch package list to RCUDaniel Rosenberg2017-04-111-1/+1
| | | | | | | Switched the package id hashmap to use RCU. Change-Id: I9fdcab279009005bf28536247d11e13babab0b93 Signed-off-by: Daniel Rosenberg <drosen@google.com>
* sdcardfs: remove effectless config optionDaniel Rosenberg2017-04-111-6/+0
| | | | | | | | | | CONFIG_SDCARD_FS_CI_SEARCH only guards a define for LOOKUP_CASE_INSENSITIVE, which is never used in the kernel. Remove both, along with the option matching that supports it. Change-Id: I363a8f31de8ee7a7a934d75300cc9ba8176e2edf Signed-off-by: Daniel Rosenberg <drosen@google.com>
* sdcardfs: Bring up to date with Android M permissions:Daniel Rosenberg2017-04-111-42/+92
| | | | | | | In M, the workings of sdcardfs were changed significantly. This brings sdcardfs into line with the changes. Change-Id: I10e91a84a884c838feef7aa26c0a2b21f02e052e
* sdcardfs: port to 3.10Daniel Campello2017-04-111-15/+8
| | | | Change-Id: I832a14cee3fcbf47ee6e5da2943a90f9dea5b60a
* Initial port of sdcardfsDaniel Campello2017-04-111-0/+493
Change-Id: I5b5772a2bbff9f3a7dda641644630a7b8afacec0