lkml.org 
[lkml]   [2021]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v17 04/10] fs/ntfs3: Add file operations and implementation
On Mon, Jan 18, 2021 at 10:00:53AM +0000, Konstantin Komarov wrote:
> From: Kari Argillander <kari.argillander@gmail.com>
> 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.

\
 
 \ /
  Last update: 2021-01-18 15:26    [W:0.139 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site