Thread (31 messages) 31 messages, 5 authors, 2021-01-20

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

From: Kari Argillander <hidden>
Date: 2021-01-18 14:26:13
Also in: lkml

On Mon, Jan 18, 2021 at 10:00:53AM +0000, Konstantin Komarov wrote:
From: Kari Argillander <redacted>
Sent: Monday, January 4, 2021 12:58 AM
quoted
On Thu, Dec 31, 2020 at 06:23:55PM +0300, Konstantin Komarov wrote:
 
quoted
quoted
+static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
+{
quoted
quoted
+	/* Return error if mode is not supported */
+	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
+		     FALLOC_FL_COLLAPSE_RANGE))
+		return -EOPNOTSUPP;
quoted
quoted
+
+	if (mode & FALLOC_FL_PUNCH_HOLE) {
quoted
quoted
+	} else if (mode & FALLOC_FL_COLLAPSE_RANGE) {
quoted
quoted
+	} else {
quoted
quoted
+		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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help