]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: ceph_snapshots: Remove ceph_snap_get_btime().
authorJeremy Allison <jra@samba.org>
Wed, 23 Jun 2021 18:45:25 +0000 (11:45 -0700)
committerRalph Boehme <slow@samba.org>
Fri, 25 Jun 2021 15:53:31 +0000 (15:53 +0000)
No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_ceph_snapshots.c

index 3b2289d37d6fc189ec1a7ddb8f689483d886a80d..26844e5018771c42925589dbb4377181f6f96706 100644 (file)
  */
 #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)