Commit 8c617450 authored by Johannes Berg's avatar Johannes Berg Committed by Richard Weinberger
Browse files

um: hostfs: define our own API boundary



Instead of exporting the set of functions provided by
glibc that are needed for hostfs_user.c, just build that
into the kernel image whenever hostfs is built, and then
export _those_ functions cleanly, to be independent of
the libc implementation.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent ce1831fe
Loading
Loading
Loading
Loading
+0 −70
Original line number Diff line number Diff line
@@ -34,81 +34,11 @@ EXPORT_SYMBOL(memset);

EXPORT_SYMBOL(printf);

/* Here, instead, I can provide a fake prototype. Yes, someone cares: genksyms.
 * However, the modules will use the CRC defined *here*, no matter if it is
 * good; so the versions of these symbols will always match
 */
#define EXPORT_SYMBOL_PROTO(sym)       \
	int sym(void) __weak; \
	EXPORT_SYMBOL(sym);

extern void readdir64(void) __attribute__((weak));
EXPORT_SYMBOL(readdir64);
extern void truncate64(void) __attribute__((weak));
EXPORT_SYMBOL(truncate64);

#ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA
EXPORT_SYMBOL(vsyscall_ehdr);
EXPORT_SYMBOL(vsyscall_end);
#endif

EXPORT_SYMBOL_PROTO(__errno_location);

EXPORT_SYMBOL_PROTO(access);
EXPORT_SYMBOL_PROTO(open);
EXPORT_SYMBOL_PROTO(open64);
EXPORT_SYMBOL_PROTO(close);
EXPORT_SYMBOL_PROTO(read);
EXPORT_SYMBOL_PROTO(write);
EXPORT_SYMBOL_PROTO(dup2);
EXPORT_SYMBOL_PROTO(__xstat);
EXPORT_SYMBOL_PROTO(__lxstat);
EXPORT_SYMBOL_PROTO(__lxstat64);
EXPORT_SYMBOL_PROTO(__fxstat64);
EXPORT_SYMBOL_PROTO(lseek);
EXPORT_SYMBOL_PROTO(lseek64);
EXPORT_SYMBOL_PROTO(chown);
EXPORT_SYMBOL_PROTO(fchown);
EXPORT_SYMBOL_PROTO(truncate);
EXPORT_SYMBOL_PROTO(ftruncate64);
EXPORT_SYMBOL_PROTO(utime);
EXPORT_SYMBOL_PROTO(utimes);
EXPORT_SYMBOL_PROTO(futimes);
EXPORT_SYMBOL_PROTO(chmod);
EXPORT_SYMBOL_PROTO(fchmod);
EXPORT_SYMBOL_PROTO(rename);
EXPORT_SYMBOL_PROTO(__xmknod);

EXPORT_SYMBOL_PROTO(symlink);
EXPORT_SYMBOL_PROTO(link);
EXPORT_SYMBOL_PROTO(unlink);
EXPORT_SYMBOL_PROTO(readlink);

EXPORT_SYMBOL_PROTO(mkdir);
EXPORT_SYMBOL_PROTO(rmdir);
EXPORT_SYMBOL_PROTO(opendir);
EXPORT_SYMBOL_PROTO(readdir);
EXPORT_SYMBOL_PROTO(closedir);
EXPORT_SYMBOL_PROTO(seekdir);
EXPORT_SYMBOL_PROTO(telldir);

EXPORT_SYMBOL_PROTO(ioctl);

EXPORT_SYMBOL_PROTO(pread64);
EXPORT_SYMBOL_PROTO(pwrite64);

EXPORT_SYMBOL_PROTO(statfs);
EXPORT_SYMBOL_PROTO(statfs64);

EXPORT_SYMBOL_PROTO(getuid);

EXPORT_SYMBOL_PROTO(fsync);
EXPORT_SYMBOL_PROTO(fdatasync);

EXPORT_SYMBOL_PROTO(lstat64);
EXPORT_SYMBOL_PROTO(fstat64);
EXPORT_SYMBOL_PROTO(mknod);

/* Export symbols used by GCC for the stack protector. */
extern void __stack_smash_handler(void *) __attribute__((weak));
EXPORT_SYMBOL(__stack_smash_handler);
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ obj-$(CONFIG_9P_FS) += 9p/
obj-$(CONFIG_AFS_FS)		+= afs/
obj-$(CONFIG_NILFS2_FS)		+= nilfs2/
obj-$(CONFIG_BEFS_FS)		+= befs/
obj-$(CONFIG_HOSTFS)		+= hostfs/
obj-y				+= hostfs/
obj-$(CONFIG_CACHEFILES)	+= cachefiles/
obj-$(CONFIG_DEBUG_FS)		+= debugfs/
obj-$(CONFIG_TRACING)		+= tracefs/
+4 −2
Original line number Diff line number Diff line
@@ -3,9 +3,11 @@
# Licensed under the GPL
#

hostfs-objs := hostfs_kern.o hostfs_user.o
hostfs-objs := hostfs_kern.o

obj-y :=
hostfs-builtin-$(CONFIG_HOSTFS) += hostfs_user.o hostfs_user_exp.o

obj-y := $(hostfs-builtin-y) $(hostfs-builtin-m)
obj-$(CONFIG_HOSTFS) += hostfs.o

include $(srctree)/arch/um/scripts/Makefile.rules
+28 −0
Original line number Diff line number Diff line
#include <linux/module.h>
#include "hostfs.h"

EXPORT_SYMBOL_GPL(stat_file);
EXPORT_SYMBOL_GPL(access_file);
EXPORT_SYMBOL_GPL(open_file);
EXPORT_SYMBOL_GPL(open_dir);
EXPORT_SYMBOL_GPL(seek_dir);
EXPORT_SYMBOL_GPL(read_dir);
EXPORT_SYMBOL_GPL(read_file);
EXPORT_SYMBOL_GPL(write_file);
EXPORT_SYMBOL_GPL(lseek_file);
EXPORT_SYMBOL_GPL(fsync_file);
EXPORT_SYMBOL_GPL(replace_file);
EXPORT_SYMBOL_GPL(close_file);
EXPORT_SYMBOL_GPL(close_dir);
EXPORT_SYMBOL_GPL(file_create);
EXPORT_SYMBOL_GPL(set_attr);
EXPORT_SYMBOL_GPL(make_symlink);
EXPORT_SYMBOL_GPL(unlink_file);
EXPORT_SYMBOL_GPL(do_mkdir);
EXPORT_SYMBOL_GPL(hostfs_do_rmdir);
EXPORT_SYMBOL_GPL(do_mknod);
EXPORT_SYMBOL_GPL(link_file);
EXPORT_SYMBOL_GPL(hostfs_do_readlink);
EXPORT_SYMBOL_GPL(rename_file);
EXPORT_SYMBOL_GPL(rename2_file);
EXPORT_SYMBOL_GPL(do_statfs);