It's very simple "camila j" ... you should look to the request.c file you'll see functions like:
/*===========================================================================*
* req_breadwrite *
*===========================================================================*/
int req_breadwrite(
endpoint_t fs_e,
endpoint_t user_e,
dev_t dev,
u64_t pos,
unsigned int num_of_bytes,
char *user_addr,
int rw_flag,
u64_t *new_posp,
unsigned int *cum_iop
)
{
int r;
cp_grant_id_t grant_id;
message m;
grant_id = cpf_grant_magic(fs_e, user_e, (vir_bytes) user_addr, num_of_bytes,
(rw_flag == READING ? CPF_WRITE : CPF_READ));
if(grant_id == -1)
panic("req_breadwrite: cpf_grant_magic failed");
/* Fill in request message */
m.m_type = rw_flag == READING ? REQ_BREAD : REQ_BWRITE;
m.REQ_DEV2 = dev;
m.REQ_GRANT = grant_id;
m.REQ_SEEK_POS_LO = ex64lo(pos);
m.REQ_SEEK_POS_HI = ex64hi(pos);
m.REQ_NBYTES = num_of_bytes;
/* Send/rec request */
r = fs_sendrec(fs_e, &m);
cpf_revoke(grant_id);
if (r != OK) return(r);
/* Fill in response structure */
*new_posp = make64(m.RES_SEEK_POS_LO, m.RES_SEEK_POS_HI);
*cum_iop = m.RES_NBYTES;
return(OK);
}
,,,
all you have to do , is understand how the servers comunicate, like, what kind of parameters they use in commom,,,
hint: you may need to search the message struct and see how it works... once you find it, you need to add a new type of message...
so...after creating your own request function in this file, go to the misc.c where you can place a call to this function...
Lets say u want to find a very important information for a file that only stands in mfs, like the inode struct... add your function on vfs and search about the filp functions... you'll that
there is a cool way to get the vnode,,, then pass to your request function whatever data you need in the other server... simple use a sendrec to complete this...
in the other server , just grab it with its only "in" message struct... i think its something like fs_in ,,, well search in the other functions on the misc.c file,,, they probably use it... good lucky "camila".