nfs_end_data_update_defer(inode); 
nfs_end_data_update(inode); 
static ssize_t nfs_direct_write_seg(struct inode *inode,		struct nfs_open_context *ctx, unsigned long user_addr,		size_t count, loff_t file_offset, struct page **pages,		int nr_pages){	const unsigned int wsize = NFS_SERVER(inode)->wsize;	size_t request;	int curpage, need_commit;	ssize_t result, tot_bytes;	struct nfs_writeverf first_verf;	struct nfs_write_data *wdata;	wdata = nfs_writedata_alloc();	if (!wdata)		return -ENOMEM;	wdata->inode = inode;	wdata->cred = ctx->cred;	wdata->args.fh = NFS_FH(inode);	wdata->args.context = ctx;	wdata->args.stable = NFS_UNSTABLE;	if (IS_SYNC(inode) || NFS_PROTO(inode)->version == 2 || count <= wsize)		wdata->args.stable = NFS_FILE_SYNC;	wdata->res.fattr = &wdata->fattr;	wdata->res.verf = &wdata->verf;	nfs_begin_data_update(inode);retry:	need_commit = 0;	tot_bytes = 0;	curpage = 0;	request = count;	wdata->args.pgbase = user_addr & ~PAGE_MASK;	wdata->args.offset = file_offset;	do {		wdata->args.count = request;		if (wdata->args.count > wsize)			wdata->args.count = wsize;		wdata->args.pages = &pages[curpage];		dprintk("NFS: direct write: c=%u o=%Ld ua=%lu, pb=%u, cp=%u\n",			wdata->args.count, (long long) wdata->args.offset,			user_addr + tot_bytes, wdata->args.pgbase, curpage);		lock_kernel();		result = NFS_PROTO(inode)->write(wdata);		unlock_kernel();		if (result <= 0) {			if (tot_bytes > 0)				break;			goto out;		}		if (tot_bytes == 0)			memcpy(&first_verf.verifier, &wdata->verf.verifier,						sizeof(first_verf.verifier));		if (wdata->verf.committed != NFS_FILE_SYNC) {			need_commit = 1;			if (memcmp(&first_verf.verifier, &wdata->verf.verifier,					sizeof(first_verf.verifier)));				goto sync_retry;		}		tot_bytes += result;		/* in case of a short write: stop now, let the app recover */		if (result < wdata->args.count)			break;		wdata->args.offset += result;		wdata->args.pgbase += result;		curpage += wdata->args.pgbase >> PAGE_SHIFT;		wdata->args.pgbase &= ~PAGE_MASK;		request -= result;	} while (request != 0);	/*	 * Commit data written so far, even in the event of an error	 */	if (need_commit) {		wdata->args.count = tot_bytes;		wdata->args.offset = file_offset;		lock_kernel();		result = NFS_PROTO(inode)->commit(wdata);		unlock_kernel();		if (result < 0 || memcmp(&first_verf.verifier,					 &wdata->verf.verifier,					 sizeof(first_verf.verifier)) != 0)			goto sync_retry;	}	result = tot_bytes;out:	nfs_end_data_update_defer(inode);	nfs_writedata_free(wdata);	return result;sync_retry:	wdata->args.stable = NFS_FILE_SYNC;	goto retry;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/951a143b3fcf15cfa9d38250b7462f821db241db/direct.c/buggy/fs/nfs/direct.c