aboutsummaryrefslogtreecommitdiff
path: root/nfsmount.c
diff options
context:
space:
mode:
authorMark Whitley <markw@lineo.com>2001-01-23 22:30:04 +0000
committerMark Whitley <markw@lineo.com>2001-01-23 22:30:04 +0000
commit59ab025363d884deb2013dcaae6c968585a6ec72 (patch)
tree852d97bdc34c44dbcf29cc8b5cd9257a8c90f7b3 /nfsmount.c
parent2b8d07c590249991fae975652aae86f5fca91f81 (diff)
downloadbusybox-w32-59ab025363d884deb2013dcaae6c968585a6ec72.tar.gz
busybox-w32-59ab025363d884deb2013dcaae6c968585a6ec72.tar.bz2
busybox-w32-59ab025363d884deb2013dcaae6c968585a6ec72.zip
#define -> static const int. Also got rid of some big static buffers.
Diffstat (limited to 'nfsmount.c')
-rw-r--r--nfsmount.c61
1 files changed, 31 insertions, 30 deletions
diff --git a/nfsmount.c b/nfsmount.c
index b5c38212a..d661a99a4 100644
--- a/nfsmount.c
+++ b/nfsmount.c
@@ -54,10 +54,10 @@
54#include <linux/nfs.h> /* For the kernels nfs stuff */ 54#include <linux/nfs.h> /* For the kernels nfs stuff */
55 55
56#ifndef NFS_FHSIZE 56#ifndef NFS_FHSIZE
57#define NFS_FHSIZE 32 57static const int NFS_FHSIZE = 32;
58#endif 58#endif
59#ifndef NFS_PORT 59#ifndef NFS_PORT
60#define NFS_PORT 2049 60static const int NFS_PORT = 2049;
61#endif 61#endif
62 62
63/* Disable the nls stuff */ 63/* Disable the nls stuff */
@@ -68,19 +68,19 @@
68# define _(Text) (Text) 68# define _(Text) (Text)
69# define N_(Text) (Text) 69# define N_(Text) (Text)
70 70
71#define MS_MGC_VAL 0xc0ed0000 /* Magic number indicatng "new" flags */ 71static const int MS_MGC_VAL = 0xc0ed0000; /* Magic number indicatng "new" flags */
72#define MS_RDONLY 1 /* Mount read-only */ 72static const int MS_RDONLY = 1; /* Mount read-only */
73#define MS_NOSUID 2 /* Ignore suid and sgid bits */ 73static const int MS_NOSUID = 2; /* Ignore suid and sgid bits */
74#define MS_NODEV 4 /* Disallow access to device special files */ 74static const int MS_NODEV = 4; /* Disallow access to device special files */
75#define MS_NOEXEC 8 /* Disallow program execution */ 75static const int MS_NOEXEC = 8; /* Disallow program execution */
76#define MS_SYNCHRONOUS 16 /* Writes are synced at once */ 76static const int MS_SYNCHRONOUS = 16; /* Writes are synced at once */
77#define MS_REMOUNT 32 /* Alter flags of a mounted FS */ 77static const int MS_REMOUNT = 32; /* Alter flags of a mounted FS */
78#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */ 78static const int MS_MANDLOCK = 64; /* Allow mandatory locks on an FS */
79#define S_QUOTA 128 /* Quota initialized for file/directory/symlink */ 79static const int S_QUOTA = 128; /* Quota initialized for file/directory/symlink */
80#define S_APPEND 256 /* Append-only file */ 80static const int S_APPEND = 256; /* Append-only file */
81#define S_IMMUTABLE 512 /* Immutable file */ 81static const int S_IMMUTABLE = 512; /* Immutable file */
82#define MS_NOATIME 1024 /* Do not update access times. */ 82static const int MS_NOATIME = 1024; /* Do not update access times. */
83#define MS_NODIRATIME 2048 /* Do not update directory access times */ 83static const int MS_NODIRATIME = 2048; /* Do not update directory access times */
84 84
85 85
86/* 86/*
@@ -93,7 +93,7 @@
93 * so it is easiest to ignore the kernel altogether (at compile time). 93 * so it is easiest to ignore the kernel altogether (at compile time).
94 */ 94 */
95 95
96#define NFS_MOUNT_VERSION 4 96static const int NFS_MOUNT_VERSION = 4;
97 97
98struct nfs2_fh { 98struct nfs2_fh {
99 char data[32]; 99 char data[32];
@@ -125,16 +125,16 @@ struct nfs_mount_data {
125 125
126/* bits in the flags field */ 126/* bits in the flags field */
127 127
128#define NFS_MOUNT_SOFT 0x0001 /* 1 */ 128static const int NFS_MOUNT_SOFT = 0x0001; /* 1 */
129#define NFS_MOUNT_INTR 0x0002 /* 1 */ 129static const int NFS_MOUNT_INTR = 0x0002; /* 1 */
130#define NFS_MOUNT_SECURE 0x0004 /* 1 */ 130static const int NFS_MOUNT_SECURE = 0x0004; /* 1 */
131#define NFS_MOUNT_POSIX 0x0008 /* 1 */ 131static const int NFS_MOUNT_POSIX = 0x0008; /* 1 */
132#define NFS_MOUNT_NOCTO 0x0010 /* 1 */ 132static const int NFS_MOUNT_NOCTO = 0x0010; /* 1 */
133#define NFS_MOUNT_NOAC 0x0020 /* 1 */ 133static const int NFS_MOUNT_NOAC = 0x0020; /* 1 */
134#define NFS_MOUNT_TCP 0x0040 /* 2 */ 134static const int NFS_MOUNT_TCP = 0x0040; /* 2 */
135#define NFS_MOUNT_VER3 0x0080 /* 3 */ 135static const int NFS_MOUNT_VER3 = 0x0080; /* 3 */
136#define NFS_MOUNT_KERBEROS 0x0100 /* 3 */ 136static const int NFS_MOUNT_KERBEROS = 0x0100; /* 3 */
137#define NFS_MOUNT_NONLM 0x0200 /* 3 */ 137static const int NFS_MOUNT_NONLM = 0x0200; /* 3 */
138 138
139 139
140#define UTIL_LINUX_VERSION "2.10m" 140#define UTIL_LINUX_VERSION "2.10m"
@@ -160,14 +160,14 @@ static char *nfs_strerror(int stat);
160#define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r)) 160#define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r))
161#define MAX_NFSPROT ((nfs_mount_version >= 4) ? 3 : 2) 161#define MAX_NFSPROT ((nfs_mount_version >= 4) ? 3 : 2)
162 162
163#define EX_FAIL 32 /* mount failure */ 163static const int EX_FAIL = 32; /* mount failure */
164#define EX_BG 256 /* retry in background (internal only) */ 164static const int EX_BG = 256; /* retry in background (internal only) */
165 165
166 166
167/* 167/*
168 * nfs_mount_version according to the sources seen at compile time. 168 * nfs_mount_version according to the sources seen at compile time.
169 */ 169 */
170int nfs_mount_version = NFS_MOUNT_VERSION; 170static int nfs_mount_version;
171 171
172/* 172/*
173 * Unfortunately, the kernel prints annoying console messages 173 * Unfortunately, the kernel prints annoying console messages
@@ -187,8 +187,9 @@ find_kernel_nfs_mount_version(void) {
187 if (kernel_version) 187 if (kernel_version)
188 return; 188 return;
189 189
190 kernel_version = get_kernel_revision(); 190 nfs_mount_version = NFS_MOUNT_VERSION; /* default */
191 191
192 kernel_version = get_kernel_revision();
192 if (kernel_version) { 193 if (kernel_version) {
193 if (kernel_version < MAKE_VERSION(2,1,32)) 194 if (kernel_version < MAKE_VERSION(2,1,32))
194 nfs_mount_version = 1; 195 nfs_mount_version = 1;