From: Jeremy Allison Date: Wed, 23 Jun 2021 18:45:25 +0000 (-0700) Subject: s3: VFS: ceph_snapshots: Remove ceph_snap_get_btime(). X-Git-Tag: tevent-0.11.0~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f04e1a47dfeb9848b995329bf82744df0bbae3d;p=thirdparty%2Fsamba.git s3: VFS: ceph_snapshots: Remove ceph_snap_get_btime(). No longer used. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c index 3b2289d37d6..26844e50187 100644 --- a/source3/modules/vfs_ceph_snapshots.c +++ b/source3/modules/vfs_ceph_snapshots.c @@ -48,73 +48,6 @@ */ #define CEPH_SNAP_BTIME_XATTR "ceph.snap.btime" -#if 0 -static int ceph_snap_get_btime(struct vfs_handle_struct *handle, - struct smb_filename *smb_fname, - time_t *_snap_secs) -{ - int ret; - char snap_btime[33]; - char *s = NULL; - char *endptr = NULL; - struct timespec snap_timespec; - int err; - - ret = SMB_VFS_NEXT_GETXATTR(handle, smb_fname, CEPH_SNAP_BTIME_XATTR, - snap_btime, sizeof(snap_btime)); - if (ret < 0) { - DBG_ERR("failed to get %s xattr: %s\n", - CEPH_SNAP_BTIME_XATTR, strerror(errno)); - return -errno; - } - - if (ret == 0 || ret >= sizeof(snap_btime) - 1) { - return -EINVAL; - } - - /* ensure zero termination */ - snap_btime[ret] = '\0'; - - /* format is sec.nsec */ - s = strchr(snap_btime, '.'); - if (s == NULL) { - DBG_ERR("invalid %s xattr value: %s\n", - CEPH_SNAP_BTIME_XATTR, snap_btime); - return -EINVAL; - } - - /* First component is seconds, extract it */ - *s = '\0'; - snap_timespec.tv_sec = smb_strtoull(snap_btime, - &endptr, - 10, - &err, - SMB_STR_FULL_STR_CONV); - if (err != 0) { - return -err; - } - - /* second component is nsecs */ - s++; - snap_timespec.tv_nsec = smb_strtoul(s, - &endptr, - 10, - &err, - SMB_STR_FULL_STR_CONV); - if (err != 0) { - return -err; - } - - /* - * >> 30 is a rough divide by ~10**9. No need to be exact, as @GMT - * tokens only offer 1-second resolution (while twrp is nsec). - */ - *_snap_secs = snap_timespec.tv_sec + (snap_timespec.tv_nsec >> 30); - - return 0; -} -#endif - static int ceph_snap_get_btime_fsp(struct vfs_handle_struct *handle, struct files_struct *fsp, time_t *_snap_secs)