Lines Matching +full:value +full:- +full:start

1 .. SPDX-License-Identifier: GPL-2.0
10 https://lwn.net/Articles/driver-porting/
16 Virtual files can provide human-readable output that is easy to get at
23 string. But life gets trickier if the output is long - anything greater
26 position within the virtual file - that position is, likely as not, in the
68 - entry = create_proc_entry("sequence", 0, NULL);
69 - if (entry)
70 - entry->proc_fops = &ct_file_ops;
79 is able to move to a specific position - like the file they implement,
81 in whatever way is convenient - the iterator need only exist
103 first, called start(), starts a session and takes a position as an
104 argument, returning an iterator which will start reading at that
105 position. The pos passed to start() will always be either zero, or
109 the start() function looks like::
120 The entire data structure for this iterator is a single loff_t value
123 implementations; in most cases the start() function should check for a
128 also a special value which can be returned by the start() function
133 code. It is provided as a convenience for a start() function to
150 The next() function should set ``*pos`` to a value that start() can use
153 start(), it might seem sufficient to simply set ``*pos`` to any non-zero
154 value (zero always tells start() to restart the sequence). This is not
158 end-of-file. If the value is then used by start() to initialise the
162 a next() function does not change the value of ``*pos``. Consequently a
163 next() function *must* change the value of ``*pos``, and of course must
164 set it to a non-zero value.
168 place to free it; if a lock was taken by start(), stop() must release
169 that lock. The value that ``*pos`` was set to by the last next() call
170 before stop() is remembered, and used for the first start() call of
172 case next start() will be asked to start at position zero::
200 .start = ct_seq_start,
209 It's worth noting that the iterator value returned by start() and
216 between the calls to start() and stop(), so holding a lock during that time
220 The iterator value returned by start() or next() is guaranteed to be
293 file->private_data. If you have an application where the same iterator can
295 private field of the seq_file structure; that value can then be retrieved
319 return -ENOMEM;
321 p->foo = bar; /* initialize my stuff */
323 p->baz = true;
331 The other operations of interest - read(), llseek(), and release() - are
376 accordingly. Your start() and next() functions need only invoke the
380 The extra-simple version
393 value given to single_open() can be found in the private field of the