release/src/linux/linux/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_commit_rpcsetup(struct list_head *head, struct nfs_write_data *data)
{
	struct nfs_page		*first, *last;
	struct inode		*inode;
	loff_t			start, end, len;
	list_splice(head, &data->pages);
	INIT_LIST_HEAD(head);
	first = nfs_list_entry(data->pages.next);
	last = nfs_list_entry(data->pages.prev);
	inode = first->wb_inode;
	start = page_offset(first->wb_page) + first->wb_offset;
	end = page_offset(last->wb_page) + (last->wb_offset + last->wb_bytes);
	len = end - start;
	if (end >= inode->i_size || len < 0 || len > (~((u32)0) >> 1))
		len = 0;
	data->inode	  = inode;
	data->cred	  = first->wb_cred;
	data->args.fh     = NFS_FH(inode);
	data->args.offset = start;
	data->res.count   = data->args.count = (u32)len;
	data->res.fattr   = &data->fattr;
	data->res.verf    = &data->verf;
}
static void nfs_commit_rpcsetup ( struct list_head * head , struct nfs_write_data * data ) { struct nfs_page * first , * last ; struct inode * inode ; loff_t start , end , len ; list_splice ( head , & data -> pages ) ; INIT_LIST_HEAD ( head ) ; first = nfs_list_entry ( data -> pages . next ) ; last = nfs_list_entry ( data -> pages . prev ) ; inode = first -> wb_inode ; start = page_offset ( first -> wb_page ) + first -> wb_offset ; end = page_offset ( last -> wb_page ) + ( last -> wb_offset + last -> wb_bytes ) ; len = end - start ; if ( end >= inode -> i_size || len < 0 || len > ( ~ ( ( u32 ) 0 ) >> 1 ) ) len = 0 ; data -> inode = inode ; data -> cred = first -> wb_cred ; data -> args . fh = NFS_FH ( inode ) ; data -> args . offset = start ; data -> res . count = data -> args . count = ( u32 ) len ; data -> res . fattr = & data -> fattr ; 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. */ /*
	 * Determine the offset range of requests in the COMMIT call.
	 * We rely on the fact that data->pages is an ordered list...
	 */ /* If 'len' is not a 32-bit quantity, pass '0' in the COMMIT call */