From: Thomas Veerman Date: Mon, 22 Aug 2011 16:24:29 +0000 (+0000) Subject: Store and use max concurrent requests X-Git-Tag: v3.2.0~334 X-Git-Url: http://zhaoyanbai.com/repos/man.named-checkzone.html?a=commitdiff_plain;h=30be0177628a3f8047d51876dfc27ed2133f6fac;p=minix.git Store and use max concurrent requests --- diff --git a/servers/avfs/mount.c b/servers/avfs/mount.c index bc730fd2e..46914724e 100644 --- a/servers/avfs/mount.c +++ b/servers/avfs/mount.c @@ -172,7 +172,7 @@ int rdonly, char mount_label[LABEL_MAX] ) { int rdir, mdir; /* TRUE iff {root|mount} file is dir */ - int i, r = OK, found, isroot, mount_root; + int i, r = OK, found, isroot, mount_root, con_reqs; struct fproc *tfp; struct dmap *dp; struct vnode *root_node, *vp = NULL, *bspec; @@ -260,10 +260,8 @@ char mount_label[LABEL_MAX] ) else new_vmp->m_flags &= ~VMNT_READONLY; /* Tell FS which device to mount */ - if (verbose) - printf("Tell FS %d to mount device %s %d\n", fs_e, label, dev); - if ((r = req_readsuper(fs_e, label, dev, rdonly, isroot, &res)) != OK) { - if (verbose) printf("Failed: %d\n", r); + r = req_readsuper(fs_e, label, dev, rdonly, isroot, &res, &con_reqs); + if (r != OK) { if (vp != NULL) { unlock_vnode(vp); put_vnode(vp); @@ -274,7 +272,6 @@ char mount_label[LABEL_MAX] ) unlock_vmnt(new_vmp); return(r); } - if (verbose) printf("Ok done: r=%d\n", r); /* Fill in root node's fields */ root_node->v_fs_e = res.fs_e; @@ -290,6 +287,11 @@ char mount_label[LABEL_MAX] ) /* Root node is indeed on the partition */ root_node->v_vmnt = new_vmp; root_node->v_dev = new_vmp->m_dev; + if (con_reqs == 0) + new_vmp->m_comm.c_max_reqs = 1; /* Default if FS doesn't tell us */ + else + new_vmp->m_comm.c_max_reqs = con_reqs; + new_vmp->m_comm.c_cur_reqs = 0; lock_bsf(); @@ -454,7 +456,7 @@ PUBLIC int unmount( if (is_vnode_locked(vp)) locks++; } - if (count > 1 || locks > 1) { + if (count > 1 || locks > 1 || tll_haspendinglock(&vmp->m_lock)) { unlock_vmnt(vmp); return(EBUSY); /* can't umount a busy file system */ } diff --git a/servers/avfs/proto.h b/servers/avfs/proto.h index 0fa5761bd..f7da182ec 100644 --- a/servers/avfs/proto.h +++ b/servers/avfs/proto.h @@ -252,7 +252,8 @@ _PROTOTYPE( int req_rdlink, (endpoint_t fs_e, ino_t inode_nr, int direct) ); _PROTOTYPE( int req_readsuper, (endpoint_t fs_e, char *driver_name, dev_t dev, int readonly, int isroot, - struct node_details *res_nodep) ); + struct node_details *res_nodep, + int *con_reqs) ); _PROTOTYPE( int req_readwrite, (endpoint_t fs_e, ino_t inode_nr, u64_t pos, int rw_flag, endpoint_t user_e, char *user_addr, diff --git a/servers/avfs/request.c b/servers/avfs/request.c index 6f31777a0..233601777 100644 --- a/servers/avfs/request.c +++ b/servers/avfs/request.c @@ -707,7 +707,8 @@ PUBLIC int req_readsuper( dev_t dev, int readonly, int isroot, - struct node_details *res_nodep + struct node_details *res_nodep, + int *con_reqs ) { int r; @@ -741,6 +742,7 @@ PUBLIC int req_readsuper( res_nodep->fsize = m.RES_FILE_SIZE_LO; res_nodep->uid = m.RES_UID; res_nodep->gid = m.RES_GID; + *con_reqs = m.RES_CONREQS; } return(r);