lkml.org 
[lkml]   [2019]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 04/12] misc: xilinx_sdfec: Add open, close and ioctl
On Tue, Mar 19, 2019 at 3:59 PM Dragan Cvetic <draganc@xilinx.com> wrote:
> >
> > > + /* Only one open per device at a time */
> > > + if (!atomic_dec_and_test(&xsdfec->open_count)) {
> > > + atomic_inc(&xsdfec->open_count);
> > > + return -EBUSY;
> > > + }
> >
> > What is that limitation for? Is it worse to open it twice than
> > to dup() or fork()?
> >
> The device can be opened only once.

What I mean here is that preventing the double open() is
a fairly weak protection: it means you cannot have multiple
'struct file' pointers attached to the same inode, but you
can still have the same 'struct file' being available to
multiple processes.

Arnd

\
 
 \ /
  Last update: 2019-03-19 16:36    [W:0.098 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site