vfs/avfs: req_newdriver should use fs_sendrec

Using sendrec directly only results in problems. While it is not
clear whether using fs_sendrec is the best option, it is at least
an improvement.

Also remove some legacy cruft.
This commit is contained in:
David van Moolenbroek 2011-12-05 10:52:46 +01:00
parent e379e0936e
commit 9221586f37
3 changed files with 7 additions and 41 deletions

View file

@ -125,10 +125,7 @@ PUBLIC int fs_sendrec(endpoint_t fs_e, message *reqmp)
}
}
if (reqmp->m_type == -EENTERMOUNT || reqmp->m_type == -ELEAVEMOUNT ||
reqmp->m_type == -ESYMLINK) {
reqmp->m_type = -reqmp->m_type;
} else if (force_sync != 0 && reqmp->m_type > 0) {
if (force_sync != 0 && reqmp->m_type > 0) {
/* XXX: Keep this as long as we're interested in having support
* for synchronous communication. */
nested_fs_call(reqmp);

View file

@ -1,10 +1,8 @@
/* This file contains the wrapper functions for issueing a request
/* This file contains the wrapper functions for issuing a request
* and receiving response from FS processes.
* Each function builds a request message according to the request
* parameter, calls the most low-level fs_sendrec and copies
* parameter, calls the most low-level fs_sendrec, and copies
* back the response.
* The low-level fs_sendrec handles the recovery mechanism from
* a dead driver and reissues the request.
*/
#include "fs.h"
@ -612,11 +610,6 @@ PUBLIC int req_newdriver(
char *label
)
{
/* Note: this is the only request function that doesn't use the
* fs_sendrec internal routine, since we want to avoid the dead
* driver recovery mechanism here. This function is actually called
* during the recovery.
*/
cp_grant_id_t grant_id;
size_t len;
message m;
@ -635,11 +628,7 @@ PUBLIC int req_newdriver(
m.REQ_PATH_LEN = len;
/* Issue request */
if((r = sendrec(fs_e, &m)) != OK) {
printf("%s:%d VFS req_newdriver: error sending message %d to %d\n",
__FILE__, __LINE__, r, fs_e);
util_stacktrace();
}
r = fs_sendrec(fs_e, &m);
cpf_revoke(grant_id);
@ -647,7 +636,6 @@ PUBLIC int req_newdriver(
}
/*===========================================================================*
* req_putnode *
*===========================================================================*/

View file

@ -1,10 +1,8 @@
/* This file contains the wrapper functions for issueing a request
/* This file contains the wrapper functions for issuing a request
* and receiving response from FS processes.
* Each function builds a request message according to the request
* parameter, calls the most low-level fs_sendrec and copies
* parameter, calls the most low-level fs_sendrec, and copies
* back the response.
* The low-level fs_sendrec handles the recovery mechanism from
* a dead driver and reissues the request.
*/
#include "fs.h"
@ -614,11 +612,6 @@ PUBLIC int req_newdriver(
char *label
)
{
/* Note: this is the only request function that doesn't use the
* fs_sendrec internal routine, since we want to avoid the dead
* driver recovery mechanism here. This function is actually called
* during the recovery.
*/
cp_grant_id_t grant_id;
size_t len;
message m;
@ -637,11 +630,7 @@ PUBLIC int req_newdriver(
m.REQ_PATH_LEN = len;
/* Issue request */
if((r = sendrec(fs_e, &m)) != OK) {
printf("%s:%d VFS req_newdriver: error sending message %d to %d\n",
__FILE__, __LINE__, r, fs_e);
util_stacktrace();
}
r = fs_sendrec(fs_e, &m);
cpf_revoke(grant_id);
@ -649,7 +638,6 @@ PUBLIC int req_newdriver(
}
/*===========================================================================*
* req_putnode *
*===========================================================================*/
@ -1150,13 +1138,6 @@ PRIVATE int fs_sendrec_f(char *file, int line, endpoint_t fs_e, message *reqm)
if (reqm->m_type <= 0)
break; /* Reply */
if (reqm->m_type == -EENTERMOUNT || reqm->m_type == -ELEAVEMOUNT ||
reqm->m_type == -ESYMLINK) {
reqm->m_type = -reqm->m_type;
break; /* Reply */
}
/* Request */
nested_fs_call(reqm);
}