From: Bjoern Jacke Date: Fri, 14 Jan 2022 17:02:32 +0000 (+0000) Subject: vfs_gpfs: use linux oplock specific funcions only when available X-Git-Tag: tevent-0.12.0~709 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e464fc96ae3b431796223776ded83bcc9d14c6f;p=thirdparty%2Fsamba.git vfs_gpfs: use linux oplock specific funcions only when available Signed-off-by: Bjoern Jacke Reviewed-by: Christof Schmitt Autobuild-User(master): Christof Schmitt Autobuild-Date(master): Wed Feb 16 21:38:12 UTC 2022 on sn-devel-184 --- diff --git a/source3/modules/test_vfs_gpfs.c b/source3/modules/test_vfs_gpfs.c index 58f3c41934a..b03a46a352d 100644 --- a/source3/modules/test_vfs_gpfs.c +++ b/source3/modules/test_vfs_gpfs.c @@ -43,12 +43,14 @@ static void test_share_deny_mapping(void **state) 0); /* GPFS limitation, cannot deny only delete. */ } +#ifdef HAVE_KERNEL_OPLOCKS_LINUX static void test_gpfs_lease_mapping(void **state) { assert_int_equal(lease_type_to_gpfs(F_RDLCK), GPFS_LEASE_READ); assert_int_equal(lease_type_to_gpfs(F_WRLCK), GPFS_LEASE_WRITE); assert_int_equal(lease_type_to_gpfs(F_UNLCK), GPFS_LEASE_NONE); } +#endif /* #ifdef HAVE_KERNEL_OPLOCKS_LINUX */ static void test_gpfs_winattrs_to_dosmode(void **state) { @@ -139,7 +141,9 @@ int main(int argc, char **argv) { const struct CMUnitTest tests[] = { cmocka_unit_test(test_share_deny_mapping), +#ifdef HAVE_KERNEL_OPLOCKS_LINUX cmocka_unit_test(test_gpfs_lease_mapping), +#endif /* #ifdef HAVE_KERNEL_OPLOCKS_LINUX */ cmocka_unit_test(test_gpfs_winattrs_to_dosmode), cmocka_unit_test(test_dosmode_to_gpfs_winattrs), cmocka_unit_test(test_gpfs_get_file_id), diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 52517ee0084..e336f8aec5d 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -220,6 +220,7 @@ static int vfs_gpfs_close(vfs_handle_struct *handle, files_struct *fsp) return SMB_VFS_NEXT_CLOSE(handle, fsp); } +#ifdef HAVE_KERNEL_OPLOCKS_LINUX static int lease_type_to_gpfs(int leasetype) { if (leasetype == F_RDLCK) { @@ -277,6 +278,16 @@ failure: return ret; } +#else /* HAVE_KERNEL_OPLOCKS_LINUX */ + +static int vfs_gpfs_setlease(vfs_handle_struct *handle, + files_struct *fsp, + int leasetype) +{ + return ENOSYS; +} +#endif /* HAVE_KERNEL_OPLOCKS_LINUX */ + static int vfs_gpfs_get_real_filename(struct vfs_handle_struct *handle, const struct smb_filename *path, const char *name,