mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-11 03:09:41 +08:00
* Add MFS command line options, extend existing mount functions for MFS, set defaults. * Directory listing and file stat. * Add a read-only MFS view. * Add mkdir and interface checks. * Add remove and rename functionality. * Implement all required write interfaces. * Adjust mount functions for other architechtures. * Merge branch 'master' into feat/10710-mfs-fuse-mount * Write a basic read/write test. * Write more basic tests, add a mutex to the file object, fix modtime. * Add a concurrency test, remove mutexes from file and directory structures. * Refactor naming(mfdir -> mfsdir) and add documentation. * Add CID retrieval through ipfs_cid xattr. * Add docs, add xattr listing, fix bugs for mv and stat, refactor. * Add MFS command line options, extend existing mount functions for MFS, set defaults. * docs phrasing * docs: Mounts.MFS * docs: warn about lazy-loaded DAGs * test: TEST_FUSE=1 ./t0030-mount.sh -v --------- Co-authored-by: Guillaume Michel <guillaumemichel@users.noreply.github.com> Co-authored-by: guillaumemichel <guillaume@michel.id> Co-authored-by: Marcin Rataj <lidel@lidel.org>
22 lines
597 B
Go
22 lines
597 B
Go
//go:build (linux || darwin || freebsd || netbsd || openbsd) && !nofuse
|
|
// +build linux darwin freebsd netbsd openbsd
|
|
// +build !nofuse
|
|
|
|
package mfs
|
|
|
|
import (
|
|
core "github.com/ipfs/kubo/core"
|
|
mount "github.com/ipfs/kubo/fuse/mount"
|
|
)
|
|
|
|
// Mount mounts MFS at a given location, and returns a mount.Mount instance.
|
|
func Mount(ipfs *core.IpfsNode, mountpoint string) (mount.Mount, error) {
|
|
cfg, err := ipfs.Repo.Config()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
allowOther := cfg.Mounts.FuseAllowOther
|
|
fsys := NewFileSystem(ipfs)
|
|
return mount.NewMount(ipfs.Process, fsys, mountpoint, allowOther)
|
|
}
|