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

Commit e0f526b

Browse files
gregkhCarlos Llamas
authored andcommitted
ANDROID: GKI: add more vfs-only exports to their own namespace
When using sdcardfs, some more vfs symbols are needed to be exported to the filesystem namespace, in order for it to build properly and to prevent drivers from accessing them. Like commit 0a77fca ("ANDROID: GKI: set vfs-only exports into their own namespace"), move them to the vfs-only namespace so that builds work properly. Bug: 157965270 Bug: 210074446 Bug: 317479303 Change-Id: I915402a03712241bdf48681e3fb46aa33dcff305 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
1 parent 7c5c987 commit e0f526b

File tree

14 files changed

+27
-18
lines changed

14 files changed

+27
-18
lines changed

drivers/block/loop.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,7 @@ MODULE_PARM_DESC(hw_queue_depth, "Queue depth for each hardware queue. Default:
18351835
MODULE_DESCRIPTION("Loopback device support");
18361836
MODULE_LICENSE("GPL");
18371837
MODULE_ALIAS_BLOCKDEV_MAJOR(LOOP_MAJOR);
1838+
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
18381839

18391840
static blk_status_t loop_queue_rq(struct blk_mq_hw_ctx *hctx,
18401841
const struct blk_mq_queue_data *bd)

drivers/gpu/drm/drm_lease.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
#include "drm_crtc_internal.h"
1616
#include "drm_internal.h"
1717

18+
/* ANDROID:
19+
* this is needed to get access to dentry_open, which the drm layer does
20+
* need to do.
21+
*/
22+
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
23+
1824
/**
1925
* DOC: drm leasing
2026
*

fs/dcache.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ void d_drop(struct dentry *dentry)
548548
__d_drop(dentry);
549549
spin_unlock(&dentry->d_lock);
550550
}
551-
EXPORT_SYMBOL(d_drop);
551+
EXPORT_SYMBOL_NS(d_drop, ANDROID_GKI_VFS_EXPORT_ONLY);
552552

553553
static inline void dentry_unlist(struct dentry *dentry)
554554
{
@@ -930,7 +930,7 @@ struct dentry *dget_parent(struct dentry *dentry)
930930
spin_unlock(&ret->d_lock);
931931
return ret;
932932
}
933-
EXPORT_SYMBOL(dget_parent);
933+
EXPORT_SYMBOL_NS(dget_parent, ANDROID_GKI_VFS_EXPORT_ONLY);
934934

935935
static struct dentry * __d_find_any_alias(struct inode *inode)
936936
{
@@ -1812,7 +1812,7 @@ void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op)
18121812
dentry->d_flags |= DCACHE_OP_REAL;
18131813

18141814
}
1815-
EXPORT_SYMBOL(d_set_d_op);
1815+
EXPORT_SYMBOL_NS(d_set_d_op, ANDROID_GKI_VFS_EXPORT_ONLY);
18161816

18171817
static unsigned d_flags_for_inode(struct inode *inode)
18181818
{
@@ -2433,7 +2433,7 @@ void d_rehash(struct dentry * entry)
24332433
__d_rehash(entry);
24342434
spin_unlock(&entry->d_lock);
24352435
}
2436-
EXPORT_SYMBOL(d_rehash);
2436+
EXPORT_SYMBOL_NS(d_rehash, ANDROID_GKI_VFS_EXPORT_ONLY);
24372437

24382438
static inline unsigned start_dir_add(struct inode *dir)
24392439
{

fs/locks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1642,7 +1642,7 @@ int __break_lease(struct inode *inode, unsigned int mode, unsigned int type)
16421642
locks_free_lease(new_fl);
16431643
return error;
16441644
}
1645-
EXPORT_SYMBOL(__break_lease);
1645+
EXPORT_SYMBOL_NS(__break_lease, ANDROID_GKI_VFS_EXPORT_ONLY);
16461646

16471647
/**
16481648
* lease_get_mtime - update modified time of an inode with exclusive lease

fs/namei.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ void path_get(const struct path *path)
555555
mntget(path->mnt);
556556
dget(path->dentry);
557557
}
558-
EXPORT_SYMBOL(path_get);
558+
EXPORT_SYMBOL_NS(path_get, ANDROID_GKI_VFS_EXPORT_ONLY);
559559

560560
/**
561561
* path_put - put a reference to a path
@@ -2762,7 +2762,7 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt,
27622762
putname(filename);
27632763
return ret;
27642764
}
2765-
EXPORT_SYMBOL(vfs_path_lookup);
2765+
EXPORT_SYMBOL_NS(vfs_path_lookup, ANDROID_GKI_VFS_EXPORT_ONLY);
27662766

27672767
static int lookup_one_common(struct mnt_idmap *idmap,
27682768
const char *name, struct dentry *base, int len,
@@ -3165,7 +3165,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
31653165
mutex_lock(&p1->d_sb->s_vfs_rename_mutex);
31663166
return lock_two_directories(p1, p2);
31673167
}
3168-
EXPORT_SYMBOL(lock_rename);
3168+
EXPORT_SYMBOL_NS(lock_rename, ANDROID_GKI_VFS_EXPORT_ONLY);
31693169

31703170
/*
31713171
* c1 and p2 should be on the same fs.
@@ -3217,7 +3217,7 @@ void unlock_rename(struct dentry *p1, struct dentry *p2)
32173217
mutex_unlock(&p1->d_sb->s_vfs_rename_mutex);
32183218
}
32193219
}
3220-
EXPORT_SYMBOL(unlock_rename);
3220+
EXPORT_SYMBOL_NS(unlock_rename, ANDROID_GKI_VFS_EXPORT_ONLY);
32213221

32223222
/**
32233223
* vfs_prepare_mode - prepare the mode to be used for a new inode

fs/namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ struct vfsmount *mntget(struct vfsmount *mnt)
14781478
mnt_add_count(real_mount(mnt), 1);
14791479
return mnt;
14801480
}
1481-
EXPORT_SYMBOL(mntget);
1481+
EXPORT_SYMBOL_NS_GPL(mntget, ANDROID_GKI_VFS_EXPORT_ONLY);
14821482

14831483
/*
14841484
* Make a mount point inaccessible to new lookups.

fs/open.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ struct file *dentry_open(const struct path *path, int flags,
11181118
}
11191119
return f;
11201120
}
1121-
EXPORT_SYMBOL(dentry_open);
1121+
EXPORT_SYMBOL_NS(dentry_open, ANDROID_GKI_VFS_EXPORT_ONLY);
11221122

11231123
/**
11241124
* dentry_create - Create and open a file

fs/stack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void fsstack_copy_inode_size(struct inode *dst, struct inode *src)
5757
if (sizeof(i_size) > sizeof(long) || sizeof(i_blocks) > sizeof(long))
5858
spin_unlock(&dst->i_lock);
5959
}
60-
EXPORT_SYMBOL_GPL(fsstack_copy_inode_size);
60+
EXPORT_SYMBOL_NS_GPL(fsstack_copy_inode_size, ANDROID_GKI_VFS_EXPORT_ONLY);
6161

6262
/* copy all attributes */
6363
void fsstack_copy_attr_all(struct inode *dest, const struct inode *src)

fs/stat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ int vfs_getattr(const struct path *path, struct kstat *stat,
206206
return retval;
207207
return vfs_getattr_nosec(path, stat, request_mask, query_flags);
208208
}
209-
EXPORT_SYMBOL(vfs_getattr);
209+
EXPORT_SYMBOL_NS(vfs_getattr, ANDROID_GKI_VFS_EXPORT_ONLY);
210210

211211
/**
212212
* vfs_fstat - Get the basic attributes by file descriptor

fs/statfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ int vfs_statfs(const struct path *path, struct kstatfs *buf)
9292
buf->f_flags = calculate_f_flags(path->mnt);
9393
return error;
9494
}
95-
EXPORT_SYMBOL(vfs_statfs);
95+
EXPORT_SYMBOL_NS(vfs_statfs, ANDROID_GKI_VFS_EXPORT_ONLY);
9696

9797
int user_statfs(const char __user *pathname, struct kstatfs *st)
9898
{

0 commit comments

Comments
 (0)