summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_onefs.c
diff options
context:
space:
mode:
authortodd stecher <todd.stecher@gmail.com>2009-01-23 16:55:18 -0800
committerTim Prouty <tprouty@samba.org>2009-01-23 21:05:38 -0800
commitc23f0f13b42745a7b9f7c0a5b37f1ad521f886df (patch)
treec26c1ea09f66115dda1c7192680d8843c7f70f63 /source3/modules/vfs_onefs.c
parent48b0016cff4bad621b94fc0bf678ec15260dd7d7 (diff)
downloadsamba-c23f0f13b42745a7b9f7c0a5b37f1ad521f886df.tar.gz
samba-c23f0f13b42745a7b9f7c0a5b37f1ad521f886df.tar.bz2
samba-c23f0f13b42745a7b9f7c0a5b37f1ad521f886df.zip
Modify OneFS module to support new NTIMES interfaces
Diffstat (limited to 'source3/modules/vfs_onefs.c')
-rw-r--r--source3/modules/vfs_onefs.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/source3/modules/vfs_onefs.c b/source3/modules/vfs_onefs.c
index 6b42c0f373..e048e89589 100644
--- a/source3/modules/vfs_onefs.c
+++ b/source3/modules/vfs_onefs.c
@@ -66,6 +66,39 @@ static int onefs_statvfs(vfs_handle_struct *handle, const char *path,
return result;
}
+static int onefs_ntimes(vfs_handle_struct *handle, const char *fname,
+ struct smb_file_time *ft)
+{
+ int flags = 0;
+ struct timespec times[3];
+
+ if (!null_timespec(ft->atime)) {
+ flags |= VT_ATIME;
+ times[0] = ft->atime;
+ DEBUG(6,("**** onefs_ntimes: actime: %s.%d\n",
+ time_to_asc(convert_timespec_to_time_t(ft->atime)),
+ ft->atime.tv_nsec));
+ }
+
+ if (!null_timespec(ft->mtime)) {
+ flags |= VT_MTIME;
+ times[1] = ft->mtime;
+ DEBUG(6,("**** onefs_ntimes: modtime: %s.%d\n",
+ time_to_asc(convert_timespec_to_time_t(ft->mtime)),
+ ft->mtime.tv_nsec));
+ }
+
+ if (!null_timespec(ft->create_time)) {
+ flags |= VT_BTIME;
+ times[2] = ft->create_time;
+ DEBUG(6,("**** onefs_ntimes: createtime: %s.%d\n",
+ time_to_asc(convert_timespec_to_time_t(ft->create_time)),
+ ft->create_time.tv_nsec));
+ }
+
+ return onefs_vtimes_streams(handle, fname, flags, times);
+}
+
static uint32_t onefs_fs_capabilities(struct vfs_handle_struct *handle)
{
return SMB_VFS_NEXT_FS_CAPABILITIES(handle) | FILE_NAMED_STREAMS;
@@ -92,6 +125,8 @@ static vfs_op_tuple onefs_ops[] = {
SMB_VFS_LAYER_TRANSPARENT},
{SMB_VFS_OP(onefs_unlink), SMB_VFS_OP_UNLINK,
SMB_VFS_LAYER_TRANSPARENT},
+ {SMB_VFS_OP(onefs_ntimes), SMB_VFS_OP_NTIMES,
+ SMB_VFS_LAYER_OPAQUE},
{SMB_VFS_OP(onefs_chflags), SMB_VFS_OP_CHFLAGS,
SMB_VFS_LAYER_TRANSPARENT},
{SMB_VFS_OP(onefs_streaminfo), SMB_VFS_OP_STREAMINFO,