// Unstage ensures that the resource is removed
// from the staging area. If it isn't in the staging area
// then this is a noop.
175909
func (staged StagedResource) Unstage() error {
	buildTxn := func(attempt int) ([]txn.Op, error) {
		if attempt > 0 {
			// The op has no assert so we should not get here.
			return nil, errors.New("unstaging the resource failed")
		}

		ops := newRemoveStagedResourceOps(staged.id)
		return ops, nil
	}
	if err := staged.base.Run(buildTxn); err != nil {
		return errors.Trace(err)
	}
	return nil
}
139186
func InvertStages(stages []audit.Stage) []audit.Stage {
	s := ConvertStagesToStrings(stages)
	a := AllStages()
	a.Delete(s...)
	return ConvertStringSetToStages(a)
}
1049995
func (all *assetLruList) remove(alle *assetLruListElement) *assetLruListElement {
	alle.prev.next = alle.next
	alle.next.prev = alle.prev
	alle.next = nil // avoid memory leaks
	alle.prev = nil // avoid memory leaks
	alle.list = nil
	all.len--
	return alle
}
704852
func (n *Mounter) Unmount(target string) error {
	args := []string{target}
	// No need to execute systemd-run here, it's enough that unmount is executed
	// in the host's mount namespace. It will finish appropriate fuse daemon(s)
	// running in any scope.
	klog.V(5).Infof("nsenter unmount args: %v", args)
	outputBytes, err := n.ne.Exec("umount", args).CombinedOutput()
	if len(outputBytes) != 0 {
		klog.V(5).Infof("Output of unmounting %s: %v", target, string(outputBytes))
	}
	return err
}
511089
func (rs Resources) Unallocate() Resources {
	for i := range rs {
		rs[i].AllocationInfo = nil
	}
	return rs
}
1021469
func (s *Store) UnpinLease(key lease.Key, entity string, stop <-chan struct{}) error {
	return errors.Trace(s.pinOp(OperationUnpin, key, entity, stop))
}
56119
func (a *audioLoader) Unload(url string) error {
	delete(a.audios, url)
	return nil
}
1228779
func (pq *PrefixQueue) Drop() error {
	if err := pq.Close(); err != nil {
		return err
	}

	return os.RemoveAll(pq.DataDir)
}
545762
func (linux *upstartRecord) Remove() (string, error) {
	removeAction := "Removing " + linux.description + ":"

	if ok, err := checkPrivileges(); !ok {
		return removeAction + failed, err
	}

	if !linux.isInstalled() {
		return removeAction + failed, ErrNotInstalled
	}

	if err := os.Remove(linux.servicePath()); err != nil {
		return removeAction + failed, err
	}

	return removeAction + success, nil
}
1056627
func (c *Client) Unregister(reg fab.Registration) {
	c.eventService.Unregister(reg)
}
879765
func (i *fontLoader) Unload(url string) error {
	delete(i.fonts, url)
	return nil
}
876553
func (ph *Manager) Unhandle(pl Plugin) {
	close(ph.closers[pl.Name()])
	delete(ph.closers, pl.Name())

	for _, sub := range pl.Subscribes() {
		delete(ph.subscriptions[sub], pl.Name())
	}

	delete(ph.plugins, pl.Name())
}
387123
func (c *eventConnections) Unregister(client *Client) {
	if _, ok := c.connections[client]; ok {
		delete(c.connections, client)
	}
}
1239159
func (rl *referencedRWLayer) Unmount() error {
	return rl.layerStore.driver.Put(rl.mountedLayer.mountID)
}
50647
func (f *UnstageFile) Write(ctx context.Context, req *fuse.WriteRequest,
	resp *fuse.WriteResponse) (err error) {
	defer func() { err = f.folder.processError(ctx, libkbfs.WriteMode, err) }()
	size, err := libfs.UnstageForTesting(
		ctx, f.folder.fs.log, f.folder.fs.config,
		f.folder.getFolderBranch(), req.Data)
	if err != nil {
		return err
	}
	resp.Size = size
	return nil
}
176525
func (s *UpdateSecretVersionStageInput) SetVersionStage(v string) *UpdateSecretVersionStageInput {
	s.VersionStage = &v
	return s
}
784595
func (r *RoleV2) RemoveResource(kind string) {
	delete(r.Spec.Resources, kind)
}