Skip to content

Commit 8a5fb18

Browse files
zhangjayceeMiklos Szeredi
authored andcommitted
fuse: remove an unnecessary if statement
FUSE remote locking code paths never add any locking state to inode->i_flctx, so the locks_remove_posix() function called on file close will return without calling fuse_setlk(). Therefore, as the if statement to be removed in this commit will always be false, remove it for clearness. Signed-off-by: Jiachen Zhang <zhangjiachen.jaycee@bytedance.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1 parent 2e3f7dd commit 8a5fb18

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

fs/fuse/file.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2678,10 +2678,6 @@ static int fuse_setlk(struct file *file, struct file_lock *fl, int flock)
26782678
return -ENOLCK;
26792679
}
26802680

2681-
/* Unlock on close is handled by the flush method */
2682-
if ((fl->fl_flags & FL_CLOSE_POSIX) == FL_CLOSE_POSIX)
2683-
return 0;
2684-
26852681
fuse_lk_fill(&args, file, fl, opcode, pid_nr, flock, &inarg);
26862682
err = fuse_simple_request(fm, &args);
26872683

0 commit comments

Comments
 (0)