MCPcopy
hub / github.com/cubefs/cubefs / InodeGetExt_ll

Method InodeGetExt_ll

sdk/meta/api.go:395–444  ·  view source on GitHub ↗
(inode uint64)

Source from the content-addressed store, hash-verified

393}
394
395func (mw *MetaWrapper) InodeGetExt_ll(inode uint64) (*proto.InodeInfo, error) {
396 start := time.Now()
397 defer func() {
398 log.LogDebugf("InodeGetExt_ll: time cost (%v), ino(%v)", time.Since(start), inode)
399 }()
400
401 wg := sync.WaitGroup{}
402 wg.Add(1)
403
404 var info *proto.InodeInfo
405 var getErr error
406
407 go func() {
408 defer wg.Done()
409 info, getErr = mw.InodeGet_ll(inode)
410 if getErr != nil {
411 log.LogErrorf("InodeGetExt_ll: get inode fail: ino(%v) err(%v)", inode, getErr)
412 return
413 }
414 }()
415
416 var resp *proto.GetExtentsResponse
417 var getExtErr error
418 wg.Add(1)
419 go func() {
420 defer wg.Done()
421 mp := mw.getPartitionByInode(inode)
422 if mp == nil {
423 return
424 }
425
426 resp, getExtErr = mw.getExtents(mp, inode, false, false, false)
427 if getExtErr != nil {
428 log.LogErrorf("InodeGetExt_ll: get extents fail: ino(%v) err(%v)", inode, getExtErr)
429 return
430 }
431 }()
432
433 wg.Wait()
434
435 if getErr != nil {
436 return nil, getErr
437 }
438
439 if info != nil && getExtErr == nil {
440 info.Extents = resp
441 }
442
443 return info, nil
444}
445
446func (mw *MetaWrapper) InodeGet_ll(inode uint64) (*proto.InodeInfo, error) {
447 mp := mw.getPartitionByInode(inode)

Callers 1

InodeGetMethod · 0.80

Calls 8

InodeGet_llMethod · 0.95
getPartitionByInodeMethod · 0.95
getExtentsMethod · 0.95
LogDebugfFunction · 0.92
LogErrorfFunction · 0.92
DoneMethod · 0.65
WaitMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected