Messages in this thread | | | From | Arnd Bergmann <> | Subject | Re: [PATCH 16/18] llseek: automatically add .llseek fop | Date | Thu, 8 Jul 2010 00:10:45 +0200 |
| |
On Wednesday 07 July 2010 23:55:25 Mike Frysinger wrote: > > New drivers should normally not use > > noop_llseek but instead use no_llseek and > > call nonseekable_open at open time. > > Existing drivers can be converted to do > > the same when the maintainer knows for > > certain that no user code relies on calling > > seek on the device file. > > can we skip the transition for devices that we already know ?
Yes, we could do that for the cases that call nonseekable_open either by putting it into file_operations or by calling it from their own open() function in the same file. These are the two cases where the semantic patch currently adds no_llseek.
The reason I added the explicit no_llseek was so I could tell the difference between those file operations that use nonseekable_open and those that spatch could for some reason not identify as belonging into any of the categories.
> > --- a/arch/blackfin/kernel/kgdb_test.c > > +++ b/arch/blackfin/kernel/kgdb_test.c > > static const struct file_operations kgdb_test_proc_fops = { > > + .llseek = noop_llseek,/* read and write both use no f_pos */ > > --- a/arch/blackfin/mach-bf561/coreb.c > > +++ b/arch/blackfin/mach-bf561/coreb.c > > static const struct file_operations coreb_fops = { > > + .llseek = noop_llseek,/* no read or write fn */ > > neither of these drivers are seekable, so attempts to do so should be > an error ...
Ok, then you should add ".open = nonseekable_open," to the file operations and put that change into a tree that gets pulled into linux-next. The semantic patch will do the right thing then, whatever we decide.
Arnd
| |