| File: | afs/FBSD/osi_misc.c |
| Location: | line 34, column 5 |
| Description: | Value stored to 'flags' is never read |
| 1 | /* |
| 2 | * Copyright 2000, International Business Machines Corporation and others. |
| 3 | * All Rights Reserved. |
| 4 | * |
| 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 |
| 8 | */ |
| 9 | |
| 10 | /* |
| 11 | * osi_misc.c |
| 12 | * |
| 13 | */ |
| 14 | |
| 15 | #include <afsconfig.h> |
| 16 | #include "afs/param.h" |
| 17 | |
| 18 | |
| 19 | #include "afs/sysincludes.h" /* Standard vendor system headers */ |
| 20 | #include "afsincludes.h" /* Afs-based standard headers */ |
| 21 | #include <sys/namei.h> |
| 22 | |
| 23 | int |
| 24 | osi_lookupname(char *aname, enum uio_seg seg, int followlink, |
| 25 | struct vnode **vpp) |
| 26 | { |
| 27 | struct nameidata n; |
| 28 | int flags, error, glocked; |
| 29 | |
| 30 | glocked = ISAFS_GLOCK()((((&afs_global_mtx)->mtx_lock & ~(0x00000001 | 0x00000002 | 0x00000004)) == (uintptr_t)(__curthread()))); |
| 31 | if (glocked) |
| 32 | AFS_GUNLOCK()do { (void)0; _mtx_unlock_flags(((&afs_global_mtx)), (0), "/home/wollman/openafs/src/afs/FBSD/osi_misc.c", 32); } while (0); |
| 33 | |
| 34 | flags = 0; |
Value stored to 'flags' is never read | |
| 35 | flags = LOCKLEAF0x0004; |
| 36 | if (followlink) |
| 37 | flags |= FOLLOW0x0040; |
| 38 | else |
| 39 | flags |= NOFOLLOW0x0000; |
| 40 | flags |= MPSAFE0x01000000; /* namei must take Giant if needed */ |
| 41 | NDINIT(&n, LOOKUP, flags, seg, aname, curthread)NDINIT_ALL(&n, 0, flags, seg, aname, -100, ((void *)0), ( __curthread())); |
| 42 | if ((error = namei(&n)) != 0) { |
| 43 | if (glocked) |
| 44 | AFS_GLOCK()do { (void)0; _mtx_lock_flags(((&afs_global_mtx)), (0), "/home/wollman/openafs/src/afs/FBSD/osi_misc.c" , 44); (void)0; } while (0); |
| 45 | return error; |
| 46 | } |
| 47 | *vpp = n.ni_vp; |
| 48 | /* XXX should we do this? Usually NOT (matt) */ |
| 49 | #if defined(AFS_FBSD80_ENV1) |
| 50 | /*VOP_UNLOCK(n.ni_vp, 0);*/ |
| 51 | #else |
| 52 | VOP_UNLOCK(n.ni_vp, 0, curthread(__curthread())); |
| 53 | #endif |
| 54 | NDFREE(&n, NDF_ONLY_PNBUF(~0x00000020)); |
| 55 | if (glocked) |
| 56 | AFS_GLOCK()do { (void)0; _mtx_lock_flags(((&afs_global_mtx)), (0), "/home/wollman/openafs/src/afs/FBSD/osi_misc.c" , 56); (void)0; } while (0); |
| 57 | return 0; |
| 58 | } |
| 59 | |
| 60 | /* |
| 61 | * does not implement security features of kern_time.c:settime() |
| 62 | */ |
| 63 | void |
| 64 | afs_osi_SetTime(osi_timeval_t * atv) |
| 65 | { |
| 66 | printf("afs attempted to set clock; use \"afsd -nosettime\"\n"); |
| 67 | } |
| 68 | |
| 69 | /* |
| 70 | * Replace all of the bogus special-purpose memory allocators... |
| 71 | */ |
| 72 | void * |
| 73 | osi_fbsd_alloc(size_t size, int dropglobal) |
| 74 | { |
| 75 | void *rv; |
| 76 | int glocked; |
| 77 | |
| 78 | if (dropglobal) { |
| 79 | glocked = ISAFS_GLOCK()((((&afs_global_mtx)->mtx_lock & ~(0x00000001 | 0x00000002 | 0x00000004)) == (uintptr_t)(__curthread()))); |
| 80 | if (glocked) |
| 81 | AFS_GUNLOCK()do { (void)0; _mtx_unlock_flags(((&afs_global_mtx)), (0), "/home/wollman/openafs/src/afs/FBSD/osi_misc.c", 81); } while (0); |
| 82 | rv = malloc(size, M_AFS, M_WAITOK0x0002); |
| 83 | if (glocked) |
| 84 | AFS_GLOCK()do { (void)0; _mtx_lock_flags(((&afs_global_mtx)), (0), "/home/wollman/openafs/src/afs/FBSD/osi_misc.c" , 84); (void)0; } while (0); |
| 85 | } else |
| 86 | rv = malloc(size, M_AFS, M_NOWAIT0x0001); |
| 87 | |
| 88 | return (rv); |
| 89 | } |
| 90 | |
| 91 | void |
| 92 | osi_fbsd_free(void *p) |
| 93 | { |
| 94 | free(p, M_AFS); |
| 95 | } |