1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

167 Commits

Author SHA1 Message Date
David Disseldorp
d8d5d4c742 vfs: add [GET/SET]_COMPRESSION hooks
The VFS interfaces are sychronous, as the operations only modify
meta-data.
These hooks are dependent on support for transparent compression by the
underlying filesystem - vfs_default returns INVALID_DEVICE_REQUEST.
Support for other filesystems providing transparent comression, such as
Btrfs and ZFS, can be added in future.

The get_compression function takes fsp and smb_fname arguments. The
smb_fname argument is needed due to the current dosmode() code-path.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-22 08:56:45 -08:00
Andrew Bartlett
cbddf9e2ef build: Remove autoconf build system from examples/VFS
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-05-28 12:17:12 +10:00
David Disseldorp
ef00eb90e5 s3-vfs: add copy_chunk vfs hooks
copy_chunk copies n bytes from a source file at a specific offset to a
destination file at a given offset. This interface will be used in
handling smb2 FSCTL_SRV_COPYCHUNK ioctl requests.

Use a pread/pwrite loop in vfs_default, so that requests referring to
the same src and dest file are possible.

Provide send and receive hooks for copy chunk VFS interface, allowing
asynchronous behaviour.

Check whether the request source offset + length exceeds the current
size. Return STATUS_INVALID_VIEW_SIZE under such a condition, matching
Windows server behaviour.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:06 +01:00
Andrew Bartlett
a581b3d48e examples: Re-indent and reformat skel VFS modules
This avoids some of the poor style here from propogating to new VFS modules.

Andrew Bartlett
2012-10-11 12:25:14 +11:00
Andrew Bartlett
1f36ec1293 vfs: Remove type parameter from sys_acl_blob_get_{fd,file}
This interface actually needs to match the get_nt_acl interface in
that the system ACL implmenetation may not be posix ACLs, and the blob
is not meant to be enforced to be of a particular system ACL
structure.

Andrew Bartlett
2012-10-11 12:25:11 +11:00
Andrew Bartlett
c8ade07760 smbd: Add mem_ctx to {f,}get_nt_acl VFS call
This makes it clear which context the returned SD is allocated on, as
a number of callers do not want it on talloc_tos().

As the ACL transformation allocates and then no longer needs a great
deal of memory, a talloc_stackframe() call is used to contain the
memory that is not returned further up the stack.

Andrew Bartlett
2012-10-11 12:25:11 +11:00
Andrew Bartlett
9158974540 smbd: Add mem_ctx to sys_acl_init() and all callers
This changes from allocation on NULL to allocation on the supplied
memory context.

Currently that supplied context is talloc_tos() at the the final consumer of
the ACL.

Andrew Bartlett
2012-10-11 12:25:11 +11:00
Andrew Bartlett
e8375ddf2d smbd: Add extra VFS hooks to get the posix ACL as a blob
This will allow us to hash this, rather than the NT ACL it maps to.
This will in turn allow us to know if the NT ACL is valid even if we
have to change the mapping code.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Sep 12 07:06:01 CEST 2012 on sn-devel-104
2012-09-12 07:06:01 +02:00
Andrew Bartlett
e25830dcd8 s3-smbd: Remove sys_acl_*() VFS wrapper functions
We no longer do struct smb_acl_t manipuations via the VFS layer,
which is now reduced to handling the get/set functions.

The only backend that implemented these functions (aside from audit)
was the vfs_default module calling the sys_acl code.  The various ACL
implementation modules either worked on the fully initilaised
smb_acl_t object or on NT ACLs.

This not only makes the operation of the posix ACL code more efficient
(as allocation and free is not put via the VFS), it makes it easier to
test and removes the fantasy that a module could safely redefine this
structure or the behaviour here.

The smb_acls.idl now defines the structure, and it is now allocated
with talloc.

These operations were originally added to the VFS in commit
3bb219161a.

Andrew Bartlett
2012-08-15 11:44:50 +10:00
Richard Sharpe
610ac2d350 Make it possible to build under Solaris make as well as FreeBSD and Linux. Also add comments on changes that might be needed 2012-07-31 19:24:12 -07:00
Volker Lendecke
5d09cec6fe s3-vfs: async fsync
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:48:04 -07:00
Volker Lendecke
9dc78c90f3 s3-aio: Remove unused VFS functions and more
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:45:58 -07:00
Volker Lendecke
be05dad399 s3-vfs: Add pwrite_send/recv to vfs modules
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:45:14 -07:00
Volker Lendecke
90461aa023 s3-vfs: Add pread_send/recv to vfs modules
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:44:53 -07:00
Stefan Metzmacher
04ab606ddb examples/VFS: don't use smbd/proto.h
metze
2012-06-06 10:18:38 +02:00
Andrew Bartlett
611ca8e819 build: Move generated files out of the normal build tree
This avoids some dual-build-system interactions.

Andrew Bartlett
2012-05-18 15:44:43 +10:00
Richard Sharpe
2730eda640 Improve the VFS Makefile so that it is easier for use out of tree but still works with FreeBSD.
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Mon Apr 16 19:51:14 CEST 2012 on sn-devel-104
2012-04-16 19:51:14 +02:00
Andrew Bartlett
6aa12fcb30 build: Remove SMB_OFF_T, replace with off_t
Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Apr  6 01:47:43 CEST 2012 on sn-devel-104
2012-04-06 01:47:43 +02:00
Andrew Bartlett
19eee33d82 s3-vfs: Remove unused lremovexattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument
to removexattr.

Andrew Bartlett
2012-04-05 13:39:01 +10:00
Andrew Bartlett
c70ac29c54 s3-vfs: Remove unused lsetxattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument
to listxattr.

Andrew Bartlett
2012-04-05 13:39:00 +10:00
Andrew Bartlett
c5b17c5555 s3-vfs: Remove unused llistxattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument
to listxattr.

Andrew Bartlett
2012-04-05 13:39:00 +10:00
Andrew Bartlett
b2f7cfa848 s3-vfs: Remove unused lgetxattr call from VFS modules, system.c and configure 2012-04-05 13:39:00 +10:00
Andrew Bartlett
f6e0532024 build: Remove SMB_STRUCT_DIR define 2012-04-05 02:39:09 +02:00
Andrew Bartlett
2320b2144f build: Remove SMB_STRUCT_DIRENT define 2012-04-05 02:39:09 +02:00
Volker Lendecke
fa6f61e835 s3: Pass filters explicitly through vfs notify watch
This removes a dependency on "struct notify_entry" and makes the nature of the
API more explicit. We depend upon the VFS module to mask out elements from
e->filter and e->subdir_filter that it took over to handle.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Mon Mar 26 17:45:44 CEST 2012 on sn-devel-104
2012-03-26 17:45:43 +02:00
Richard Sharpe
1080483319 Improve the Makefile. Use a standard make macro, not a shell command.
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Sat Mar 24 07:09:44 CET 2012 on sn-devel-104
2012-03-24 07:09:44 +01:00
Richard Sharpe
a15aefea27 Make it possible for developers of out-of-tree modules to use the same names as in-tree modules.
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Sat Mar 24 03:18:38 CET 2012 on sn-devel-104
2012-03-24 03:18:37 +01:00
Volker Lendecke
4319076cca s3: Pass "path" through vfs_notify_watch 2012-03-21 12:52:09 +01:00
Volker Lendecke
bc6803febb examples: Make examples/VFS/Makefile.in FreeBSD-friendly
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sat Mar  3 00:53:43 CET 2012 on sn-devel-104
2012-03-03 00:53:40 +01:00
Andrew Bartlett
b93326b968 s3-build: remove EXEEXT from Makefiles
As far as I am aware, we do not actually build on any platforms that
require this.  The last Stratos VOS release on
ftp://ftp.stratus.com/vos/samba/samba.html was 3.0.5

