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