[PATCH v3 07/13] vfs_btrfs: add [GET/SET]_COMPRESSION handlers
Jeremy Allison
jra at samba.org
Fri Nov 8 15:29:34 MST 2013
On Tue, Nov 05, 2013 at 12:57:57PM +0100, David Disseldorp wrote:
> +/*
> + * caller must pass a non-null fsp or smb_fname. If fsp is null, then
> + * fall back to opening the corresponding file to issue the ioctl.
> + */
> +static NTSTATUS btrfs_get_compression(struct vfs_handle_struct *handle,
> + TALLOC_CTX *mem_ctx,
> + struct files_struct *fsp,
> + struct smb_filename *smb_fname,
> + uint16_t *_compression_fmt)
> +{
> + int ret;
> + long flags = 0;
> + int fd;
> + bool opened = false;
> + NTSTATUS status;
> +
> + if ((fsp != NULL) && (fsp->fh->fd != -1)) {
> + fd = fsp->fh->fd;
> + } else if (smb_fname != NULL) {
> + if (S_ISDIR(smb_fname->st.st_ex_mode)) {
> + DIR *dir = opendir(smb_fname->base_name);
> + if (dir == NULL) {
> + return NT_STATUS_UNSUCCESSFUL;
> + }
> + fd = dirfd(dir);
> + } else {
> + fd = open(smb_fname->base_name, O_RDONLY);
> + }
> + if (fd < 0) {
> + return NT_STATUS_UNSUCCESSFUL;
> + }
How do the opens here interact with kernel oplocks ?
Have you been able to check ? Would a torture test
with an explicit batch oplock followed by a pathname
based get compression call work ?
That's the only other thing I can see with the patchset
I'm wondering about.
Cheers,
Jeremy.
More information about the samba-technical
mailing list