if(rfp->fp_blocked_on != FP_BLOCKED_ON_DOPEN) continue;
printf("dev_up: found process in FP_BLOCKED_ON_DOPEN, fd %d\n",
- rfp->fp_fd >> 8);
- fd_nr = (rfp->fp_fd >> 8);
+ rfp->fp_block_fd);
+ fd_nr = rfp->fp_block_fd;
fp = rfp->fp_filp[fd_nr];
vp = fp->filp_vno;
if (!vp) panic("restart_reopen: no vp");
!(rfp->fp_flags & SUSP_REOPEN)) continue;
printf("restart_reopen: found process in FP_BLOCKED_ON_DOPEN, fd %d\n",
- rfp->fp_fd >> 8);
- fd_nr = (rfp->fp_fd >> 8);
+ rfp->fp_block_fd);
+ fd_nr = rfp->fp_block_fd;
fp = rfp->fp_filp[fd_nr];
if (!fp) {
int fp_ngroups; /* number of supplemental groups */
gid_t fp_sgroups[NGROUPS_MAX];/* supplemental groups */
dev_t fp_tty; /* major/minor of controlling tty */
- int fp_fd; /* place to save fd if rd/wr can't finish */
+ int fp_block_fd; /* place to save fd if rd/wr can't finish */
+ int fp_block_callnr; /* blocked call if rd/wr can't finish */
char *fp_buffer; /* place to save buffer if rd/wr can't finish*/
int fp_nbytes; /* place to save bytes if rd/wr can't finish */
int fp_cum_io_partial; /* partial byte count if rd/wr can't finish */
mess.m_type = OK; /* tell PM that we succeeded */
s = send(PM_PROC_NR, &mess); /* send synchronization message */
- /* All process table entries have been set. Continue with FS initialization.
- * Certain relations must hold for the file system to work at all. Some
- * extra block_size requirements are checked at super-block-read-in time.
- */
- if (OPEN_MAX > 127) panic("OPEN_MAX > 127");
+ /* All process table entries have been set. Continue with initialization. */
/* The following initializations are needed to let dev_opcl succeed .*/
fp = (struct fproc *) NULL;
found_one= TRUE;
who_p = (int)(rp - fproc);
who_e = rp->fp_endpoint;
- call_nr = rp->fp_fd & BYTE;
+ call_nr = rp->fp_block_callnr;
- m_in.fd = (rp->fp_fd >>8) & BYTE;
+ m_in.fd = rp->fp_block_fd;
m_in.buffer = rp->fp_buffer;
m_in.nbytes = rp->fp_nbytes;
/*no longer hanging*/
if (blocked_on == FP_BLOCKED_ON_PIPE)
{
fp= rp;
- fd_nr= (rp->fp_fd >> 8);
+ fd_nr= rp->fp_block_fd;
f= get_filp(fd_nr);
assert(f != NULL);
r= rw_pipe((call_nr == READ) ? READING :
fp->fp_blocked_on = why;
assert(fp->fp_grant == GRANT_INVALID || !GRANT_VALID(fp->fp_grant));
- fp->fp_fd = m_in.fd << 8 | call_nr;
+ fp->fp_block_fd = m_in.fd;
+ fp->fp_block_callnr = call_nr;
fp->fp_flags &= ~SUSP_REOPEN; /* Clear this flag. The caller
* can set it when needed.
*/
susp_count++; /* #procs susp'ed on pipe*/
fp->fp_blocked_on = FP_BLOCKED_ON_PIPE;
assert(!GRANT_VALID(fp->fp_grant));
- fp->fp_fd = (fd_nr << 8) | ((rw_flag == READING) ? READ : WRITE);
+ fp->fp_block_fd = fd_nr;
+ fp->fp_block_callnr = ((rw_flag == READING) ? READ : WRITE);
fp->fp_buffer = buf;
fp->fp_nbytes = size;
}
/* Search the proc table. */
for (rp = &fproc[0]; rp < &fproc[NR_PROCS] && count > 0; rp++) {
if (rp->fp_pid != PID_FREE && fp_is_blocked(rp) &&
- rp->fp_revived == NOT_REVIVING && (rp->fp_fd & BYTE) == call_nr &&
- rp->fp_filp[rp->fp_fd>>8]->filp_vno == vp) {
+ rp->fp_revived == NOT_REVIVING && rp->fp_block_callnr == call_nr &&
+ rp->fp_filp[rp->fp_block_fd]->filp_vno == vp) {
revive(rp->fp_endpoint, 0);
susp_count--; /* keep track of who is suspended */
if(susp_count < 0)
reviving++; /* process was waiting on pipe or lock */
} else if (blocked_on == FP_BLOCKED_ON_DOPEN) {
rfp->fp_blocked_on = FP_BLOCKED_ON_NONE;
- fd_nr = rfp->fp_fd>>8;
+ fd_nr = rfp->fp_block_fd;
if (returned < 0) {
fil_ptr = rfp->fp_filp[fd_nr];
rfp->fp_filp[fd_nr] = NULL;
rfp->fp_blocked_on = FP_BLOCKED_ON_NONE;
if (blocked_on == FP_BLOCKED_ON_POPEN) {
/* process blocked in open or create */
- reply(proc_nr_e, rfp->fp_fd>>8);
+ reply(proc_nr_e, rfp->fp_block_fd);
} else if (blocked_on == FP_BLOCKED_ON_SELECT) {
reply(proc_nr_e, returned);
} else {
break;
}
- fild = (rfp->fp_fd >> 8) & BYTE;/* extract file descriptor */
+ fild = rfp->fp_block_fd;
if (fild < 0 || fild >= OPEN_MAX)
panic("unpause err 2");
f = rfp->fp_filp[fild];
mess.IO_GRANT = (char *) rfp->fp_grant;
/* Tell kernel R or W. Mode is from current call, not open. */
- mess.COUNT = (rfp->fp_fd & BYTE) == READ ? R_BIT : W_BIT;
+ mess.COUNT = rfp->fp_block_callnr == READ ? R_BIT : W_BIT;
mess.m_type = CANCEL;
fp = rfp; /* hack - ctty_io uses fp */
(*dmap[(dev >> MAJOR) & BYTE].dmap_io)(rfp->fp_task, &mess);