| 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 | * Inode information required for HPUX servers and salvager. |
| 12 | */ |
| 13 | #ifndef _OSI_INODE_H_ |
| 14 | #define _OSI_INODE_H_ |
| 15 | |
| 16 | #define BAD_IGET -1000 |
| 17 | |
| 18 | #define VICEMAGIC 0x84fa1cb6 |
| 19 | |
| 20 | /* These exist because HP requires more work to extract uid. */ |
| 21 | #define DI_VICEP3(p) ( *(int32_t *) &((p)->di_ic.ic_uid_msb) ) |
| 22 | #define I_VICE3(p) ( *(int32_t *)( &((p)->i_icun.i_ic.ic_uid_msb) ) ) |
| 23 | |
| 24 | #define _GET_DC_UID(DC) ((uid_t)((DC).ic_uid_msb << 16 | (DC).ic_uid_lsb)) |
| 25 | #define _GET_D_UID(DP) _GET_DC_UID((DP)->di_ic) |
| 26 | |
| 27 | /* the VICEMAGIC field is moved to ic_flags. This is because VICEMAGIC |
| 28 | ** happens to set the LARGEUID bit in the ic_flags field. UFS interprets |
| 29 | ** this as an inode which supports large uid's, hence does not do any UID |
| 30 | ** length conversion on the fly. We use the uid fields to store i_vicep3. |
| 31 | */ |
| 32 | #define i_vicemagic i_icun.i_ic.ic_flags |
| 33 | #define i_vicep1 i_icun.i_ic.ic_spare[0] |
| 34 | #define i_vicep2 i_icun.i_ic.ic_spare[1] |
| 35 | #define i_vicep4 i_icun.i_ic.ic_gen |
| 36 | #define i_vicep3 ( *(int32_t *)( &(i_icun.i_ic.ic_uid_msb) ) ) |
| 37 | |
| 38 | #define di_vicemagic di_ic.ic_flags |
| 39 | #define di_vicep1 di_ic.ic_spare[0] |
| 40 | #define di_vicep2 di_ic.ic_spare[1] |
| 41 | #define di_vicep4 di_ic.ic_gen |
| 42 | #define di_vicep3 ( *(int32_t *)( &(di_ic.ic_uid_msb) ) ) |
| 43 | |
| 44 | #define IS_VICEMAGIC(ip) ((ip)->i_vicemagic == VICEMAGIC ? 1 : 0) |
| 45 | #define IS_DVICEMAGIC(dp) ((dp)->di_vicemagic == VICEMAGIC ? 1 : 0) |
| 46 | |
| 47 | #define CLEAR_VICEMAGIC(ip) (ip)->i_vicemagic = 0 |
| 48 | #define CLEAR_DVICEMAGIC(dp) (dp)->di_vicemagic = 0 |
| 49 | |
| 50 | struct inode *igetinode(struct vfs *vfsp, dev_t dev, ino_t inode, |
| 51 | int *perror); |
| 52 | |
| 53 | #endif /* _OSI_INODE_H_ */ |