[PATCH 1/2 v2] vfs_ceph: fix ntimes_fn callback

Michael Adam obnox at samba.org
Wed Mar 18 07:04:24 MDT 2015


Thanks!

The formatting is good now!

But let me be really nit-picky here: What I would like to
avoid is changing/fixing formatting of lines that
are otherwise not touched by the patch, in this case
the function header and the debug statement.

So if you would not mind, could you please send another
update of the patch that only does correct formatting
for the lines that are changed / added anyway?

Note that this is not intended to give you a hard time
but to explain how we would like to have the patches
so that in future contributions (that will hopefully
be plenty.. :-) formatting and patch hygiene will not
be an issue at all any more.

Thanks! - Michael


On 2015-03-18 at 11:34 +0800, Yan, Zheng wrote:
> add null timespec check for atime/mtime. Also add code that stores
> create_time by EA.
> 
> Signed-off-by: Yan, Zheng <zyan at redhat.com>
> ---
>  source3/modules/vfs_ceph.c | 33 ++++++++++++++++++++++++++-------
>  1 file changed, 26 insertions(+), 7 deletions(-)
> 
> diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
> index 0967428..6bf4dc5 100644
> --- a/source3/modules/vfs_ceph.c
> +++ b/source3/modules/vfs_ceph.c
> @@ -748,17 +748,36 @@ static char *cephwrap_getwd(struct vfs_handle_struct *handle)
>  }
>  
>  static int cephwrap_ntimes(struct vfs_handle_struct *handle,
> -			 const struct smb_filename *smb_fname,
> -			 struct smb_file_time *ft)
> +			   const struct smb_filename *smb_fname,
> +			   struct smb_file_time *ft)
>  {
>  	struct utimbuf buf;
>  	int result;
> -	buf.actime = ft->atime.tv_sec;
> -	buf.modtime = ft->mtime.tv_sec;
> +
> +	if (null_timespec(ft->atime)) {
> +		buf.actime = smb_fname->st.st_ex_atime.tv_sec;
> +	} else {
> +		buf.actime = ft->atime.tv_sec;
> +	}
> +	if (null_timespec(ft->mtime)) {
> +		buf.modtime = smb_fname->st.st_ex_mtime.tv_sec;
> +	} else {
> +		buf.modtime = ft->mtime.tv_sec;
> +	}
> +	if (!null_timespec(ft->create_time)) {
> +		set_create_timespec_ea(handle->conn, smb_fname,
> +				       ft->create_time);
> +	}
> +	if (buf.actime == smb_fname->st.st_ex_atime.tv_sec &&
> +	    buf.modtime == smb_fname->st.st_ex_mtime.tv_sec) {
> +		return 0;
> +	}
> +
>  	result = ceph_utime(handle->data, smb_fname->base_name, &buf);
> -	DEBUG(10, ("[CEPH] ntimes(%p, %s, {%ld, %ld, %ld, %ld}) = %d\n", handle, smb_fname_str_dbg(smb_fname),
> -				ft->mtime.tv_sec, ft->atime.tv_sec, ft->ctime.tv_sec,
> -				ft->create_time.tv_sec, result));
> +	DEBUG(10, ("[CEPH] ntimes(%p, %s, {%ld, %ld, %ld, %ld}) = %d\n",
> +		   handle, smb_fname_str_dbg(smb_fname),
> +		   ft->mtime.tv_sec, ft->atime.tv_sec, ft->ctime.tv_sec,
> +		   ft->create_time.tv_sec, result));
>  	return result;
>  }
>  
> -- 
> 1.9.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150318/4623ad2f/attachment.pgp>


More information about the samba-technical mailing list