Skip to content

Commit

Permalink
follow-up
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Aizman <[email protected]>
  • Loading branch information
alex-aizman committed Dec 24, 2023
1 parent e8fc889 commit ab88089
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cluster/ct.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ func (ct *CT) Make(toType string, pref ...string /*optional prefix*/) string {
// Save CT to local drives. If workFQN is set, it saves in two steps: first,
// save to workFQN; second, rename workFQN to ct.FQN. If unset, it writes
// directly to ct.FQN
func (ct *CT) Write(t Target, reader io.Reader, size int64, workFQN ...string) (err error) {
func (ct *CT) Write(reader io.Reader, size int64, workFQN ...string) (err error) {
bdir := ct.mi.MakePathBck(ct.Bucket())
if err := cos.Stat(bdir); err != nil {
return err
}
buf, slab := t.PageMM().Alloc()
buf, slab := g.pmm.Alloc()
if len(workFQN) == 0 {
_, err = cos.SaveReader(ct.fqn, reader, buf, cos.ChecksumNone, size)
} else {
Expand Down
6 changes: 3 additions & 3 deletions ec/ec.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,10 @@ func WriteSliceAndMeta(hdr *transport.ObjHdr, args *WriteArgs) error {
}
}
tmpFQN := ct.Make(fs.WorkfileType)
if err := ct.Write(cluster.T, args.Reader, hdr.ObjAttrs.Size, tmpFQN); err != nil {
if err := ct.Write(args.Reader, hdr.ObjAttrs.Size, tmpFQN); err != nil {
return err
}
if err := ctMeta.Write(cluster.T, bytes.NewReader(args.MD), -1); err != nil {
if err := ctMeta.Write(bytes.NewReader(args.MD), -1); err != nil {
return err
}
if _, exists := cluster.T.Bowner().Get().Get(ctMeta.Bck()); !exists {
Expand Down Expand Up @@ -502,7 +502,7 @@ func WriteReplicaAndMeta(lom *cluster.LOM, args *WriteArgs) (err error) {
nlog.Errorf("nested error: save replica -> remove metafile: %v", rmErr)
}
}()
if err = ctMeta.Write(cluster.T, bytes.NewReader(args.MD), -1); err != nil {
if err = ctMeta.Write(bytes.NewReader(args.MD), -1); err != nil {
return
}
if _, exists := cluster.T.Bowner().Get().Get(ctMeta.Bck()); !exists {
Expand Down
2 changes: 1 addition & 1 deletion ec/getjogger.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (c *getJogger) restoreReplicatedFromDisk(ctx *restoreCtx) error {

b := cos.MustMarshal(ctx.meta)
ctMeta := cluster.NewCTFromLOM(ctx.lom, fs.ECMetaType)
if err := ctMeta.Write(cluster.T, bytes.NewReader(b), -1); err != nil {
if err := ctMeta.Write(bytes.NewReader(b), -1); err != nil {
return err
}
if _, exists := cluster.T.Bowner().Get().Get(ctMeta.Bck()); !exists {
Expand Down
2 changes: 1 addition & 1 deletion ec/putjogger.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (c *putJogger) encode(req *request, lom *cluster.LOM) error {
return err
}
metaBuf := bytes.NewReader(meta.NewPack())
if err := ctMeta.Write(cluster.T, metaBuf, -1); err != nil {
if err := ctMeta.Write(metaBuf, -1); err != nil {
return err
}
if _, exists := cluster.T.Bowner().Get().Get(ctMeta.Bck()); !exists {
Expand Down
2 changes: 1 addition & 1 deletion reb/recv.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func receiveMD(req *stageNtfn, hdr *transport.ObjHdr) error {
md.Daemons = req.md.Daemons
mdBytes := md.NewPack()

return ctMeta.Write(cluster.T, bytes.NewReader(mdBytes), -1)
return ctMeta.Write(bytes.NewReader(mdBytes), -1)
}

func (reb *Reb) receiveCT(req *stageNtfn, hdr *transport.ObjHdr, reader io.Reader) error {
Expand Down

0 comments on commit ab88089

Please sign in to comment.