• Home
  • Raw
  • Download

Lines Matching +full:start +full:- +full:up

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::
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
164 set it to a non-zero value.
167 up. If dynamic memory is allocated for the iterator, stop() is the
168 place to free it; if a lock was taken by start(), stop() must release
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
281 method, however, to hook everything up. The open function is often a single
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
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