Skip to content

Commit

Permalink
adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijian-pro committed Mar 28, 2023
1 parent 3afb9b2 commit aadb38c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/meta/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ type dirStats struct {
}

type detachedNode struct {
Inode Ino `xorm:"pk notnull"`
Expire int64 `xorm:"notnull"`
Inode Ino `xorm:"pk notnull"`
Added int64 `xorm:"notnull"`
}

type dirQuota struct {
Expand Down Expand Up @@ -3997,7 +3997,7 @@ func (m *dbMeta) mkNodeWithAttr(ctx Context, s *xorm.Session, srcIno Ino, srcNod
}

if !attach {
return mustInsert(s, &detachedNode{Inode: *dstIno, Expire: time.Now().Unix()})
return mustInsert(s, &detachedNode{Inode: *dstIno, Added: time.Now().Unix()})
}
if attach {
// set edge
Expand All @@ -4010,7 +4010,7 @@ func (m *dbMeta) doFindDetachedNodes(t time.Time) []Ino {
var detachedNodes []Ino
if err := m.roTxn(func(s *xorm.Session) error {
var nodes []detachedNode
err := s.Where("expire < ?", t).Find(&nodes)
err := s.Where("added < ?", t).Find(&nodes)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/meta/tkv.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ All keys:
SHssssssss session heartbeat // for legacy client
SIssssssss session info
SSssssssssiiiiiiii sustained inode
Niiiiiiii detached inodes
Uiiiiiiii data length, space and inodes usage in directory
QDiiiiiiii directory quota
Niiiiiiii detached inodes
*/

func (m *kvMeta) inodeKey(inode Ino) []byte {
Expand Down

0 comments on commit aadb38c

Please sign in to comment.