.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "SYSFS_READ_FILE" "" "06 October 2005" "" ""
.SH NAME
sysfs_read_file \- read an attribute.
.SH SYNOPSIS
"SYNOPSIS"
.sp
\fB
.sp
ssize_t sysfs_read_file (struct file * \fIfile\fB, char __user * \fIbuf\fB, size_t \fIcount\fB, loff_t * \fIppos\fB);
\fR
.SH "ARGUMENTS"
.TP
\fB\fIfile\fB\fR
file pointer.
.TP
\fB\fIbuf\fB\fR
buffer to fill.
.TP
\fB\fIcount\fB\fR
number of bytes to read.
.TP
\fB\fIppos\fB\fR
starting offset in file.
.SH "DESCRIPTION"
.PP
Userspace wants to read an attribute file. The attribute descriptor
is in the file's ->d_fsdata. The target object is in the directory's
->d_fsdata.
.PP
We call \fBfill_read_buffer\fR to allocate and fill the buffer from the
object's \fBshow\fR method exactly once (if the read is happening from
the beginning of the file). That should fill the entire buffer with
all the data the object has to offer for that attribute.
We then call \fBflush_read_buffer\fR to copy the buffer to userspace
in the increments specified.