kernels/linux-2.4.0/fs/nfs/write.c
/*
 * Set up the argument/result storage required for the RPC call.
 */
Set up the argument/result storage required for the RPC call.
Set up the argument / result storage required for the RPC call .
static void
nfs_write_rpcsetup(struct list_head *head, struct nfs_write_data *data)
{
	struct nfs_page		*req;
	struct iovec		*iov;
	unsigned int		count;
	iov = data->args.iov;
	count = 0;
	while (!list_empty(head)) {
		struct nfs_page *req = nfs_list_entry(head->next);
		nfs_list_remove_request(req);
		nfs_list_add_request(req, &data->pages);
		iov->iov_base = kmap(req->wb_page) + req->wb_offset;
		iov->iov_len = req->wb_bytes;
		count += req->wb_bytes;
		iov++;
		data->args.nriov++;
	}
	req = nfs_list_entry(data->pages.next);
	data->inode = req->wb_inode;
	data->cred = req->wb_cred;
	data->args.fh     = NFS_FH(req->wb_inode);
	data->args.offset = page_offset(req->wb_page) + req->wb_offset;
	data->args.count  = count;
	data->res.fattr   = &data->fattr;
	data->res.count   = count;
	data->res.verf    = &data->verf;
}
static void nfs_write_rpcsetup ( struct list_head * head , struct nfs_write_data * data ) { struct nfs_page * req ; struct iovec * iov ; unsigned int count ; iov = data -> args . iov ; count = 0 ; while ( ! list_empty ( head ) ) { struct nfs_page * req = nfs_list_entry ( head -> next ) ; nfs_list_remove_request ( req ) ; nfs_list_add_request ( req , & data -> pages ) ; iov -> iov_base = kmap ( req -> wb_page ) + req -> wb_offset ; iov -> iov_len = req -> wb_bytes ; count += req -> wb_bytes ; iov ++ ; data -> args . nriov ++ ; } req = nfs_list_entry ( data -> pages . next ) ; data -> inode = req -> wb_inode ; data -> cred = req -> wb_cred ; data -> args . fh = NFS_FH ( req -> wb_inode ) ; data -> args . offset = page_offset ( req -> wb_page ) + req -> wb_offset ; data -> args . count = count ; data -> res . fattr = & data -> fattr ; data -> res . count = count ; data -> res . verf = & data -> verf ; }
Set up the argument/result storage required for the RPC call.
Set up the argument / result storage required for the RPC call .
/* Set up the RPC argument and reply structs
	 * NB: take care not to mess about with data->commit et al. */