Re: [PATCH 8/9] libfrog: create xfd_open function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 04, 2019 at 09:01:21AM +1000, Dave Chinner wrote:
> On Thu, Aug 29, 2019 at 09:21:15PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> > 
> > Create a helper to open a file and initialize the xfd structure.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> ....
> 
> >  
> > +/* Open a file on an XFS filesystem.  Returns zero or a positive error code. */
> > +int
> > +xfd_open(
> > +	struct xfs_fd		*xfd,
> > +	const char		*pathname,
> > +	int			flags)
> > +{
> > +	int			ret;
> > +
> > +	xfd->fd = open(pathname, O_RDONLY);
> 
> open(pathname, flags)

Will fix, good catch!

> And, to handle all future uses, shouldn't it also pass a mode?
> Though I think that can be done as a separate patch when we need
> O_RDWR for open....

<nod> Let's fix that when someone needs it, seeing as libfrog is an
internal static library anyway. :)

--D

> Otherwise it looks ok.
> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@xxxxxxxxxxxxx



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux