diff options
author | Jim McDonough <jmcd@samba.org> | 2007-02-14 02:37:14 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:17:56 -0500 |
commit | 5a052edf031d2c02b018743f0947a12b4df16c2d (patch) | |
tree | 6f379555b9225349ef61e00645fbf89a1e8cb279 /source3/modules/vfs_default.c | |
parent | 9918e74984467ebaae306f2e3f3bfdc7453a1327 (diff) | |
download | samba-5a052edf031d2c02b018743f0947a12b4df16c2d.tar.gz samba-5a052edf031d2c02b018743f0947a12b4df16c2d.tar.bz2 samba-5a052edf031d2c02b018743f0947a12b4df16c2d.zip |
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)
Diffstat (limited to 'source3/modules/vfs_default.c')
-rw-r--r-- | source3/modules/vfs_default.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 6defa238b9..90fd30c604 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -783,6 +783,23 @@ static BOOL vfswrap_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd return result; } +static int vfswrap_linux_setlease(vfs_handle_struct *handle, files_struct *fsp, int fd, + int leasetype) +{ + int result; + + START_PROFILE(syscall_linux_setlease); + + /* first set the signal handler */ + if(linux_set_lease_sighandler(fd) == -1) + return -1; + + result = linux_setlease(fd, leasetype); + + END_PROFILE(syscall_linux_setlease); + return result; +} + static int vfswrap_symlink(vfs_handle_struct *handle, const char *oldpath, const char *newpath) { int result; @@ -1227,6 +1244,8 @@ static vfs_op_tuple vfs_default_ops[] = { SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(vfswrap_kernel_flock), SMB_VFS_OP_KERNEL_FLOCK, SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(vfswrap_linux_setlease), SMB_VFS_OP_LINUX_SETLEASE, + SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(vfswrap_getlock), SMB_VFS_OP_GETLOCK, SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(vfswrap_symlink), SMB_VFS_OP_SYMLINK, |