[PATCH v3 07/13] vfs_btrfs: add [GET/SET]_COMPRESSION handlers
Jeremy Allison
jra at samba.org
Thu Nov 7 12:32:45 MST 2013
On Tue, Nov 05, 2013 at 12:57:57PM +0100, David Disseldorp wrote:
> Translate such requests into FS_IOC_GETFLAGS and FS_IOC_SETFLAGS ioctls
> respectively. The module makes no distinction between compression types,
> only whether or not compression is enabled.
>
> Signed-off-by: David Disseldorp <ddiss at samba.org>
> ---
> source3/modules/vfs_btrfs.c | 121 ++++++++++++++++++++++++++++++++++++++++++--
> source3/wscript | 2 +-
> 2 files changed, 119 insertions(+), 4 deletions(-)
>
> diff --git a/source3/modules/vfs_btrfs.c b/source3/modules/vfs_btrfs.c
> index f854f2a..d65b46a 100644
> --- a/source3/modules/vfs_btrfs.c
> +++ b/source3/modules/vfs_btrfs.c
> @@ -18,11 +18,16 @@
> */
>
> #include <linux/ioctl.h>
> +#include <linux/fs.h>
> #include <sys/ioctl.h>
> +#include <sys/types.h>
> +#include <sys/stat.h>
> +#include <unistd.h>
> +#include <fcntl.h>
> #include "includes.h"
> -#include "system/filesys.h"
> #include "smbd/smbd.h"
> -#include "../librpc/gen_ndr/smbXsrv.h"
> +#include "librpc/gen_ndr/smbXsrv.h"
> +#include "librpc/gen_ndr/ioctl.h"
> #include "lib/util/tevent_ntstatus.h"
>
> struct btrfs_ioctl_clone_range_args {
> @@ -107,7 +112,7 @@ static struct tevent_req *btrfs_copy_chunk_send(struct vfs_handle_struct *handle
> cr_args.src_length = (uint64_t)num;
>
> ret = ioctl(dest_fsp->fh->fd, BTRFS_IOC_CLONE_RANGE, &cr_args);
> - SMB_VFS_STRICT_UNLOCK(src_fsp->conn, src_fsp, &dest_lck);
> + SMB_VFS_STRICT_UNLOCK(src_fsp->conn, dest_fsp, &dest_lck);
> SMB_VFS_STRICT_UNLOCK(src_fsp->conn, src_fsp, &src_lck);
> if (ret < 0) {
David - I was reviewing the patchset and was wondering about
this hunk:
Shouldn't this change be :
- SMB_VFS_STRICT_UNLOCK(src_fsp->conn, src_fsp, &dest_lck);
+ SMB_VFS_STRICT_UNLOCK(dest_fsp->conn, dest_fsp, &dest_lck);
I'm not sure if src_fsp and dest_fsp can be on different conn
structs here, but this seems strange to me - the ->conn pointer
should be consistent between fsp handles.
Jeremy.
More information about the samba-technical
mailing list