ANDROID: sdcardfs: Enable modular sdcardfs

Export the following symbols:

- copy_fs_struct
- free_fs_struct
- security_path_chown
- set_fs_pwd
- vfs_read
- vfs_write

These are needed to build sdcardfs as a module.

Test: HiKey/X15 + Pie + android-mainline,
      and HiKey + AOSP Maser + android-mainline,
      directories under /sdcard created,
      output of mount is right,
      CTS test collecting device infor works

Bug: 35142419
Change-Id: If6e14f0b3bdc858a9f684e6c209927a9232091f0
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Signed-off-by: Guenter Roeck <groeck@chromium.org>
[astrachan: Folded the following changes into this patch:
            e19f69662df5 ("ANDROID: Revert "fs: unexport vfs_read and vfs_write"")
            17071a8e1e7d ("ANDROID: fs: Export free_fs_struct and set_fs_pwd")
            2e9a639597cd ("ANDROID: export security_path_chown")]
Signed-off-by: Alistair Strachan <astrachan@google.com>
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
This commit is contained in:
Daniel Rosenberg 2018-01-30 14:24:02 -08:00 committed by Alistair Delva
parent a9d6506055
commit c0dbfed5ff
3 changed files with 7 additions and 0 deletions

View File

@ -46,6 +46,7 @@ void set_fs_pwd(struct fs_struct *fs, const struct path *path)
if (old_pwd.dentry) if (old_pwd.dentry)
path_put(&old_pwd); path_put(&old_pwd);
} }
EXPORT_SYMBOL(set_fs_pwd);
static inline int replace_path(struct path *p, const struct path *old, const struct path *new) static inline int replace_path(struct path *p, const struct path *old, const struct path *new)
{ {
@ -91,6 +92,7 @@ void free_fs_struct(struct fs_struct *fs)
path_put(&fs->pwd); path_put(&fs->pwd);
kmem_cache_free(fs_cachep, fs); kmem_cache_free(fs_cachep, fs);
} }
EXPORT_SYMBOL(free_fs_struct);
void exit_fs(struct task_struct *tsk) void exit_fs(struct task_struct *tsk)
{ {
@ -129,6 +131,7 @@ struct fs_struct *copy_fs_struct(struct fs_struct *old)
} }
return fs; return fs;
} }
EXPORT_SYMBOL_GPL(copy_fs_struct);
int unshare_fs_struct(void) int unshare_fs_struct(void)
{ {

View File

@ -469,6 +469,8 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
return ret; return ret;
} }
EXPORT_SYMBOL(vfs_read);
static ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos) static ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos)
{ {
struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = len }; struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = len };
@ -566,6 +568,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_
return ret; return ret;
} }
EXPORT_SYMBOL(vfs_write);
/* file_ppos returns &file->f_pos or NULL if file is stream */ /* file_ppos returns &file->f_pos or NULL if file is stream */
static inline loff_t *file_ppos(struct file *file) static inline loff_t *file_ppos(struct file *file)

View File

@ -1058,6 +1058,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
return 0; return 0;
return call_int_hook(path_chown, 0, path, uid, gid); return call_int_hook(path_chown, 0, path, uid, gid);
} }
EXPORT_SYMBOL(security_path_chown);
int security_path_chroot(const struct path *path) int security_path_chroot(const struct path *path)
{ {