[PATCH] misc: pass miscdevice through file's private_data

2015-03-31 Thread Tom Van Braeckel
Make the miscdevice accessible through the file's private_data. Previously, this was done only when an open() file operation had been registered. If no custom open() file operation was defined, private_data was set to NULL. This subtle quirk was confusing, to the point where kernel code registere

Re: [PATCH] misc: pass miscdevice through file's private_data

2015-03-31 Thread Greg KH
On Tue, Mar 31, 2015 at 03:08:38PM +0200, Tom Van Braeckel wrote: > >> Wait, didn't this break FUSE? Or was that some other variant of this > >> patch? > > The fix for FUSE is in 4.0-rc5 and linux-next. Btrfs was not affected, > in the end. All kernel code has been checked for potential regressio

Re: [PATCH] misc: pass miscdevice through file's private_data

2015-03-31 Thread Tom Van Braeckel
>> Wait, didn't this break FUSE? Or was that some other variant of this >> patch? The fix for FUSE is in 4.0-rc5 and linux-next. Btrfs was not affected, in the end. All kernel code has been checked for potential regressions. So in my opinion, the time has come to apply this patch to char-misc so

Re: [PATCH] misc: pass miscdevice through file's private_data

2015-01-11 Thread Tom Van Braeckel
> Wait, didn't this break FUSE? Or was that some other variant of this > patch? You're right. How come I missed this? I traced back my steps and as stated, I had reviewed all relevant code in the "drivers" folder. And therein lies the problem: I didn't think of reviewing the code in the "fs" fol

Re: [PATCH] misc: pass miscdevice through file's private_data

2015-01-09 Thread Greg KH
On Fri, Dec 05, 2014 at 05:37:54AM +0100, Tom Van Braeckel wrote: > Make the miscdevice accessible through the file's private_data. > > Previously, this was done only when an open() operation had been registered. > But it's also useful in other file operations so we pass it on > unconditionally.

[PATCH] misc: pass miscdevice through file's private_data

2014-12-04 Thread Tom Van Braeckel
Make the miscdevice accessible through the file's private_data. Previously, this was done only when an open() operation had been registered. But it's also useful in other file operations so we pass it on unconditionally. All drivers that use private_data and misc_register() were checked to ensure

Re: [PATCH] Misc: pass miscdevice through file's private_data

2014-12-04 Thread Greg KH
On Fri, Dec 05, 2014 at 12:01:03AM +0100, Tom Van Braeckel wrote: > > > > > > + /* > > > + * Place the miscdevice in the file's > > > + * private_data so it can be used by the > > > + * file operations, including f_op->open below > > > + */ > > > + file->private_data = c; > > > + > > > err

Re: [PATCH] Misc: pass miscdevice through file's private_data

2014-12-04 Thread Tom Van Braeckel
> > > > + /* > > +* Place the miscdevice in the file's > > +* private_data so it can be used by the > > +* file operations, including f_op->open below > > +*/ > > + file->private_data = c; > > + > > err = 0; > > replace_fops(file, new_fops); > > if (file->f_op->ope

Re: [PATCH] Misc: pass miscdevice through file's private_data

2014-12-04 Thread Greg KH
On Thu, Dec 04, 2014 at 10:08:15PM +0100, Tom Van Braeckel wrote: > Place the miscdevice in the file's private_data to be used by the file > operations. > > Previously, this was done only when an open() operation had been registered. > But it is also useful in the other file operations, so we pas

[PATCH] Misc: pass miscdevice through file's private_data

2014-12-04 Thread Tom Van Braeckel
Place the miscdevice in the file's private_data to be used by the file operations. Previously, this was done only when an open() operation had been registered. But it is also useful in the other file operations, so we pass it on unconditionally. Signed-off-by: Tom Van Braeckel --- drivers/cha