Re: [PATCH v17 04/10] fs/ntfs3: Add file operations and implementation

From: Kari Argillander
Date: Mon Jan 18 2021 - 09:25:56 EST


On Mon, Jan 18, 2021 at 10:00:53AM +0000, Konstantin Komarov wrote:
> From: Kari Argillander <kari.argillander@xxxxxxxxx>
> Sent: Monday, January 4, 2021 12:58 AM
> > On Thu, Dec 31, 2020 at 06:23:55PM +0300, Konstantin Komarov wrote:

> > > +static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
> > > +{

> > > + /* Return error if mode is not supported */
> > > + if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
> > > + FALLOC_FL_COLLAPSE_RANGE))
> > > + return -EOPNOTSUPP;

> > > +
> > > + if (mode & FALLOC_FL_PUNCH_HOLE) {

> > > + } else if (mode & FALLOC_FL_COLLAPSE_RANGE) {

> > > + } else {

> > > + if (mode & FALLOC_FL_KEEP_SIZE) {
> >
> > Isn't this hole else already (mode & FALLOC_FL_KEEP_SIZE?
>
> Sorry, can you please clarify your question? Not sure, understood it.

I have hide unrelevant code now. So maybe now you see better what I
mean. Last else have to be already FALLOC_FL_KEEP_SIZE so if statment is
not needed.