Lines Matching full:file

9 	This file is originally from the LWN.net Driver Porting series at
22 however. It is not that hard to make a virtual file which returns a
26 position within the virtual file - that position is, likely as not, in the
31 which are designed to make it easy for virtual file creators to get it
37 * An iterator interface which lets a virtual file implementation
44 the virtual file.
47 loadable module which creates a file called /proc/sequence. The file, when
50 better to do. The file is seekable, in that one can do something like the
76 Modules implementing a virtual file with seq_file must implement an
79 is able to move to a specific position - like the file they implement,
96 translates to an offset in the virtual file. The one obvious exception
97 is that a position of zero should indicate the beginning of the file.
124 "past end of file" condition and return NULL if need be.
158 end-of-file. If the value is then used by start() to initialise the
160 sequence is reported twice in the file. In order to discourage this bug
171 the next session unless lseek() has been called on the file; in that
206 This structure will be needed to tie our iterator to the /proc file in
255 Here, path indicates the file of interest, and esc is a set of characters
276 seq_file system, but we have not yet turned them into a file that a user
277 can see. Creating a file within the kernel requires, of course, the
279 file. The seq_file interface provides a set of canned operations which do
280 most of the work. The virtual file author still must implement the open()
284 static int ct_open(struct inode *inode, struct file *file)
286 return seq_open(file, &ct_seq_ops);
290 before, and gets set up to iterate through the virtual file.
293 file->private_data. If you have an application where the same iterator can
294 be used for more than one file, you can store an arbitrary pointer in the
303 static int ct_open(struct inode *inode, struct file *file)
305 return seq_open_private(file, &ct_seq_ops,
313 static int ct_open(struct inode *inode, struct file *file)
316 __seq_open_private(file, &ct_seq_ops, sizeof(*p));
332 all implemented by the seq_file code itself. So a virtual file's
346 The final step is the creation of the /proc file itself. In the example
365 If your file will be iterating through a linked list, you may find these
385 output that the virtual file will contain. The file's open() method then
388 int single_open(struct file *file,