From: Thomas Veerman Date: Thu, 6 May 2010 09:32:40 +0000 (+0000) Subject: Small cleanup of dead and/or redundant code. X-Git-Tag: v3.1.7~81 X-Git-Url: http://zhaoyanbai.com/repos/%22/xml/v3/zones/static/named-checkconf.html?a=commitdiff_plain;h=0aceb25535227e68e9cad91080525d78899d371a;p=minix.git Small cleanup of dead and/or redundant code. --- diff --git a/servers/mfs/main.c b/servers/mfs/main.c index 7592e9580..ec3fcb42b 100644 --- a/servers/mfs/main.c +++ b/servers/mfs/main.c @@ -43,11 +43,8 @@ PUBLIC int main(int argc, char *argv[]) error = OK; caller_uid = -1; /* To trap errors */ caller_gid = -1; - - /* This must be a regular VFS request. */ - assert(src == VFS_PROC_NR && !unmountdone); - req_nr = fs_m_in.m_type; + if (req_nr < VFS_BASE) { fs_m_in.m_type += VFS_BASE; req_nr = fs_m_in.m_type; @@ -154,9 +151,9 @@ message *m_in; /* pointer to message */ do { if ((r = sef_receive(ANY, m_in)) != OK) /* wait for message */ panic("sef_receive failed: %d", r); - src = fs_m_in.m_source; + src = m_in->m_source; - if(src == FS_PROC_NR) { + if(src == VFS_PROC_NR) { if(unmountdone) printf("MFS: unmounted: unexpected message from FS\n"); else @@ -166,7 +163,7 @@ message *m_in; /* pointer to message */ printf("MFS: unexpected source %d\n", src); } while(!srcok); - assert((src == FS_PROC_NR && !unmountdone)); + assert((src == VFS_PROC_NR && !unmountdone)); } diff --git a/servers/pfs/inode.c b/servers/pfs/inode.c index 1fa6ed27a..d4092f149 100644 --- a/servers/pfs/inode.c +++ b/servers/pfs/inode.c @@ -10,7 +10,6 @@ * wipe_inode: erase some fields of a newly allocated inode * free_inode: mark an inode as available for a new file * update_times: update atime, ctime, and mtime - * dup_inode: indicate that someone else is using an inode table entry * find_inode: retrieve pointer to inode in inode cache * */ @@ -314,20 +313,6 @@ struct inode *rip; } -/*===========================================================================* - * dup_inode * - *===========================================================================*/ -PUBLIC void dup_inode(ip) -struct inode *ip; /* The inode to be duplicated. */ -{ -/* This routine is a simplified form of get_inode() for the case where - * the inode pointer is already known. - */ - - ip->i_count++; -} - - /*===========================================================================* * update_times * *===========================================================================*/ diff --git a/servers/pfs/main.c b/servers/pfs/main.c index efcb48503..d944089fb 100644 --- a/servers/pfs/main.c +++ b/servers/pfs/main.c @@ -40,9 +40,8 @@ PUBLIC int main(int argc, char *argv[]) error = OK; caller_uid = -1; /* To trap errors */ caller_gid = -1; - - assert(src == VFS_PROC_NR); /* Otherwise this must be VFS talking */ req_nr = fs_m_in.m_type; + if (req_nr < VFS_BASE) { fs_m_in.m_type += VFS_BASE; req_nr = fs_m_in.m_type; @@ -135,15 +134,13 @@ message *m_in; /* pointer to message */ do { if ((r = sef_receive(ANY, m_in)) != OK) /* wait for message */ panic("sef_receive failed: %d", r); - src = fs_m_in.m_source; + src = m_in->m_source; if(src == VFS_PROC_NR) { srcok = 1; /* Normal FS request. */ } else printf("PFS: unexpected source %d\n", src); } while(!srcok); - - assert( src == VFS_PROC_NR ); } diff --git a/servers/pfs/type.h b/servers/pfs/type.h deleted file mode 100644 index 693aecfe9..000000000 --- a/servers/pfs/type.h +++ /dev/null @@ -1,16 +0,0 @@ - -struct buf { - /* Data portion of the buffer. */ - union fsdata_u *bp; - - /* Header portion of the buffer. */ - struct buf *b_next; /* used to link all free bufs in a chain */ - struct buf *b_prev; /* used to link all free bufs the other way */ - struct buf *b_hash; /* used to link bufs on hash chains */ - block_t b_blocknr; /* block number of its (minor) device */ - dev_t b_dev; /* major | minor device where block resides */ - char b_dirt; /* CLEAN or DIRTY */ - char b_count; /* number of users of this buffer */ - int b_bytes; /* Number of bytes allocated in bp */ -}; - diff --git a/servers/vfs/pipe.c b/servers/vfs/pipe.c index 12148c450..15cfdefe1 100644 --- a/servers/vfs/pipe.c +++ b/servers/vfs/pipe.c @@ -69,7 +69,7 @@ PUBLIC int do_pipe() /* Create a named pipe inode on PipeFS */ r = req_newnode(PFS_PROC_NR, fp->fp_effuid, fp->fp_effgid, I_NAMED_PIPE, - (dev_t) 0, &res); + NO_DEV, &res); if (r != OK) { rfp->fp_filp[fil_des[0]] = NIL_FILP;