diff options
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/includes.h | 6 | ||||
-rw-r--r-- | source3/include/proto.h | 5 | ||||
-rw-r--r-- | source3/include/smb.h | 7 | ||||
-rw-r--r-- | source3/include/vfs.h | 10 | ||||
-rw-r--r-- | source3/include/vfs_macros.h | 8 |
5 files changed, 23 insertions, 13 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h index 87df3b7d31..92a37053ce 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -566,6 +566,12 @@ struct timespec { }; #endif +enum timestamp_set_resolution { + TIMESTAMP_SET_SECONDS = 0, + TIMESTAMP_SET_MSEC, + TIMESTAMP_SET_NT_OR_BETTER +}; + #ifdef HAVE_BROKEN_GETGROUPS #define GID_T int #else diff --git a/source3/include/proto.h b/source3/include/proto.h index 97d05b3699..c530ee5b15 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1028,7 +1028,8 @@ char *current_timestring(TALLOC_CTX *ctx, bool hires); void srv_put_dos_date(char *buf,int offset,time_t unixdate); void srv_put_dos_date2(char *buf,int offset, time_t unixdate); void srv_put_dos_date3(char *buf,int offset,time_t unixdate); -void put_long_date_timespec(char *p, struct timespec ts); +void round_timespec(enum timestamp_set_resolution res, struct timespec *ts); +void put_long_date_timespec(enum timestamp_set_resolution res, char *p, struct timespec ts); void put_long_date(char *p, time_t t); void dos_filetime_timespec(struct timespec *tsp); time_t make_unix_date2(const void *date_ptr, int zone_offset); @@ -1044,7 +1045,7 @@ struct timespec timespec_current(void); struct timespec timespec_min(const struct timespec *ts1, const struct timespec *ts2); int timespec_compare(const struct timespec *ts1, const struct timespec *ts2); -void round_timespec(struct timespec *ts); +void round_timespec_to_sec(struct timespec *ts); void round_timespec_to_usec(struct timespec *ts); struct timespec interpret_long_date(const char *p); void cli_put_dos_date(struct cli_state *cli, char *buf, int offset, time_t unixdate); diff --git a/source3/include/smb.h b/source3/include/smb.h index 1347ab228b..3f3d7e6abc 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -557,9 +557,10 @@ typedef struct connection_struct { bool ipc; bool read_only; /* Attributes for the current user of the share. */ bool admin_user; /* Attributes for the current user of the share. */ - bool hires_timestamps_avail; /* Does this filesystem honor - sub second timestamps on files - and directories ? */ + /* Does this filesystem honor + sub second timestamps on files + and directories when setting time ? */ + enum timestamp_set_resolution ts_res; char *connectpath; char *origpath; diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 27223526b6..38a972f04c 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -121,8 +121,9 @@ /* Changed to version 26 - Plumb struct smb_filename to SMB_VFS_CREATE_FILE, SMB_VFS_OPEN, SMB_VFS_STAT, SMB_VFS_LSTAT, SMB_VFS_RENAME, SMB_VFS_UNLINK, SMB_VFS_NTIMES. */ - -#define SMB_VFS_INTERFACE_VERSION 26 +/* Changed to version 27 - not yet released. Added enum timestamp_set_resolution + * return to fs_capabilities call. JRA. */ +#define SMB_VFS_INTERFACE_VERSION 27 /* to bug old modules which are trying to compile with the old functions */ @@ -173,7 +174,7 @@ struct vfs_fn_pointers { int (*set_quota)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); int (*get_shadow_copy_data)(struct vfs_handle_struct *handle, struct files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels); int (*statvfs)(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf); - uint32_t (*fs_capabilities)(struct vfs_handle_struct *handle); + uint32_t (*fs_capabilities)(struct vfs_handle_struct *handle, enum timestamp_set_resolution *p_ts_res); /* Directory operations */ @@ -488,7 +489,8 @@ int smb_vfs_call_get_shadow_copy_data(struct vfs_handle_struct *handle, bool labels); int smb_vfs_call_statvfs(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf); -uint32_t smb_vfs_call_fs_capabilities(struct vfs_handle_struct *handle); +uint32_t smb_vfs_call_fs_capabilities(struct vfs_handle_struct *handle, + enum timestamp_set_resolution *p_ts_res); SMB_STRUCT_DIR *smb_vfs_call_opendir(struct vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attributes); diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 2d7344c4ae..e271cdee61 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -63,10 +63,10 @@ #define SMB_VFS_NEXT_STATVFS(handle, path, statbuf) \ smb_vfs_call_statvfs((handle)->next, (path), (statbuf)) -#define SMB_VFS_FS_CAPABILITIES(conn) \ - smb_vfs_call_fs_capabilities((conn)->vfs_handles) -#define SMB_VFS_NEXT_FS_CAPABILITIES(handle) \ - smb_vfs_call_fs_capabilities((handle)->next) +#define SMB_VFS_FS_CAPABILITIES(conn, p_ts_res) \ + smb_vfs_call_fs_capabilities((conn)->vfs_handles, (p_ts_res)) +#define SMB_VFS_NEXT_FS_CAPABILITIES(handle, p_ts_res) \ + smb_vfs_call_fs_capabilities((handle)->next, (p_ts_res)) /* Directory operations */ #define SMB_VFS_OPENDIR(conn, fname, mask, attr) \ |