mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(flash_cache): optimize get inode meta info when prepareCacheRequests.#22240020
Signed-off-by: baihailong <baihailong@oppo.com>
This commit is contained in:
parent
3cbf7153ea
commit
d6b862922d
@ -239,6 +239,7 @@ func NewSuper(opt *proto.MountOptions) (s *Super, err error) {
|
||||
OnLoadBcache: s.bc.Get,
|
||||
OnCacheBcache: s.bc.Put,
|
||||
OnEvictBcache: s.bc.Evict,
|
||||
OnGetInodeInfo: s.InodeGet,
|
||||
|
||||
DisableMetaCache: DisableMetaCache,
|
||||
MinWriteAbleDataPartitionCnt: opt.MinWriteAbleDataPartitionCnt,
|
||||
|
||||
@ -140,6 +140,7 @@ type ExtentConfig struct {
|
||||
OnLoadBcache LoadBcacheFunc
|
||||
OnCacheBcache CacheBcacheFunc
|
||||
OnEvictBcache EvictBacheFunc
|
||||
OnGetInodeInfo GetInodeInfoFunc
|
||||
|
||||
DisableMetaCache bool
|
||||
MinWriteAbleDataPartitionCnt int
|
||||
@ -207,11 +208,12 @@ type ExtentClient struct {
|
||||
InnerReq bool
|
||||
AheadRead *AheadReadCache
|
||||
|
||||
extentConfig *ExtentConfig
|
||||
RemoteCache RemoteCache
|
||||
stopOnce sync.Once
|
||||
stopCh chan struct{}
|
||||
wg sync.WaitGroup
|
||||
extentConfig *ExtentConfig
|
||||
RemoteCache RemoteCache
|
||||
stopOnce sync.Once
|
||||
stopCh chan struct{}
|
||||
wg sync.WaitGroup
|
||||
getInodeInfo GetInodeInfoFunc
|
||||
}
|
||||
|
||||
func (client *ExtentClient) UidIsLimited(uid uint32) bool {
|
||||
|
||||
@ -164,7 +164,11 @@ func (s *Streamer) prepareCacheRequests(offset, size uint64, data []byte) ([]*Ca
|
||||
log.LogWarnf("Streamer prepareCacheRequests: getDataSource failed. fixedOff(%v) err(%v)", fixedOff, err)
|
||||
return nil, err
|
||||
}
|
||||
info, _ := s.client.metaWrapper.InodeGet_ll(s.inode)
|
||||
info, err := s.client.getInodeInfo(s.inode)
|
||||
if err != nil {
|
||||
log.LogWarnf("Streamer prepareCacheRequests: getInodeInfo failed. fixedOff(%v) err(%v)", fixedOff, err)
|
||||
return nil, err
|
||||
}
|
||||
gen := info.Generation
|
||||
|
||||
cReq := &proto.CacheRequest{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user