2 * Copyright 2006, Sine Nomine Associates and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
12 * fileserver state serialization
15 #include <afsconfig.h>
16 #include <afs/param.h>
21 #include <afs/afs_assert.h>
26 #include <afs/afsint.h>
27 #include <afs/rxgen_consts.h>
29 #include <afs/errors.h>
30 #include <afs/ihandle.h>
31 #include <afs/vnode.h>
32 #include <afs/volume.h>
34 #include <afs/ptclient.h>
35 #include <afs/prs_fs.h>
36 #include <afs/afsutil.h>
38 #include <afs/cellconfig.h>
40 #include "../viced/viced_prototypes.h"
41 #include "../viced/viced.h"
42 #include "../viced/host.h"
43 #include "../viced/callback.h"
44 #include "serialize_state.h"
46 #ifdef AFS_DEMAND_ATTACH_FS
52 * in order to make state dump/restore as fast as possible,
53 * we use memory mapped files
55 * if this causes problems on certain platforms, the APIs
56 * have been written so that it will be very simple to go
57 * back to standard I/O for just those poorly written platforms
60 #define FS_STATE_USE_MMAP 1
63 #ifdef FS_STATE_USE_MMAP
64 #define FS_STATE_INIT_FILESIZE (8 * 1024 * 1024) /* truncate to 8MB initially */
70 static int fs_stateCreateDump(struct fs_dump_state * state);
71 static int fs_stateLoadDump(struct fs_dump_state * state);
72 static int fs_stateInvalidateDump(struct fs_dump_state * state);
73 static int fs_stateCommitDump(struct fs_dump_state * state);
74 static int fs_stateCloseDump(struct fs_dump_state * state);
76 #ifdef FS_STATE_USE_MMAP
77 static int fs_stateSizeFile(struct fs_dump_state * state);
78 static int fs_stateResizeFile(struct fs_dump_state * state, size_t min_add);
79 static int fs_stateTruncateFile(struct fs_dump_state * state);
81 static int fs_stateMapFile(struct fs_dump_state * state);
82 static int fs_stateUnmapFile(struct fs_dump_state * state);
84 static int fs_stateIncCursor(struct fs_dump_state * state, size_t len);
85 static int fs_stateCheckIOSafety(struct fs_dump_state * state,
89 static int fs_stateFillHeader(struct fs_state_header * hdr);
90 static int fs_stateCheckHeader(struct fs_state_header * hdr);
92 static int fs_stateAlloc(struct fs_dump_state * state);
93 static int fs_stateFree(struct fs_dump_state * state);
95 extern afsUUID FS_HostUUID;
96 extern char cml_version_number[];
99 fs_stateFileOpen(struct fs_dump_state *state)
102 return(state->fd != -1);
104 return(state->fd >= 0);
111 * save all fileserver state
116 int ret = 0, verified = 1;
117 struct fs_dump_state state;
119 /* save and restore need to be atomic wrt other host package operations */
122 ViceLog(0, ("fs_stateSave: commencing fileserver state dump\n"));
124 if (fs_stateAlloc(&state)) {
125 ViceLog(0, ("fs_stateSave: memory allocation failed; dump aborted\n"));
131 * on busy servers, these checks will inevitably fail since stuff drops H_LOCK
132 * all over the place (with structs left in inconsistent states) while RPCs to
133 * clients happen (grumble, grumble, the host package needs to be rewritten...)
135 * the current hack is to force the background threads that deal with host and
136 * callback state offline early in the shutdown process, do VShutdown, come
137 * back and wait for those threads to die, THEN do the state dump
139 * BUT, this still has one flaw -- what do we do about rx worker threads that
140 * are blocked in the host package making an RPC call to a cm???
142 * perhaps we need a refcounter that keeps track of threads blocked in rpc calls
143 * with H_LOCK dropped (and the host struct likely left in an inconsistent state)
145 * or better yet, we need to associate a state machine with each host object
146 * (kind of like demand attach Volume structures).
148 * sigh. I suspect we'll need to revisit this issue
151 if (fs_state.options.fs_state_verify_before_save) {
152 ViceLog(0, ("fs_stateSave: performing internal consistency checks before proceeding with state dump\n"));
154 if (h_stateVerify(&state)) {
155 ViceLog(0, ("fs_stateSave: error: host table consistency checks failed; state dump will not be marked clean\n"));
160 if (cb_stateVerify(&state)) {
161 ViceLog(0, ("fs_stateSave: error: callback table consistency checks failed; state dump will not be marked clean\n"));
166 /* if a consistency check asserted the bail flag, reset it */
169 ViceLog(0, ("fs_stateSave: proceeding with dump\n"));
172 if (fs_stateCreateDump(&state)) {
173 ViceLog(0, ("fs_stateSave: error: dump create failed\n"));
178 if (h_stateSave(&state)) {
179 ViceLog(0, ("fs_stateSave: error: host state dump failed\n"));
184 if (cb_stateSave(&state)) {
185 ViceLog(0, ("fs_stateSave: error: callback state dump failed\n"));
194 if (fs_stateCommitDump(&state)) {
195 ViceLog(0, ("fs_stateSave: error: dump commit failed\n"));
201 ViceLog(0, ("fs_stateSave: fileserver state dump completed successfully\n"));
203 ViceLog(0, ("fs_stateSave: fileserver state dump completed, but not marked clean.\n"));
204 ViceLog(0, ("fs_stateSave: please save a copy of '%s' for use by technical support\n",
209 if (fs_stateFileOpen(&state))
210 fs_stateCloseDump(&state);
211 fs_stateFree(&state);
218 * restore all fileserver state
220 * this function must appear as one atomic operation to the host and callback
221 * packages, hence H_LOCK is held for the entirety of the process.
224 fs_stateRestore(void)
227 struct fs_dump_state state;
229 /* save and restore need to be atomic wrt other host package operations */
232 ViceLog(0, ("fs_stateRestore: commencing fileserver state restore\n"));
234 if (fs_stateAlloc(&state)) {
235 ViceLog(0, ("fs_stateRestore: memory allocation failed\n"));
240 if (fs_stateLoadDump(&state)) {
241 ViceLog(0, ("fs_stateRestore: failed to load dump file '%s'\n", state.fn));
246 if (fs_stateInvalidateDump(&state)) {
247 ViceLog(0, ("fs_stateRestore: failed to invalidate dump file '%s'\n", state.fn));
253 if (state.flags.do_host_restore) {
254 if (h_stateRestore(&state)) {
255 ViceLog(0, ("fs_stateRestore: error: host state restore failed. exiting avoid further corruption\n"));
258 ViceLog(0, ("fs_stateRestore: host table restored\n"));
260 if (cb_stateRestore(&state)) {
261 ViceLog(0, ("fs_stateRestore: error: callback state restore failed. exiting to avoid further corruption\n"));
264 ViceLog(0, ("fs_stateRestore: FileEntry and CallBack tables restored\n"));
266 if (h_stateRestoreIndices(&state)) {
267 ViceLog(0, ("fs_stateRestore: error: host index remapping failed. exiting to avoid further corruption\n"));
270 ViceLog(0, ("fs_stateRestore: host table indices remapped\n"));
272 if (cb_stateRestoreIndices(&state)) {
273 ViceLog(0, ("fs_stateRestore: error: callback index remapping failed. exiting to avoid further corruption\n"));
276 ViceLog(0, ("fs_stateRestore: FileEntry and CallBack indices remapped\n"));
279 ViceLog(0, ("fs_stateRestore: restore phase complete\n"));
281 if (fs_state.options.fs_state_verify_after_restore) {
282 ViceLog(0, ("fs_stateRestore: beginning state verification phase\n"));
284 if (state.flags.do_host_restore) {
285 if (h_stateVerify(&state)) {
286 ViceLog(0, ("fs_stateRestore: error: host table consistency checks failed; exiting to avoid further corruption\n"));
290 if (cb_stateVerify(&state)) {
291 ViceLog(0, ("fs_stateRestore: error: callback table consistency checks failed; exiting to avoid further corruption\n"));
296 ViceLog(0, ("fs_stateRestore: fileserver state verification complete\n"));
299 ViceLog(0, ("fs_stateRestore: restore was successful\n"));
303 fs_stateInvalidateDump(&state);
304 fs_stateCloseDump(&state);
306 fs_stateFree(&state);
312 fs_stateCreateDump(struct fs_dump_state * state)
315 char savedump[MAXPATHLEN];
316 struct afs_stat status;
318 snprintf(savedump, sizeof(savedump), "%s.old", state->fn);
320 if (afs_stat(state->fn, &status) == 0) {
321 renamefile(state->fn, savedump);
324 if (((fd = afs_open(state->fn,
325 O_RDWR | O_CREAT | O_TRUNC,
326 S_IRUSR | S_IWUSR)) == -1) ||
327 (afs_fstat(fd, &status) == -1)) {
328 ViceLog(0, ("fs_stateCreateDump: failed to create state dump file '%s'\n",
335 state->mode = FS_STATE_DUMP_MODE;
336 memset(state->hdr, 0, sizeof(struct fs_state_header));
337 fs_stateIncEOF(state, sizeof(struct fs_state_header));
339 #ifdef FS_STATE_USE_MMAP
340 if (fs_stateSizeFile(state)) {
341 ViceLog(0, ("fs_stateCreateDump: failed to resize state dump file '%s'\n",
347 if (fs_stateMapFile(state)) {
348 ViceLog(0, ("fs_stateCreateDump: failed to memory map state dump file '%s'\n",
355 ret = fs_stateInvalidateDump(state);
362 fs_stateInvalidateDump(struct fs_dump_state * state)
366 struct fs_state_header hdr;
368 #ifdef FS_STATE_USE_MMAP
369 if (state->mmap.map == NULL) {
374 memcpy(&hdr, state->hdr, sizeof(hdr));
378 /* write a bogus header to flag dump in progress */
379 if (fs_stateWriteHeader(state, &z, &hdr, sizeof(hdr))) {
380 ViceLog(0, ("fs_stateInvalidateDump: failed to invalidate old dump file header '%s'\n",
385 if (fs_stateSync(state)) {
386 ViceLog(0, ("fs_stateInvalidateDump: failed to sync changes to disk\n"));
396 fs_stateCommitDump(struct fs_dump_state * state)
403 #ifdef FS_STATE_USE_MMAP
404 if (fs_stateTruncateFile(state)) {
405 ViceLog(0, ("fs_stateCommitDump: failed to truncate dump file to proper size\n"));
411 /* ensure that all pending data I/Os for the state file have been committed
412 * _before_ we make the metadata I/Os */
413 if (fs_stateSync(state)) {
414 ViceLog(0, ("fs_stateCommitDump: failed to sync changes to disk\n"));
419 #ifdef FS_STATE_USE_MMAP
420 /* XXX madvise may not exist on all platforms, so
421 * we may need to add some ifdefs at some point... */
423 madvise((((char *)state->mmap.map) + sizeof(struct fs_state_header)),
424 state->mmap.size - sizeof(struct fs_state_header),
429 /* build the header, and write it to disk */
430 fs_stateFillHeader(state->hdr);
432 state->hdr->valid = 0;
434 if (fs_stateWriteHeader(state, &z, state->hdr, sizeof(struct fs_state_header))) {
435 ViceLog(0, ("fs_stateCommitDump: failed to write header to dump file '%s'\n",
440 if (fs_stateSync(state)) {
441 ViceLog(0, ("fs_stateCommitDump: failed to sync new header to disk\n"));
451 fs_stateLoadDump(struct fs_dump_state * state)
455 struct afs_stat status;
456 afs_int32 now = FT_ApproxTime();
460 if ((fd = afs_open(state->fn, O_RDWR)) == -1 ||
461 (afs_fstat(fd, &status) == -1)) {
462 ViceLog(0, ("fs_stateLoadDump: failed to load state dump file '%s'\n",
468 state->mode = FS_STATE_LOAD_MODE;
469 state->file_len = status.st_size;
471 #ifdef FS_STATE_USE_MMAP
472 if (fs_stateMapFile(state)) {
473 ViceLog(0, ("fs_stateLoadDump: failed to memory map state dump file '%s'\n",
480 if (fs_stateReadHeader(state, &z, state->hdr, sizeof(struct fs_state_header))) {
481 ViceLog(0, ("fs_stateLoadDump: failed to read header from dump file '%s'\n",
487 /* check the validity of the header */
488 if (fs_stateCheckHeader(state->hdr)) {
489 ViceLog(1, ("fs_stateLoadDump: header failed validity checks; not restoring '%s'\n",
495 if ((state->hdr->timestamp + HOST_STATE_VALID_WINDOW) >= now) {
496 state->flags.do_host_restore = 1;
498 ViceLog(0, ("fs_stateLoadDump: warning: dump is too old for host and callback restore; skipping those steps\n"));
506 fs_stateCloseDump(struct fs_dump_state * state)
508 #ifdef FS_STATE_USE_MMAP
509 fs_stateUnmapFile(state);
516 fs_stateWrite(struct fs_dump_state * state,
517 void * buf, size_t len)
521 #ifdef FS_STATE_USE_MMAP
522 if (fs_stateCheckIOSafety(state, len)) {
523 if (fs_stateResizeFile(state, len)) {
524 ViceLog(0, ("fs_stateWrite: could not resize dump file '%s'\n",
531 memcpy(state->mmap.cursor, buf, len);
532 fs_stateIncCursor(state, len);
534 if (write(state->fd, buf, len) != len) {
535 ViceLog(0, ("fs_stateWrite: write failed\n"));
546 fs_stateRead(struct fs_dump_state * state,
547 void * buf, size_t len)
551 #ifdef FS_STATE_USE_MMAP
552 if (fs_stateCheckIOSafety(state, len)) {
553 ViceLog(0, ("fs_stateRead: read beyond EOF for dump file '%s'\n",
559 memcpy(buf, state->mmap.cursor, len);
560 fs_stateIncCursor(state, len);
562 if (read(state->fd, buf, len) != len) {
563 ViceLog(0, ("fs_stateRead: read failed\n"));
574 fs_stateWriteV(struct fs_dump_state * state,
575 struct iovec * iov, int niov)
580 for (i=0; i < niov; i++) {
581 len += iov[i].iov_len;
584 #ifdef FS_STATE_USE_MMAP
585 if (fs_stateCheckIOSafety(state, len)) {
586 if (fs_stateResizeFile(state, len)) {
587 ViceLog(0, ("fs_stateWrite: could not resize dump file '%s'\n",
594 for (i=0; i < niov; i++) {
595 memcpy(state->mmap.cursor, iov[i].iov_base, iov[i].iov_len);
596 fs_stateIncCursor(state, iov[i].iov_len);
600 if (writev(state->fd, iov, niov) != len) {
601 ViceLog(0, ("fs_stateWriteV: write failed\n"));
605 #else /* AFS_NT40_ENV */
606 for (i=0; i < niov; i++) {
607 if (write(state->fd, iov[i].iov_base, iov[i].iov_len) != iov[i].iov_len) {
608 ViceLog(0, ("fs_stateWriteV: write failed\n"));
613 #endif /* AFS_NT40_ENV */
621 fs_stateReadV(struct fs_dump_state * state,
622 struct iovec * iov, int niov)
627 for (i=0; i < niov; i++) {
628 len += iov[i].iov_len;
631 #ifdef FS_STATE_USE_MMAP
632 if (fs_stateCheckIOSafety(state, len)) {
633 ViceLog(0, ("fs_stateRead: read beyond EOF for dump file '%s'\n",
639 for (i=0; i < niov; i++) {
640 memcpy(iov[i].iov_base, state->mmap.cursor, iov[i].iov_len);
641 fs_stateIncCursor(state, iov[i].iov_len);
645 if (readv(state->fd, iov, niov) != len) {
646 ViceLog(0, ("fs_stateReadV: read failed\n"));
651 for (i=0; i < niov; i++) {
652 if (read(state->fd, iov[i].iov_base, iov[i].iov_len) != iov[i].iov_len) {
653 ViceLog(0, ("fs_stateReadV: read failed\n"));
658 #endif /* AFS_NT40_ENV */
666 fs_stateWriteHeader(struct fs_dump_state * state,
668 void * hdr, size_t len)
672 if (fs_stateSeek(state, offset)) {
673 ViceLog(0, ("fs_stateWriteHeader: could not seek to correct position in dump file '%s'\n",
679 if (fs_stateWrite(state, hdr, len)) {
680 ViceLog(0, ("fs_stateWriteHeader: write failed\n"));
690 fs_stateReadHeader(struct fs_dump_state * state,
692 void * hdr, size_t len)
696 if (fs_stateSeek(state, offset)) {
697 ViceLog(0, ("fs_stateReadHeader: could not seek to correct position in dump file '%s'\n",
703 if (fs_stateRead(state, hdr,len)) {
704 ViceLog(0, ("fs_stateReadHeader: read failed\n"));
713 #ifdef FS_STATE_USE_MMAP
715 fs_stateSizeFile(struct fs_dump_state * state)
718 state->file_len = FS_STATE_INIT_FILESIZE;
719 if (afs_ftruncate(state->fd, state->file_len) != 0)
725 fs_stateResizeFile(struct fs_dump_state * state, size_t min_add)
730 fs_stateUnmapFile(state);
732 inc = ((min_add / FS_STATE_INIT_FILESIZE)+1) * FS_STATE_INIT_FILESIZE;
733 state->file_len += inc;
735 if (afs_ftruncate(state->fd, state->file_len) != 0) {
736 ViceLog(0, ("fs_stateResizeFile: truncate failed\n"));
741 if (fs_stateMapFile(state)) {
742 ViceLog(0, ("fs_stateResizeFile: remapping memory mapped file failed\n"));
752 fs_stateTruncateFile(struct fs_dump_state * state)
756 if (afs_ftruncate(state->fd, state->eof_offset) != 0) {
764 fs_stateMapFile(struct fs_dump_state * state)
768 switch(state->mode) {
769 case FS_STATE_LOAD_MODE:
770 flags = PROT_READ | PROT_WRITE; /* loading involves a header invalidation */
772 case FS_STATE_DUMP_MODE:
776 ViceLog(0, ("fs_stateMapFile: invalid dump state mode\n"));
780 state->mmap.map = afs_mmap(NULL,
787 if (state->mmap.map == MAP_FAILED) {
788 state->mmap.size = 0;
789 state->mmap.map = NULL;
790 ViceLog(0, ("fs_stateMapFile: failed to memory map file '%s'\n",
796 state->mmap.size = state->file_len;
797 state->mmap.cursor = state->mmap.map;
798 state->mmap.offset = 0;
800 /* for state loading, accesses will be sequential, so let's give
801 * the VM subsystem a heads up */
802 if (state->mode == FS_STATE_LOAD_MODE) {
803 /* XXX madvise may not exist on all platforms, so
804 * we may need to add some ifdefs at some point... */
805 flags = MADV_SEQUENTIAL | MADV_WILLNEED;
806 #ifdef AFS_SUN510_ENV
807 flags |= MADV_ACCESS_LWP; /* added in solaris 9 12/02 */
809 madvise(state->mmap.map, state->mmap.size, flags);
817 fs_stateUnmapFile(struct fs_dump_state * state)
821 if (munmap(state->mmap.map, state->mmap.size) == -1) {
822 ViceLog(0, ("fs_stateUnmapFile: failed to unmap dump file '%s'\n",
833 fs_stateSync(struct fs_dump_state * state)
837 msync(state->mmap.map, state->mmap.size, MS_SYNC);
841 #else /* !FS_STATE_USE_MMAP */
843 fs_stateSync(struct fs_dump_state * state)
847 if (fsync(state->fd) == -1)
852 #endif /* !FS_STATE_USE_MMAP */
855 fs_stateIncEOF(struct fs_dump_state * state, afs_int32 len)
858 FillInt64(temp, 0, len);
859 AddUInt64(state->eof_offset, temp, &state->eof_offset);
863 #ifdef FS_STATE_USE_MMAP
865 fs_stateIncCursor(struct fs_dump_state * state, size_t len)
869 state->mmap.offset += len;
871 p = (char *) state->mmap.cursor;
873 state->mmap.cursor = (void *) p;
879 fs_stateCheckIOSafety(struct fs_dump_state * state, size_t len)
883 if ((state->mmap.offset + len) > state->mmap.size) {
888 #endif /* FS_STATE_USE_MMAP */
890 #ifdef FS_STATE_USE_MMAP
892 fs_stateSeek(struct fs_dump_state * state, afs_uint64 * offset)
898 p = (char *) state->mmap.map;
900 state->mmap.cursor = (void *) p;
903 state->mmap.offset = *offset;
907 #else /* !FS_STATE_USE_MMAP */
909 fs_stateSeek(struct fs_dump_state * state, afs_uint64 * offset)
913 if (afs_lseek(state->fd, *offset, SEEK_SET) == -1)
918 #endif /* !FS_STATE_USE_MMAP */
921 fs_stateFillHeader(struct fs_state_header * hdr)
923 hdr->stamp.magic = FS_STATE_MAGIC;
924 hdr->stamp.version = FS_STATE_VERSION;
926 hdr->sys_name = SYS_NAME_ID;
928 hdr->sys_name = 0xFFFFFFFF;
930 hdr->timestamp = FT_ApproxTime();
931 hdr->server_uuid = FS_HostUUID;
933 #ifdef WORDS_BIGENDIAN
938 #ifdef FS_STATS_DETAILED
939 hdr->stats_detailed = 1;
941 hdr->stats_detailed = 0;
943 if (strlcpy(hdr->server_version_string, cml_version_number, sizeof(hdr->server_version_string))
944 >= sizeof(hdr->server_version_string)) {
945 ViceLog(0, ("fs_stateFillHeader: WARNING -- cml_version_number field truncated\n"));
951 fs_stateCheckHeader(struct fs_state_header * hdr)
956 ViceLog(0, ("fs_stateCheckHeader: dump was previously flagged invalid\n"));
959 #ifdef WORDS_BIGENDIAN
960 else if (!hdr->endianness) {
961 ViceLog(0, ("fs_stateCheckHeader: wrong endianness\n"));
964 #else /* AFSLITTLE_ENDIAN */
965 else if (hdr->endianness) {
966 ViceLog(0, ("fs_stateCheckHeader: wrong endianness\n"));
969 #endif /* AFSLITTLE_ENDIAN */
971 else if (hdr->stamp.magic != FS_STATE_MAGIC) {
972 ViceLog(0, ("fs_stateCheckHeader: invalid dump header\n"));
975 else if (hdr->stamp.version != FS_STATE_VERSION) {
976 ViceLog(0, ("fs_stateCheckHeader: unknown dump format version number\n"));
980 #ifdef FS_STATS_DETAILED
981 else if (!hdr->stats_detailed) {
982 ViceLog(0, ("fs_stateCheckHeader: wrong config flags\n"));
985 #else /* FS_STATS_DETAILED */
986 else if (hdr->stats_detailed) {
987 ViceLog(0, ("fs_stateCheckHeader: wrong config flags\n"));
990 #endif /* FS_STATS_DETAILED */
992 else if (!afs_uuid_equal(&hdr->server_uuid, &FS_HostUUID)) {
993 ViceLog(0, ("fs_stateCheckHeader: server UUID does not match this server's UUID\n"));
997 /* the cml_version_string is included for informational purposes only. If someone ever
998 * wants to limit state dump reloading based upon the contents of this string, just
999 * uncomment the following code. uncommenting this code is _strongly discouraged_ because
1000 * we already make use of the version stamps in the various dump headers to deal with
1001 * data structure version incompatabilities.
1002 else if (strncmp(hdr->server_version_string, cml_version_number,
1003 sizeof(hdr->server_version_string)) != 0) {
1004 ViceLog(0, ("fs_stateCheckHeader: dump from different server version\n"));
1009 else if (strncmp(hdr->server_version_string, cml_version_number,
1010 sizeof(hdr->server_version_string)) != 0) {
1011 ViceLog(0, ("fs_stateCheckHeader: dump from different server version ; attempting state reload anyway\n"));
1019 fs_stateAlloc(struct fs_dump_state * state)
1022 memset(state, 0, sizeof(struct fs_dump_state));
1024 state->fn = (char *)AFSDIR_SERVER_FSSTATE_FILEPATH;
1025 state->hdr = (struct fs_state_header *)malloc(sizeof(struct fs_state_header));
1026 state->h_hdr = (struct host_state_header *)malloc(sizeof(struct host_state_header));
1027 state->cb_hdr = (struct callback_state_header *)malloc(sizeof(struct callback_state_header));
1028 state->cb_timeout_hdr = (struct callback_state_timeout_header *)
1029 malloc(sizeof(struct callback_state_timeout_header));
1030 state->cb_fehash_hdr = (struct callback_state_fehash_header *)
1031 malloc(sizeof(struct callback_state_fehash_header));
1032 if ((state->hdr == NULL) || (state->h_hdr == NULL) || (state->cb_hdr == NULL) ||
1033 (state->cb_timeout_hdr == NULL) || (state->cb_fehash_hdr == NULL))
1039 fs_stateFree(struct fs_dump_state * state)
1046 free(state->cb_hdr);
1047 if (state->cb_timeout_hdr)
1048 free(state->cb_timeout_hdr);
1049 if (state->cb_fehash_hdr)
1050 free(state->cb_fehash_hdr);
1051 if (state->h_map.entries)
1052 free(state->h_map.entries);
1053 if (state->fe_map.entries)
1054 free(state->fe_map.entries);
1055 if (state->cb_map.entries)
1056 free(state->cb_map.entries);
1060 #endif /* AFS_DEMAND_ATTACH_FS */