NFS_FILE_DIRECT_WRITE

Section: (9)
Updated: 09 October 2005
Index Return to Main Contents

 

NAME

nfs_file_direct_write - file direct write operation for NFS files  

SYNOPSIS

"SYNOPSIS"

ssize_t nfs_file_direct_write (struct kiocb * iocb, const char __user * buf, size_t count, loff_t pos);  

ARGUMENTS

iocb
target I/O control block
buf
user's buffer from which to write data
count
-- undescribed --
pos
-- undescribed --
 

COUNT

number of bytes to write  

POS

byte offset in file where writing starts

We use this function for direct writes instead of calling generic_file_aio_write in order to avoid taking the inode semaphore and updating the i_size. The NFS server will set the new i_size and this client must read the updated size back into its cache. We let the server do generic write parameter checking and report problems.

We also avoid an unnecessary invocation of generic_osync_inode, as it is fairly meaningless to sync the metadata of an NFS file.

We eliminate local atime updates, see direct read above.

We avoid unnecessary page cache invalidations for normal cached readers of this file.

Note that O_APPEND is not supported for NFS direct writes, as there is no atomic O_APPEND write facility in the NFS protocol.


 

Index

NAME
SYNOPSIS
ARGUMENTS
COUNT
POS

This document was created by man2html, using the manual pages.
Time: 00:02:32 GMT, October 09, 2005