From 610ffa1ce8e3e036db3e930602443e3ab451bf91 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Wed, 25 Feb 2015 11:43:27 +0800 Subject: [PATCH 2/2] vfs_ceph: remove cephwrap_init_stat_ex_from_stat() use init_stat_ex_from_stat() instead. Signed-off-by: Yan, Zheng --- source3/modules/vfs_ceph.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index 7cb8053..f543266 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -519,26 +519,6 @@ static int cephwrap_fsync(struct vfs_handle_struct *handle, files_struct *fsp) WRAP_RETURN(result); } -static void cephwrap_init_stat_ex_from_stat(struct stat_ex *dst, const struct stat *src) -{ - ZERO_STRUCT(*dst); - - dst->st_ex_dev = src->st_dev; - dst->st_ex_ino = src->st_ino; - dst->st_ex_mode = src->st_mode; - dst->st_ex_nlink = src->st_nlink; - dst->st_ex_uid = src->st_uid; - dst->st_ex_gid = src->st_gid; - dst->st_ex_rdev = src->st_rdev; - dst->st_ex_size = src->st_size; - dst->st_ex_atime.tv_sec = src->st_atime; - dst->st_ex_mtime.tv_sec = src->st_mtime; - dst->st_ex_ctime.tv_sec = src->st_ctime; - dst->st_ex_btime.tv_sec = src->st_mtime; - dst->st_ex_blksize = src->st_blksize; - dst->st_ex_blocks = src->st_blocks; -} - static int cephwrap_stat(struct vfs_handle_struct *handle, struct smb_filename *smb_fname) { @@ -564,7 +544,7 @@ static int cephwrap_stat(struct vfs_handle_struct *handle, stbuf.st_uid, stbuf.st_gid, llu(stbuf.st_rdev), llu(stbuf.st_size), llu(stbuf.st_blksize), llu(stbuf.st_blocks), llu(stbuf.st_atime), llu(stbuf.st_mtime), llu(stbuf.st_ctime))); } - cephwrap_init_stat_ex_from_stat(&(smb_fname->st), &stbuf); + init_stat_ex_from_stat(&smb_fname->st, &stbuf, lp_fake_dir_create_times(SNUM(handle->conn))); DEBUG(10, ("[CEPH] mode = 0x%x\n", smb_fname->st.st_ex_mode)); return result; } @@ -588,7 +568,7 @@ static int cephwrap_fstat(struct vfs_handle_struct *handle, files_struct *fsp, S llu(stbuf.st_blocks), llu(stbuf.st_atime), llu(stbuf.st_mtime), llu(stbuf.st_ctime))); } - cephwrap_init_stat_ex_from_stat(sbuf, &stbuf); + init_stat_ex_from_stat(sbuf, &stbuf, lp_fake_dir_create_times(SNUM(handle->conn))); DEBUG(10, ("[CEPH] mode = 0x%x\n", sbuf->st_ex_mode)); return result; } @@ -611,7 +591,7 @@ static int cephwrap_lstat(struct vfs_handle_struct *handle, if (result < 0) { WRAP_RETURN(result); } - cephwrap_init_stat_ex_from_stat(&(smb_fname->st), &stbuf); + init_stat_ex_from_stat(&smb_fname->st, &stbuf, lp_fake_dir_create_times(SNUM(handle->conn))); return result; } -- 1.9.3