Skip to content

Commit eccccf4

Browse files
jtlaytonnamjaejeon
authored andcommitted
ksmbd: filelock: move file locking definitions to separate header file
The file locking definitions have lived in fs.h since the dawn of time, but they are only used by a small subset of the source files that include it. Move the file locking definitions to a new header file, and add the appropriate #include directives to the source files that need them. By doing this we trim down fs.h a bit and limit the amount of rebuilding that has to be done when we make changes to the file locking APIs. Reviewed-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: David Howells <dhowells@redhat.com> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Acked-by: Chuck Lever <chuck.lever@oracle.com> Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com> Acked-by: Steve French <stfrench@microsoft.com> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Acked-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
1 parent ea5697e commit eccccf4

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

smb2pdu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
#include <linux/falloc.h>
1414
#include <linux/crc32.h>
1515
#include <linux/mount.h>
16+
#include <linux/version.h>
17+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
18+
#include <linux/filelock.h>
19+
#endif
1620

1721
#include "glob.h"
1822
#include "smb2pdu.h"

vfs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66

77
#include <linux/kernel.h>
88
#include <linux/fs.h>
9+
#include <linux/version.h>
10+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
11+
#include <linux/filelock.h>
12+
#endif
913
#include <linux/uaccess.h>
1014
#include <linux/backing-dev.h>
1115
#include <linux/writeback.h>
12-
#include <linux/version.h>
1316
#include <linux/xattr.h>
1417
#include <linux/falloc.h>
1518
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)

vfs_cache.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
*/
66

77
#include <linux/fs.h>
8+
#include <linux/version.h>
9+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
10+
#include <linux/filelock.h>
11+
#endif
812
#include <linux/slab.h>
913
#include <linux/vmalloc.h>
1014

0 commit comments

Comments
 (0)