Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Aug 28, 2024
1 parent 6cc8ca7 commit 57c749e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
9 changes: 0 additions & 9 deletions pkg/storage/fs/cephfs/cephfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ func (fs *cephfs) CreateDir(ctx context.Context, ref *provider.Reference) error
if err = cv.mount.MakeDir(path, fs.conf.DirPerms); err != nil {
return
}

//TODO(tmourati): Add entry id logic
})

return getRevaError(err)
Expand All @@ -163,8 +161,6 @@ func (fs *cephfs) Delete(ctx context.Context, ref *provider.Reference) (err erro
if err = cv.mount.Unlink(path); err != nil && err.Error() == errIsADirectory {
err = cv.mount.RemoveDir(path)
}

//TODO(tmourati): Add entry id logic
})

//has already been deleted by direct mount
Expand All @@ -189,8 +185,6 @@ func (fs *cephfs) Move(ctx context.Context, oldRef, newRef *provider.Reference)
if err = cv.mount.Rename(oldPath, newPath); err != nil {
return
}

//TODO(tmourati): Add entry id logic, handle already moved file error
})

// has already been moved by direct mount
Expand Down Expand Up @@ -306,7 +300,6 @@ func (fs *cephfs) RestoreRevision(ctx context.Context, ref *provider.Reference,
}

func (fs *cephfs) GetPathByID(ctx context.Context, id *provider.ResourceId) (str string, err error) {
//TODO(tmourati): Add entry id logic
return "", errtypes.NotSupported("cephfs: ids currently not supported")
}

Expand Down Expand Up @@ -479,8 +472,6 @@ func (fs *cephfs) TouchFile(ctx context.Context, ref *provider.Reference) error
if file, err = cv.mount.Open(path, os.O_CREATE|os.O_WRONLY, fs.conf.FilePerms); err != nil {
return
}

//TODO(tmourati): Add entry id logic
})

return getRevaError(err)
Expand Down
7 changes: 1 addition & 6 deletions pkg/storage/fs/cephfs/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
package cephfs

import (
"path/filepath"

"github.com/cs3org/reva/pkg/sharedconf"
)

Expand All @@ -35,8 +33,6 @@ type Options struct {
IndexPool string `mapstructure:"index_pool"`
Keyring string `mapstructure:"keyring"`
Root string `mapstructure:"root"`
ShadowFolder string `mapstructure:"shadow_folder"`
ShareFolder string `mapstructure:"share_folder"`
UploadFolder string `mapstructure:"uploads"`
UserLayout string `mapstructure:"user_layout"`
DirPerms uint32 `mapstructure:"dir_perms"`
Expand Down Expand Up @@ -77,7 +73,6 @@ func (c *Options) ApplyDefaults() {
if c.UploadFolder == "" {
c.UploadFolder = ".uploads"
}
c.UploadFolder = filepath.Join(c.ShadowFolder, c.UploadFolder)

if c.UserLayout == "" {
c.UserLayout = "{{.Username}}"
Expand All @@ -86,7 +81,7 @@ func (c *Options) ApplyDefaults() {
c.HiddenDirs = map[string]bool{
".": true,
"..": true,
removeLeadingSlash(c.ShadowFolder): true,
removeLeadingSlash(c.UploadFolder): true,
}

if c.DirPerms == 0 {
Expand Down
5 changes: 3 additions & 2 deletions pkg/storage/fs/cephfs/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ func (user *User) fileAsResourceInfo(cv *cacheVal, path string, stat *goceph.Cep
}
}

//TODO(tmourati): Add entry id logic here

var etag string
if isDir(_type) {
rctime, _ := cv.mount.GetXattr(path, "ceph.dir.rctime")
Expand All @@ -160,6 +158,9 @@ func (user *User) fileAsResourceInfo(cv *cacheVal, path string, stat *goceph.Cep
}
}

// cephfs does not provide checksums, so we cannot set it
// a 3rd party tool can add a checksum attribute and we can read it,
// if ever that is implemented.
var checksum provider.ResourceChecksum
checksum.Type = provider.ResourceChecksumType_RESOURCE_CHECKSUM_TYPE_UNSET

Expand Down

0 comments on commit 57c749e

Please sign in to comment.