mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
vfs_fruit: move zero file-id to vfs_fruit
Now that this stuff goes through the VFS, let's do it right. :) Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
36d100e4b8
commit
076f26dd5c
@ -2733,10 +2733,6 @@ static uint64_t vfswrap_fs_file_id(struct vfs_handle_struct *handle,
|
||||
{
|
||||
uint64_t file_id;
|
||||
|
||||
if (handle->conn->sconn->aapl_zero_file_id) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(psbuf->st_ex_iflags & ST_EX_IFLAG_CALCULATED_ITIME)) {
|
||||
return psbuf->st_ex_file_id;
|
||||
}
|
||||
|
@ -2980,9 +2980,6 @@ static NTSTATUS check_aapl(vfs_handle_struct *handle,
|
||||
blob);
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
global_fruit_config.nego_aapl = true;
|
||||
if (config->aapl_zero_file_id) {
|
||||
aapl_force_zero_file_id(handle->conn->sconn);
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
@ -7135,6 +7132,22 @@ static uint64_t fruit_disk_free(vfs_handle_struct *handle,
|
||||
return dfree / 2;
|
||||
}
|
||||
|
||||
static uint64_t fruit_fs_file_id(struct vfs_handle_struct *handle,
|
||||
const SMB_STRUCT_STAT *psbuf)
|
||||
{
|
||||
struct fruit_config_data *config = NULL;
|
||||
|
||||
SMB_VFS_HANDLE_GET_DATA(handle, config,
|
||||
struct fruit_config_data,
|
||||
return 0);
|
||||
|
||||
if (config->aapl_zero_file_id) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return SMB_VFS_NEXT_FS_FILE_ID(handle, psbuf);
|
||||
}
|
||||
|
||||
static struct vfs_fn_pointers vfs_fruit_fns = {
|
||||
.connect_fn = fruit_connect,
|
||||
.disk_free_fn = fruit_disk_free,
|
||||
@ -7166,6 +7179,7 @@ static struct vfs_fn_pointers vfs_fruit_fns = {
|
||||
.offload_read_recv_fn = fruit_offload_read_recv,
|
||||
.offload_write_send_fn = fruit_offload_write_send,
|
||||
.offload_write_recv_fn = fruit_offload_write_recv,
|
||||
.fs_file_id_fn = fruit_fs_file_id,
|
||||
|
||||
/* NT ACL operations */
|
||||
.fget_nt_acl_fn = fruit_fget_nt_acl,
|
||||
|
@ -858,7 +858,6 @@ struct smbd_server_connection {
|
||||
struct messaging_context *msg_ctx;
|
||||
struct notify_context *notify_ctx;
|
||||
bool using_smb2;
|
||||
bool aapl_zero_file_id; /* Apple-specific */
|
||||
int trans_num;
|
||||
|
||||
size_t num_users;
|
||||
|
@ -1161,7 +1161,6 @@ int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf);
|
||||
NTSTATUS check_access_fsp(const struct files_struct *fsp,
|
||||
uint32_t access_mask);
|
||||
uint64_t smb_roundup(connection_struct *conn, uint64_t val);
|
||||
void aapl_force_zero_file_id(struct smbd_server_connection *sconn);
|
||||
bool samba_private_attr_name(const char *unix_ea_name);
|
||||
NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
|
||||
files_struct *fsp,
|
||||
|
@ -213,16 +213,6 @@ uint64_t smb_roundup(connection_struct *conn, uint64_t val)
|
||||
return val;
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
Globally (for this connection / multi-channel) disable file-ID
|
||||
calculation. This is required to be global because it serves
|
||||
Macs in AAPL mode, which is globally set.
|
||||
********************************************************************/
|
||||
void aapl_force_zero_file_id(struct smbd_server_connection *sconn)
|
||||
{
|
||||
sconn->aapl_zero_file_id = true;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Utility functions for dealing with extended attributes.
|
||||
****************************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user