1: /* 2: * Definitions of inline expansions used for speed, 3: * and replacements for them if UNFAST is defined. 4: */ 5: 6: #ifndef UNFAST 7: 8: #define plock(ip) \ 9: { \ 10: while ((ip)->i_flag & ILOCK) { \ 11: (ip)->i_flag |= IWANT; \ 12: sleep((caddr_t)(ip), PINOD); \ 13: } \ 14: (ip)->i_flag |= ILOCK; \ 15: } 16: 17: #define prele(ip) \ 18: { \ 19: (ip)->i_flag &= ~ILOCK; \ 20: if ((ip)->i_flag&IWANT) { \ 21: (ip)->i_flag &= ~IWANT; \ 22: wakeup((caddr_t)(ip)); \ 23: } \ 24: } 25: 26: /* 27: * The GETF macro is used in a conditional, e.g. 28: * if (GETF(fp,fd)) { 29: * u.u_error = EBADF; 30: * return; 31: * } 32: */ 33: #define GETF(fp, fd) \ 34: ((unsigned)(fd) >= NOFILE || ((fp) = u.u_ofile[fd]) == NULL) 35: 36: #ifdef UCB_FSFIX 37: #define IUPDAT(ip, t1, t2, waitfor) { \ 38: if (ip->i_flag&(IUPD|IACC|ICHG)) \ 39: iupdat(ip, t1, t2, waitfor); \ 40: } 41: #else 42: #define IUPDAT(ip, t1, t2) { \ 43: if (ip->i_flag&(IUPD|IACC|ICHG)) \ 44: iupdat(ip, t1, t2); \ 45: } 46: #endif UCB_FSFIX 47: 48: #ifndef MENLO_JCL 49: #define ISSIG(p) ((p)->p_sig && issig()) 50: #endif MENLO_JCL 51: 52: #else UNFAST 53: 54: #ifdef UCB_FSFIX 55: #define IUPDAT(ip, t1, t2, waitfor) iupdat(ip, t1, t2, waitfor) 56: #else 57: #define IUPDAT(ip, t1, t2) iupdat(ip, t1, t2) 58: #endif UCB_FSFIX 59: 60: #ifndef MENLO_JCL 61: #define ISSIG(p) issig(p) 62: #endif 63: 64: #endif UNFAST 65: 66: /* 67: * Other macros that are always used, or replace null routines. 68: */ 69: 70: #ifdef MENLO_JCL 71: #define ISSIG(p) ((p)->p_sig && \ 72: ((p)->p_flag&STRC || ((p)->p_sig & ~(p)->p_ignsig)) && issig()) 73: #endif 74: 75: #ifndef INTRLVE 76: #define dkblock(bp) ((bp)->b_blkno) 77: #define dkunit(bp) ((minor((bp)->b_dev) >> 3) & 07) 78: #endif INTRLVE