36 #include <linux/ioport.h>
37 #include <linux/kobject.h>
38 #include <linux/klist.h>
39 #include <linux/list.h>
40 #include <linux/lockdep.h>
41 #include <linux/compiler.h>
42 #include <linux/types.h>
43 #include <linux/mutex.h>
45 #include <linux/atomic.h>
46 #include <linux/ratelimit.h>
47 #include <asm/device.h>
48 #include <linux/time.h>
50 #include <linux/kernel.h>
51 #include <linux/kthread.h>
52 #include <linux/sched.h>
53 #include <linux/module.h>
54 #include <linux/errno.h>
55 #include <linux/fcntl.h>
56 #include <linux/net.h>
58 #include <linux/inet.h>
59 #include <linux/udp.h>
60 #include <linux/tcp.h>
61 #include <linux/string.h>
62 #include <linux/unistd.h>
63 #include <linux/slab.h>
64 #include <linux/netdevice.h>
65 #include <linux/skbuff.h>
66 #include <linux/file.h>
67 #include <linux/freezer.h>
69 #include <net/checksum.h>
73 #include <net/tcp_states.h>
74 #include <asm/uaccess.h>
75 #include <asm/ioctls.h>
76 #include <trace/events/skb.h>
78 #include <linux/module.h>
79 #include <linux/types.h>
80 #include <linux/uio.h>
81 #include <linux/unistd.h>
83 #include <linux/sunrpc/types.h>
84 #include <linux/sunrpc/clnt.h>
85 #include <linux/sunrpc/xdr.h>
86 #include <linux/sunrpc/msg_prot.h>
87 #include <linux/sunrpc/svcsock.h>
88 #include <linux/sunrpc/stats.h>
89 #include <linux/sunrpc/xprt.h>
90 #include <linux/sunrpc/xprt.h>
110 struct hostport* get_least_loaded_hostport_from_cloud_fs();
111 char* get_host_from_cloud_Loadtrack_fs();
112 char* get_host_from_cloud_PRG_fs();
113 char* int_to_str(
int);
114 char* addr_to_str(
char*);
115 char* str_to_addr(
char*);
116 char* str_to_addr2(
char* straddr);
118 unsigned long addr_to_virgo_unique_id(
struct virgo_address* vaddr);
119 struct virgo_address* virgo_unique_id_to_addr(
unsigned long virgo_unique_id);
123 void var_sscanf(
char *str,
const char* fmt, ...);
125 struct mutex virgo_fs_mutex;
127 FPTR toFuncPtr(
char*);
128 struct virgo_fs_args* parse_virgofs_command(
char* fsFunction);
130 int virgocloudexec_fs_create(
void);
131 void* virgocloudexec_fs_recvfrom(
struct socket*);
132 int virgocloudexec_fs_sendto(
struct socket*,
void* virgo_fs_ret);
134 int virgo_cloudexec_fs_service(
void* args);
135 void do_virgocloudexec_init(
void);
137 extern void* virgo_cloud_open_kernelspace(
struct virgo_fs_args* args);
138 extern void* virgo_cloud_close_kernelspace(
struct virgo_fs_args* args);
139 extern void* virgo_cloud_read_kernelspace(
struct virgo_fs_args* args);
140 extern void* virgo_cloud_write_kernelspace(
struct virgo_fs_args* args);
141 extern char* toKernelAddress(
const char* str);
144 int (*virgo_fs_create)(void);
145 void* (*virgo_fs_recvfrom)(
struct socket*);
146 int (*virgo_fs_sendto)(
struct socket*,
void* virgo_fs_ret);
150 .virgo_fs_create = virgocloudexec_fs_create,
151 .virgo_fs_recvfrom = virgocloudexec_fs_recvfrom,
152 .virgo_fs_sendto = virgocloudexec_fs_sendto
156 const char* m_virgo_name;
157 struct module* m_virgo_owner;
162 .m_virgo_name =
"virgo_fs",
163 .m_virgo_owner = THIS_MODULE,
164 .m_virgo_ops = &virgo_fs_ops
167 static struct socket *sock;
169 int parameterIsExecutable=2;
170 struct file* file_stdout;
172 void print_buffer(
char*);
173 int tokenize_list_of_ip_addrs(
char* buf);
174 void read_virgo_config();
175 int kernel_space_func(
void* args);
176 char* strip_control_M(
char*);
178 int virgo_fs_client_thread(
void* args);
181 extern int virgo_cloud_test_kernelspace(
void* args);
188 int no_of_openfiles=-1;
189 struct file* open_VFS_files[256];
191 char* toVFSString(
int* data);