shithub: riscv

Download patch

ref: b4f56f1f4e8eff3965457ef9492528ee820e59bd
parent: 9f4eac529243e21ae310ad3a07139d9981f1ce9c
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Aug 9 17:35:50 EDT 2015

kernel: mount flag is int not ulong, reduce size of Mount struct by putting mflag field in what would be wasted as padding

--- a/sys/src/9/port/portdat.h
+++ b/sys/src/9/port/portdat.h
@@ -254,11 +254,11 @@
 struct Mount
 {
 	ulong	mountid;
+	int	mflag;
 	Mount*	next;
 	Mount*	order;
 	Chan*	to;			/* channel replacing channel */
-	int	mflag;
-	char	*spec;
+	char*	spec;
 };
 
 struct Mhead
--- a/sys/src/9/port/sysfile.c
+++ b/sys/src/9/port/sysfile.c
@@ -1002,7 +1002,7 @@
 }
 
 long
-bindmount(int ismount, int fd, int afd, char* arg0, char* arg1, ulong flag, char* spec)
+bindmount(int ismount, int fd, int afd, char* arg0, char* arg1, int flag, char* spec)
 {
 	int ret;
 	Chan *c0, *c1, *ac, *bc;
@@ -1074,11 +1074,11 @@
 sysbind(va_list list)
 {
 	char *arg0, *arg1;
-	ulong flag;
+	int flag;
 
 	arg0 = va_arg(list, char*);
 	arg1 = va_arg(list, char*);
-	flag = va_arg(list, ulong);
+	flag = va_arg(list, int);
 	return (uintptr)bindmount(0, -1, -1, arg0, arg1, flag, nil);
 }
 
@@ -1086,13 +1086,13 @@
 sysmount(va_list list)
 {
 	char *arg1, *spec;
-	ulong flag;
+	int flag;
 	int fd, afd;
 
 	fd = va_arg(list, int);
 	afd = va_arg(list, int);
 	arg1 = va_arg(list, char*);
-	flag = va_arg(list, ulong);
+	flag = va_arg(list, int);
 	spec = va_arg(list, char*);
 	return (uintptr)bindmount(1, fd, afd, nil, arg1, flag, spec);
 }
@@ -1101,12 +1101,12 @@
 sys_mount(va_list list)
 {
 	char *arg1, *spec;
-	ulong flag;
+	int flag;
 	int fd;
 
 	fd = va_arg(list, int);
 	arg1 = va_arg(list, char*);
-	flag = va_arg(list, ulong);
+	flag = va_arg(list, int);
 	spec = va_arg(list, char*);
 	return (uintptr)bindmount(1, fd, -1, nil, arg1, flag, spec);
 }