// putMDInfo assumes that the parent directory of j.mdInfoPath(id)
// (which is j.mdPath(id)) has already been created.
330533
func (j mdJournal) putMDInfo(
	id kbfsmd.ID, timestamp time.Time, version kbfsmd.MetadataVer) error {
	info := mdInfo{timestamp, version}
	return ioutil.SerializeToJSONFile(info, j.mdInfoPath(id))
}
1195834
func (db *DirBlock) SetIndirectPtrInfo(i int, info BlockInfo) {
	if !db.IsInd {
		panic("SetIndirectPtrInfo called on a direct directory block")
	}
	db.IPtrs[i].BlockInfo = info
}
1026318
func mongoInfo(dataDir, machineId string) (*mongo.MongoInfo, error) {
	path := agent.ConfigPath(dataDir, names.NewMachineTag(machineId))
	config, err := agent.ReadConfig(path)
	if err != nil {
		return nil, errors.Trace(err)
	}
	info, ok := config.MongoInfo()
	if !ok {
		return nil, errors.Errorf("no mongo info found in %q", path)
	}
	return info, nil
}
424077
func (m *MultiMap) Put(key interface{}, value interface{}) {
	m.m[key] = append(m.m[key], value)
}
1360194
func (d *driver) PutContent(ctx context.Context, p string, contents []byte) error {
	d.mutex.Lock()
	defer d.mutex.Unlock()

	normalized := normalize(p)

	f, err := d.root.mkfile(normalized)
	if err != nil {
		// TODO(stevvooe): Again, we need to clarify when this is not a
		// directory in StorageDriver API.
		return fmt.Errorf("not a file")
	}

	f.truncate()
	f.WriteAt(contents, 0)

	return nil
}
1227880
func (s *Service) PutOrganization(ctx context.Context, o *platform.Organization) error {
	s.organizationKV.Store(o.ID.String(), o)
	return nil
}
843111
func (c *container) Put(name string, r io.Reader, size int64, metadata map[string]interface{}) (stow.Item, error) {
	mdPrepped, err := prepMetadata(metadata)
	if err != nil {
		return nil, errors.Wrap(err, "unable to create or update Item, preparing metadata")
	}

	_, err = c.client.ObjectPut(c.id, name, r, false, "", "", nil)
	if err != nil {
		return nil, errors.Wrap(err, "unable to create or update Item")
	}

	err = c.client.ObjectUpdate(c.id, name, mdPrepped)
	if err != nil {
		return nil, errors.Wrap(err, "unable to update Item metadata")
	}

	item := &item{
		id:        name,
		container: c,
		client:    c.client,
		size:      size,
		// not setting metadata here, the refined version isn't available
		// unless an explicit getItem() is done. Possible to write a func to facilitate
		// this.
	}
	return item, nil
}
282450
func (fup *folderUpdatePrepper) cacheBlockInfos(infos []data.BlockInfo) {
	fup.cacheLock.Lock()
	defer fup.cacheLock.Unlock()
	if fup.cachedInfos == nil {
		fup.cachedInfos = make(map[data.BlockPointer]data.BlockInfo)
	}
	for _, info := range infos {
		fup.cachedInfos[info.BlockPointer] = info
	}
}
1171353
func NewFileInfo(name string, size int64, mode os.FileMode, modTime, accessTime time.Time) *FileInfo {
	return &FileInfo{
		name:       filepath.Base(name),
		size:       size,
		mode:       mode & (os.ModePerm | os.ModeDir),
		modTime:    modTime,
		accessTime: accessTime,
	}
}
540891
func readMiscInfo(mdmp *Minidump, buf *minidumpBuf) {
	buf.u32() // size of info
	buf.u32() // flags1

	mdmp.Pid = buf.u32() // process_id
	// there are more fields here, but we don't care about them
}
320193
func (md *MDServerDisk) Put(ctx context.Context, rmds *RootMetadataSigned,
	extra kbfsmd.ExtraMetadata, _ *keybase1.LockContext, _ keybase1.MDPriority) error {
	if err := checkContext(ctx); err != nil {
		return err
	}

	session, err := md.config.currentSessionGetter().GetCurrentSession(ctx)
	if err != nil {
		return kbfsmd.ServerError{Err: err}
	}

	tlfStorage, err := md.getStorage(rmds.MD.TlfID())
	if err != nil {
		return err
	}

	recordBranchID, err := tlfStorage.put(
		ctx, session.UID, session.VerifyingKey, rmds, extra)
	if err != nil {
		return err
	}

	// Record branch ID
	if recordBranchID {
		err = md.putBranchID(ctx, rmds.MD.TlfID(), rmds.MD.BID())
		if err != nil {
			return kbfsmd.ServerError{Err: err}
		}
	}

	mStatus := rmds.MD.MergedStatus()
	if mStatus == kbfsmd.Merged &&
		// Don't send notifies if it's just a rekey (the real mdserver
		// sends a "folder needs rekey" notification in this case).
		!(rmds.MD.IsRekeySet() && rmds.MD.IsWriterMetadataCopiedSet()) {
		md.updateManager.setHead(rmds.MD.TlfID(), md)
	}

	return nil
}
224661
func (c *addImageMetadataCommand) Info() *cmd.Info {
	return jujucmd.Info(&cmd.Info{
		Name:    "add-image",
		Purpose: "adds image metadata to model",
		Doc:     addImageCommandDoc,
	})
}
1259236
func (d *RawData) SetInfo(info interface{}, args ...int) Data {
	d.Info = info
	if len(args) > 0 {
		d.SetCode(args[0])
	}
	return d
}
931376
func (k *KeybaseDaemonLocal) PutGitMetadata(
	ctx context.Context, folder keybase1.Folder, repoID keybase1.RepoID,
	metadata keybase1.GitLocalMetadata) error {
	return nil
}
570933
func (s *DirectoryClient) Put(ctx context.Context, input *PutDirectoryInput) error {
	absPath := absFileInput(s.client.AccountName, input.DirectoryName)

	headers := &http.Header{}
	headers.Set("Content-Type", "application/json; type=directory")

	reqInput := client.RequestInput{
		Method:  http.MethodPut,
		Path:    string(absPath),
		Headers: headers,
	}
	respBody, _, err := s.client.ExecuteRequestStorage(ctx, reqInput)
	if respBody != nil {
		defer respBody.Close()
	}
	if err != nil {
		return errors.Wrap(err, "unable to put directory")
	}

	return nil
}
737339
func (c *Container) Put(name string, r io.Reader, size int64, metadata map[string]interface{}) (stow.Item, error) {
	mdPrepped, err := prepMetadata(metadata)
	if err != nil {
		return nil, err
	}

	object := &storage.Object{
		Name:     name,
		Metadata: mdPrepped,
	}

	res, err := c.client.Objects.Insert(c.name, object).Media(r).Do()
	if err != nil {
		return nil, err
	}

	t, err := time.Parse(time.RFC3339, res.Updated)
	if err != nil {
		return nil, err
	}

	u, err := prepUrl(res.MediaLink)
	if err != nil {
		return nil, err
	}

	mdParsed, err := parseMetadata(res.Metadata)
	if err != nil {
		return nil, err
	}

	newItem := &Item{
		name:         name,
		container:    c,
		client:       c.client,
		size:         size,
		etag:         res.Etag,
		hash:         res.Md5Hash,
		lastModified: t,
		url:          u,
		metadata:     mdParsed,
		object:       res,
	}
	return newItem, nil
}
858288
func (d *Driver) Put(id string) error {
	logrus.Debugf("Releasing chain FS for %s", id)

	cID := C.CString(id)
	_, err := C.release_chainfs(cID)

	// C.release_cache()

	return err
}