Andrew Bartlett
2012-02-09 00:27:08 +01:00
Volker Lendecke
b87e88710c s3: Fix examples/VFS build
With other builds in the include path, examples get the includes.h wrong

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Dec 13 23:40:37 CET 2011 on sn-devel-104
2011-12-13 23:40:37 +01:00
Richard Sharpe
422494a8e6 vfs: Make function pointer names consistent. They all end in _fn
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Mon Dec 12 04:58:40 CET 2011 on sn-devel-104
2011-12-12 04:58:40 +01:00
Richard Sharpe
f50aa988c2 Improve configure.in so it can be used outside the Samba source tree.
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Thu Nov 17 07:00:38 CET 2011 on sn-devel-104
2011-11-17 07:00:38 +01:00
Günther Deschner
49eba95b2b s3-waf: make sure we build example vfs modules with --enable-developer.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue Oct 11 21:22:55 CEST 2011 on sn-devel-104
2011-10-11 21:22:55 +02:00
Jeremy Allison
2ecfa0c1aa Fix the VFS for fsctl.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Oct 11 19:49:22 CEST 2011 on sn-devel-104
2011-10-11 19:49:22 +02:00
Stefan Metzmacher
ce5b4b3fd9 examples/VFS: add skel_get_dfs_referrals()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sat Oct  8 11:29:18 CEST 2011 on sn-devel-104
2011-10-08 11:29:18 +02:00
Stefan Metzmacher
9ca88eb10b examples/VFS: fix names in skel_opaque.c
metze
2011-10-08 09:52:23 +02:00
Michael Adam
de912e783b examples/VFS: fix a typo in the README
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Sat Oct  8 01:42:33 CEST 2011 on sn-devel-104
2011-10-08 01:42:33 +02:00
Michael Adam
f5bc4de1cd examples/VFS: try to fix the build on openbsd, adding alternative spellings of autoconf/header
The host "samba-amd64" on the build farm running openbsd 4.8 broke.
Taking over the additional spellings of autoconf and autoheader from
the source3/autogen.sh script should fix it.
2011-07-06 12:55:25 +02:00
Michael Adam
197df817a3 examples/VFS: add include path for s3's autoconf config.h 2011-06-30 15:41:24 +02:00
Björn Baumbach
576cb574a1 examples/VFS: fix skel_transparent.c in reference to shadow_copy changes
Signed-off-by: Michael Adam <obnox@samba.org>
2011-06-30 15:41:24 +02:00
Björn Baumbach
776672805c examples/VFS: fix skel_opaque.c in reference to shadow_copy changes
Signed-off-by: Michael Adam <obnox@samba.org>
2011-06-30 15:41:24 +02:00
Björn Baumbach
6930afc9f4 examples/VFS: fix shadow_copy_test.c in reference to shadow_copy changes
Signed-off-by: Michael Adam <obnox@samba.org>
2011-06-30 15:41:23 +02:00
Andrew Bartlett
5e26e94092 s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Jeremy Allison
c7d2f6d35a Remove the char * argument from the SMB_VFS_GETWD() call. Now always
returns malloc'ed memory.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jun  1 04:06:12 CEST 2011 on sn-devel-104
2011-06-01 04:06:12 +02:00
Günther Deschner
c7073f8b54 s3-vfs: rename open function to open_fn.
This should finally fix the AIX build and allow to remove AIX specific ifdefs.

Guenther

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Apr 21 02:01:20 CEST 2011 on sn-devel-104
2011-04-21 02:01:20 +02:00
Jeremy Allison
b12fbc22ac Fix the examples/VFS build.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Mar  7 15:11:25 CET 2011 on sn-devel-104
2011-03-07 15:11:25 +01:00
Jeremy Allison
286b22cb9a Fix examples/VFS to use correct prototypes for is_offline() and set_offline().
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Mar  7 13:39:17 CET 2011 on sn-devel-104
2011-03-07 13:39:16 +01:00
Jeremy Allison
a674a56a97 Add fdopendir to the VFS. We will use this to reuse a directory fd already open by NtCreateX.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Feb  9 00:55:22 CET 2011 on sn-devel-104
2011-02-09 00:55:22 +01:00
Jeremy Allison
716ea734e4 Rename vfs operation posix_fallocate to just fallocate and add the vfs_fallocate_mode parameter.
It turns out we need the fallocate operations to be able to both
allocate and extend filesize, and to allocate and not extend
filesize, and posix_fallocate can only do the former. So by defining
the vfs op as posix_fallocate we lose the opportunity to use any
underlying syscalls (like Linux fallocate) that can do the latter
as well.

We don't currently use the non-extending filesize call, but now
I've changed the vfs op definition we can in the future. For the
moment simply map the fallocate op onto posix_fallocate for the
VFS_FALLOCATE_EXTEND_SIZE case and return ENOSYS for the
VFS_FALLOCATE_KEEP_SIZE case.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Dec 18 08:59:27 CET 2010 on sn-devel-104
2010-12-18 08:59:27 +01:00