mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-01 08:00:39 +08:00
minor
This commit is contained in:
parent
4b0c2a846b
commit
c2f18a10cb
@ -251,21 +251,23 @@ func (f *Filer) UpdateEntry(ctx context.Context, oldEntry, entry *Entry) (err er
|
|||||||
return f.Store.UpdateEntry(ctx, entry)
|
return f.Store.UpdateEntry(ctx, entry)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
Root = &Entry{
|
||||||
|
FullPath: "/",
|
||||||
|
Attr: Attr{
|
||||||
|
Mtime: time.Now(),
|
||||||
|
Crtime: time.Now(),
|
||||||
|
Mode: os.ModeDir | 0755,
|
||||||
|
Uid: OS_UID,
|
||||||
|
Gid: OS_GID,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
func (f *Filer) FindEntry(ctx context.Context, p util.FullPath) (entry *Entry, err error) {
|
func (f *Filer) FindEntry(ctx context.Context, p util.FullPath) (entry *Entry, err error) {
|
||||||
|
|
||||||
now := time.Now()
|
|
||||||
|
|
||||||
if string(p) == "/" {
|
if string(p) == "/" {
|
||||||
return &Entry{
|
return Root, nil
|
||||||
FullPath: p,
|
|
||||||
Attr: Attr{
|
|
||||||
Mtime: now,
|
|
||||||
Crtime: now,
|
|
||||||
Mode: os.ModeDir | 0755,
|
|
||||||
Uid: OS_UID,
|
|
||||||
Gid: OS_GID,
|
|
||||||
},
|
|
||||||
}, nil
|
|
||||||
}
|
}
|
||||||
entry, err = f.Store.FindEntry(ctx, p)
|
entry, err = f.Store.FindEntry(ctx, p)
|
||||||
if entry != nil && entry.TtlSec > 0 {
|
if entry != nil && entry.TtlSec > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user