// Remove removes any underlying files stored on disk for this reader.
339364
func (t *TSMReader) remove() error {
	path := t.accessor.path()

	if t.InUse() {
		return ErrFileInUse
	}

	if path != "" {
		if err := os.RemoveAll(path); err != nil {
			return err
		} else if err := os.RemoveAll(StatsFilename(path)); err != nil && !os.IsNotExist(err) {
			return err
		}
	}

	if err := t.tombstoner.Delete(); err != nil {
		return err
	}
	return nil
}
691801
func (s *GRPCStorage) Remove(ctx context.Context, fn *FileNameMsg) (*google_protobuf.Empty, error) {
	return &google_protobuf.Empty{}, s.backend.Remove(fn.FileName)
}
402629
func (c *LRU) Remove(key interface{}) (present bool) {
	if ent, ok := c.items[key]; ok {
		c.removeElement(ent)
		return true
	}
	return false
}
318491
func (u *Unit) Remove() error {
	_, err := u.RemoveWithForce(false, time.Duration(0))
	return err
}
1327306
func (fs *Filespace) Remove(subPath string) error {
	return fs.root.Remove(subPath, true)
}
1219207
func (d *Driver) Remove(id string) error {
	name := d.zfsPath(id)
	dataset := zfs.Dataset{Name: name}
	err := dataset.Destroy(zfs.DestroyRecursive)
	if err == nil {
		d.Lock()
		delete(d.filesystemsCache, name)
		d.Unlock()
	}
	return err
}
629766
func (c *Client) Remove(name string) error {
	return delete(c, name, false)
}
455660
func (t *TSMReader) Remove() error {
	t.mu.Lock()
	defer t.mu.Unlock()
	return t.remove()
}
497851
func (c *Container) remove(v uint16) (removed bool) {
	if c.isArray() {
		removed = c.arrayRemove(v)
	} else if c.isRun() {
		removed = c.runRemove(v)
	} else {
		removed = c.bitmapRemove(v)
	}
	return removed
}
868223
func (fs *Filespace) Remove(subPath string) error {
	return os.Remove(fs.path + subPath)
}
180371
func (c *Ctrie) Remove(key []byte) (interface{}, bool) {
	c.assertReadWrite()
	return c.remove(&Entry{Key: key, hash: c.hash(key)})
}
663865
func (fs *fakeFs) Remove(name string) error {
	return fs.a.Remove(name)
}
782069
func (d *Dir) Remove(ctx context.Context, req *fuse.RemoveRequest) (err error) {
	ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Remove",
		fmt.Sprintf("%s %s", d.node.GetBasename(), req.Name))
	defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()

	d.folder.fs.vlog.CLogf(ctx, libkb.VLog1, "Dir Remove %s", req.Name)
	defer func() { err = d.folder.processError(ctx, libkbfs.WriteMode, err) }()

	// This fits in situation 1 as described in libkbfs/delayed_cancellation.go
	err = libcontext.EnableDelayedCancellationWithGracePeriod(
		ctx, d.folder.fs.config.DelayedCancellationGracePeriod())
	if err != nil {
		return err
	}

	// node will be removed from Folder.nodes, if it is there in the
	// first place, by its Forget

	if req.Dir {
		err = d.folder.fs.config.KBFSOps().RemoveDir(ctx, d.node, req.Name)
	} else {
		err = d.folder.fs.config.KBFSOps().RemoveEntry(ctx, d.node, req.Name)
	}
	if err != nil {
		return err
	}

	return nil
}
1165617
func (v *Volume) Remove(ctx context.Context) error {
	if v.external {
		fmt.Printf("Volume %s is external, skipping", v.fullName())
		return nil
	}
	fmt.Printf("Removing volume %q\n", v.fullName())
	return v.client.VolumeRemove(ctx, v.fullName(), true)
}
493065
func (s *blockDiskStore) remove(ctx context.Context, id kbfsblock.ID) error {
	cleanup, err := s.exclusify(ctx, id)
	if err != nil {
		return err
	}
	defer cleanup()

	hasAnyRef, err := s.hasAnyRefExclusive(id)
	if err != nil {
		return err
	}
	if hasAnyRef {
		return errors.Errorf(
			"Trying to remove data for referenced block %s", id)
	}
	path := s.blockPath(id)

	err = ioutil.RemoveAll(path)
	if err != nil {
		return err
	}

	// Remove the parent (splayed) directory if it exists and is
	// empty.
	err = ioutil.Remove(filepath.Dir(path))
	if ioutil.IsNotExist(err) || ioutil.IsExist(err) {
		err = nil
	}
	return err
}
1258823
func (lfs localFileSystem) Remove(fn string) error {
	return villa.Path(fn).RemoveAll()
}
547725
func (d *DeviceMapperDriver) Remove(volumeName string) error {
	glog.V(2).Infof("Remove() (%s) START", volumeName)
	defer glog.V(2).Infof("Remove() (%s) END", volumeName)
	if !d.Exists(volumeName) {
		return nil
	}
	// get the volume
	v, err := d.getVolume(volumeName, false)
	if err != nil {
		//log the error, but continue trying to remove things
		glog.Errorf("Error loading volume %s: %s", volumeName, err)
	} else {
		// remove the snapshots
		glog.V(1).Infof("Removing snapshots from %s", volumeName)
		snapshots, err := v.Snapshots()
		if err != nil {
			glog.Errorf("Error getting list of snapshots for volume %s: %s", volumeName, err)
		} else {
			for _, snapshot := range snapshots {
				if err := v.RemoveSnapshot(snapshot); err != nil {
					glog.Errorf("Could not remove snapshot: %s", err)
				}
			}
		}

		// Release the device (requires another call to getVolume)
		if err := d.Release(volumeName); err != nil {
			glog.V(1).Infof("Error releasing device: %s", err)
		}

		// Delete the device
		glog.V(1).Infof("Removing volume %s", volumeName)
		if err := d.deleteDevice(v.deviceHash(), false); err != nil {
			glog.Errorf("Could not delete device %s: %s", volumeName, err)
		}
	}

	// Remove the metadata directory
	if err := os.RemoveAll(filepath.Join(d.MetadataDir(), volumeName)); err != nil {
		return err
	}
	return nil
}