From 5a052edf031d2c02b018743f0947a12b4df16c2d Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Wed, 14 Feb 2007 02:37:14 +0000 Subject: r21324: Add linux setlease to the vfs layer. Next round, as Volker points out, it should be abstracted a little higher up so other os'es can have an entry, but it will take a bit more work. Thanks to Chetan Shringarpure and Mathias Dietz. I didn't increment the vfs number again because the kernel change notify stuff hasn't been released yet anyway. (This used to be commit 9463211bf3b46ee408b88dfbf42d498e3839d4cc) --- source3/modules/vfs_gpfs.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'source3/modules/vfs_gpfs.c') diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index c8bb848d0f..20c9f56a17 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -52,6 +52,31 @@ static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp, return 0; } +static int vfs_gpfs_setlease(vfs_handle_struct *handle, files_struct *fsp, + int fd, int leasetype) +{ + int ret; + + START_PROFILE(syscall_linux_setlease); + + if ( linux_set_lease_sighandler(fd) == -1) + return -1; + + ret = set_gpfs_lease(fd,leasetype); + + if ( ret < 0 ) { + /* This must have come from GPFS not being available */ + /* or some other error, hence call the default */ + ret = linux_setlease(fd, leasetype); + } + + END_PROFILE(syscall_linux_setlease); + + return ret; +} + + + static void gpfs_dumpacl(int level, struct gpfs_acl *gacl) { int i; @@ -592,6 +617,10 @@ static vfs_op_tuple gpfs_op_tuples[] = { SMB_VFS_OP_KERNEL_FLOCK, SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(vfs_gpfs_setlease), + SMB_VFS_OP_LINUX_SETLEASE, + SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(gpfsacl_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, -- cgit