NFS_FILE_DIRECT_READ

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

 

NAME

nfs_file_direct_read - file direct read operation for NFS files  

SYNOPSIS

"SYNOPSIS"

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

ARGUMENTS

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

COUNT

number of bytes to read  

POS

byte offset in file where reading starts

We use this function for direct reads instead of calling generic_file_aio_read in order to avoid gfar's check to see if the request starts before the end of the file. For that check to work, we must generate a GETATTR before each direct read, and even then there is a window between the GETATTR and the subsequent READ where the file size could change. So our preference is simply to do all reads the application wants, and the server will take care of managing the end of file boundary.

This function also eliminates unnecessarily updating the file's atime locally, as the NFS server sets the file's atime, and this client must read the updated atime from the server back into its cache.


 

Index

NAME
SYNOPSIS
ARGUMENTS
COUNT
POS

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