2 * Copyright (c) 1995 - 2007 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * Include file for whole arlad
52 #if defined(HAVE_DIRENT_H)
54 #if DIRENT_AND_SYS_DIR_H
56 /* <sys/dir.h> is for DIRSIZ macro, freebsd uses _GENERIC_DIRSIZ */
60 #elif defined(HAVE_SYS_DIR_H)
64 #include <sys/types.h>
65 #ifdef HAVE_LINUX_TYPES_H
66 #include <linux/types.h>
68 #include <sys/param.h>
69 #include <sys/socket.h>
71 #ifdef HAVE_SYS_MMAN_H
74 #ifdef HAVE_SYS_IOCCOM_H
75 #include <sys/ioccom.h>
77 #ifdef HAVE_SYS_STAT_H
80 #ifdef HAVE_SYS_MOUNT_H
81 #include <sys/mount.h>
83 #ifdef HAVE_SYS_PRCTL_H
84 #include <sys/prctl.h>
86 #ifdef HAVE_SYS_IOCTL_H
87 #include <sys/ioctl.h>
89 #include <netinet/in.h>
90 #include <arpa/inet.h>
95 #include <parse_units.h>
102 #include <rx/rx_null.h>
105 #include <openssl/des.h>
113 #include <arla-pioctl.h>
128 #include "volcache.h"
150 #include "messages.h"
151 #include "fs_errors.h"
155 #include "afs_uuid.h"
157 enum connected_mode
{ CONNECTED
= 0,
162 extern enum connected_mode connected_mode
;
166 #define assert_flag(e,f) assert((e)->flags.f)
167 #define assert_not_flag(e,f) assert(!(e)->flags.f)
169 /* for asserts normally disabled */
171 #define arla_debug_assert(x) assert(x)
173 #define arla_debug_assert(x) do { ; } while (0)
176 #define SYSNAMEMAXLEN 2048
177 extern char **sysnamelist
;
178 extern int sysnamenum
;
181 #define ARLA_NUMCONNS 200
182 #define ARLA_HIGH_VNODES 4000
183 #define ARLA_LOW_VNODES 3000
184 #define ARLA_HIGH_BYTES 40000000
185 #define ARLA_LOW_BYTES 30000000
186 #define ARLA_NUMCREDS 200
187 #define ARLA_NUMVOLS 100
189 /* Block size should be a power of 2. */
190 #ifdef BLOCKS_PARANOIA
191 #define ARLA_BLOCKSIZE 8192
193 #define ARLA_BLOCKSIZE 131072
197 * This should be a not used uid in the system,
198 * NNPFS_ANONYMOUSID may be good
201 #define ARLA_NO_AUTH_CRED 4
204 extern char *default_log_file
;
205 extern char *default_arla_cachedir
;
207 extern int fork_flag
; /* if the program should fork */
208 extern int num_workers
; /* number of workers program should use */
209 extern int client_port
; /* what port the client is using */
210 extern int afs_BusyWaitPeriod
; /* number of sec to wait on fs when VBUSY */
211 extern int use_o_largefile
; /* turns off largefile cache if set to 0 */
220 get_default_cache_dir (void);
227 #define O_LARGEFILE 0
230 extern const char *conf_file
;
231 extern char *log_file
;
232 extern char *debug_levels
;
233 extern char *connected_mode_string
;
235 extern const char *rxkad_level_string
;
237 extern const char *argv_sysname
;
238 extern char *root_volume
;
239 extern int cpu_usage
;
240 extern int version_flag
;
241 extern int help_flag
;
243 extern int dynroot_enable
;
244 extern int cm_consistency
;
245 extern int fake_stat
;
246 extern uint64_t fetch_block_size
;
248 extern char *cache_dir
;
249 extern char *trace_file
;