Commit Graph

132 Commits

Author SHA1 Message Date
Paul Lindner 459c75410e all: more renaming of Camlistore to Perkeep
Change-Id: I118e3cbcf20d80afeffc84f001388c4556f21628
2018-01-30 03:02:56 -08:00
Brad Fitzpatrick 194d4f9443 blobserver, all: add contexts to ReceiveBlob, Fetch & million resulting deps
I had intended for this to be a small change.

I was going to just add context.Context to the BlobReceiver interface,
but then I saw blob.Fetcher could also use one, so I decided to do two
in one CL.

And then it got a bit infectious and ended up touching everything.

I ended up doing SubFetch in the process by necessity.

At a certain point I finally started using context.TODO() in a few
spots, but not too many. But removing context.TODO() will come in the
future. There are more blob storage interfaces lacking context, too,
like RemoveBlobs.

Updates #733

Change-Id: Idf273180b3f8e397ac5929c6d7f520ccc5cdce08
2018-01-18 16:22:16 -08:00
Paul Lindner b88b82f1ee all: convert imports of golang.org/x/net/context to context
Change-Id: I01cfa903ab2b97a1ad3ea57eb29fe88819216a3f
2018-01-13 16:37:49 -08:00
Brad Fitzpatrick 38f10a7bd0 all, testhooks: use sha224 by default, add hook for some tests to use sha-1
Remove the blob.SHA{1,224}From{Bytes,String} constructors too. No
longer used. This adds blob.RefFromBytes which was missing. We had
blob.RefFromString. Now everything uses blob.RefFrom* instead of
specifying a hash function.

Some tests set a flag to force use of SHA-1 because there was too much
golden data to update. We can remove those one-by-one over time as we
fix up tests.

Updates #537

Change-Id: Ibe6428089a6221594c2b751f53f98b03b5a28dc2
2018-01-09 20:03:38 -08:00
Brad Fitzpatrick 617ac40512 all: rename cammount to pk-mount
Updates #981

Change-Id: Ie1d2e3c0fd7e2b7a7801ceac0fd8f93f62d56651
2018-01-08 09:54:41 -08:00
Brad Fitzpatrick 9265c980de all: change github.com/camlistore/camlistore to github.com/perkeep/perkeep
Change-Id: I0d612bf450e9e8d9ce0767c5a0cb0c44c0d8704f
2018-01-05 19:49:59 -08:00
Brad Fitzpatrick 57648c6b83 all: update copyright holder from Google Inc to The Perkeep Authors
The AUTHORS file is the list of copyright holders.
2018-01-03 16:52:49 -08:00
Brad Fitzpatrick d6a0b05df0 Rename import paths from camlistore.org to perkeep.org.
Part of the project renaming, issue #981.

After this, users will need to mv their $GOPATH/src/camlistore.org to
$GOPATH/src/perkeep.org. Sorry.

This doesn't yet rename the tools like camlistored, camput, camget,
camtool, etc.

Also, this only moves the lru package to internal. More will move to
internal later.

Also, this doesn't yet remove the "/pkg/" directory. That'll likely
happen later.

This updates some docs, but not all.

devcam test now passes again, even with Go 1.10 (which requires vet
checks are clean too). So a bunch of vet tests are fixed in this CL
too, and a bunch of other broken tests are now fixed (introduced from
the past week of merging the CL backlog).

Change-Id: If580db1691b5b99f8ed6195070789b1f44877dd4
2018-01-01 16:03:34 -08:00
Hernan Grecco 2df2ac4f1d pkg/fs: implement magic folder "versions" in fuse
A file is shown as folder and inside you can see all its versions (named according
to the date). Basically is like `at` but the path (not the date) goes first.

So if you go to:

    $ ls  <mountpoint>/versions/my_folder
    dr-x------  1 grecco  32000  0 Mar 13 01:39 my_file

and then:

    $ ls  <mountpoint>/versions/my_folder/my_file
    -r--------  1 grecco  32000   2 Mar 13 01:39 2014-03-12T14:53:34.471588505Z
    -r--------  1 grecco  32000   2 Mar 13 01:39 2014-03-12T14:53:36.6569929Z
    -r--------  1 grecco  32000   2 Mar 13 01:39 2014-03-12T14:53:38.842875168Z
    -r--------  1 grecco  32000  25 Mar 13 01:39 2014-03-12T21:16:09.905612807Z

These files are standard files which can be opened to see the file content as a
specific point of time.

Change-Id: I38a4d7bf35ba32407036535e629039e23dc32735
2017-12-29 20:52:38 -08:00
Paul Lindner d81b001d24 cmd/cammount: add more documentation and examples to help people get started with PerkeepFs
Fixes #789

Change-Id: I9f0d0a8a823902ed2ae1bf83d4a5b58fadac1d7d
2017-12-19 15:32:33 -08:00
Paul Lindner 1383869054 all: lint fixes for "receiver name should be consistent with previous receiver name"
Change-Id: I05275cd20c92349e37365e2cbd29fa9f8d834101
2017-12-13 11:31:25 -08:00
mpl b41e1403e7 vendor: update go4.org/readerutil
To rev 169ea6cabe2a4888dba958edaecc9e9751adc711

Also get rid of pkg/readerutil now that it's all moved to
go4.org/readerutil

go4.org/readerutil/singlereader not vendored in as we don't actually use
it.

Fixes #678

Change-Id: I46f14acde1d3023e94c8e99e8267ce951f1bbb61
2017-04-12 19:25:04 +02:00
mpl 3a5c0efcf4 pkg/fs: check mountedness with /proc/mounts
Fixes #829

Change-Id: I40065ce97c97d11c4a53c36561bc98b1e7573bff
2016-10-13 18:07:07 +02:00
mpl ba1877c4b6 pkg/fs: take At into account for (root)dirs
Also adds more reliable check for "mounted broken" dirs on linux (that
require a fusermount -u). They were seen as not mounted (actually not
existing), because the check relied on df, which on them would just
return the "transport endpoint is not connected" error.

Fixes #826

Change-Id: I440d10a7b42c217ee85ea7a1726e581bc74e6f4a
2016-08-01 18:45:26 +02:00
Eric Drechsel 0ddc0d7ef4 fs: remove noXattr type
The original change, as indicated by the accompanying comment, was to avoid returning ENOSYS,
which causes the OSX kernel to disable that call volume-wide.

bazil.org/fuse returns ENOTSUP for each unimplemented call, so this isn't needed anymore.
37bfa8be92/fs/serve.go (L1112)

This patch changes the default return values as follows:

    Getxattr: ErrNoXattr → ENOTSUP
    Listxattr: nil → ENOTSUP
    Setxattr: EPERM → ENOTSUP
    Removexattr: EPERM → ENOTSUP

Change-Id: I6adb744f76385d36eadd531a9f1dd1670b46f452
2016-05-02 20:43:37 -07:00
Brad Fitzpatrick e93e4f3822 Fix deadlock in search/index.
The describe requests were launching a storm of RLocks which weren't
safe in the presence of goroutines trying to acquire write locks.

Instead, make the corpus locking the responsibility of the caller and
add Lock/Unlock/RLock/RUnlock methods to the index and move locking up
a level.

This also adds a fair bit of context.Context plumbing which was used
in earlier debugging.

Fixes camlistore/camlistore#709

Change-Id: I8d7254d1e1da541f8c080d62f5408aac807fd3b1
2016-04-22 14:57:10 -07:00
Eric Drechsel 4bfbdc7d51
pkg/fs: osxfuse version check shouldn't depend on map ordering
also, use fuse.OSXFUSELocationV3 and V2 for path info
they're exported for this sort of thing

Change-Id: If94024b944c419ced8760d904f521201916a5359
2016-04-13 16:04:52 -07:00
Eric Drechsel e0a9699c63
Update bazil.org/fuse
move to vendor
fix (lots) of breakages due to API changes

bazil.org/fuse: 37bfa8be929171feec943f3496bc4befdeaf10db

Change-Id: Ic92faf7585371027f3c521f7a24ae56d70d18547
2016-04-09 12:40:02 -07:00
Tamás Gulácsi 7402cc0efd Delete misc unused objects
Using honnef.co/go/unused/cmd/unused

Change-Id: I672b3cb77f09e9bd80dcdc149cde4f7f2939e451
2016-04-06 17:59:51 +02:00
Tamás Gulácsi 8d6b156a0b Misc syntax cleanup found by gosimple.
https://github.com/dominikh/go-simple

Thanks to Dominik Honnef for this great little tool!

Change-Id: I789b3a37e18f535df1ff0da47c0366ed01b2429e
2016-04-04 17:19:57 +02:00
Will Norris 77ed42edf8 add canonical import paths
The import path was added to the go file that included the package
documentation if one existed.  Otherwise, I used what seemed to be the
primary file for the package.

Fixes #689

Change-Id: If51be0e86529fd6f179e80af6781e639f8550fd2
2016-03-13 19:57:14 -07:00
mpl e0d719ba21 pkg/types: remove
Most of it replaced with vendor/go4.org/types and
vendor/go4.org/readerutil

u32 went where needed in pkg/blobserver/*
invertedBool went in pkg/types/serverconfig
atomics64 went in pkg/fs

Change-Id: I230426cda35be4b45ed67e869f14e6fdae89be22
2016-02-05 18:28:47 +01:00
mpl 12eddf9c19 vendor: go4.org/strutil go4.org/syncutil
They were internal packages (under pkg), which we are now moving to
go4.org, so we in turn need to vendor them in now.

Change-Id: I92224f731404d0bd4ca1c57492bed37cb3367ed4
2015-11-21 00:21:20 +01:00
Salmān Aljammāz 64220e06ff fs: set OpenDirectIO in stats files to avoid having them cached in kernel
bazil.org/fuse switched from having OpenDirectIO on to having it
off by default. This has the side effect of allowing OS X's kernel
to cache the filesystem's files in its UBC, giving us incorrect
stats from cammount's .camli_fs_stats directory. This change sets
it explicitly to get the correct behaviour again.

Updates #556

Change-Id: Ic6400a550e4874086cf5fb725d423fcfde47fd61
2014-12-26 18:09:32 +00:00
Salmān Aljammāz 972c4152fd fs: make a copy of the value buffer when setting an xattr
When setting an xattr bazil.org/fuse gives us a byte slice with the
attribute value to set, but it then reuses its backing array and
we end up with garbage values in our xattr maps. This CL makes a
copy of the slice before it stores it.

Bonus edit: fix a debug message typo in muDir.Remove.

Fixes #556

Change-Id: I820d8cde3065f2949ff4c506ede705194a458afb
2014-12-24 00:08:50 +00:00
Robert Kroeger b091a52e9f Use the absolute diskutil path for unmounting
Unmounting a FUSE volume on Darwin fails if diskutil is not on one's
path. This is not the default on MacOS. Make the path absolute so that
FUSE volumes unmount successfully.

Change-Id: I255be19b5b12e3ebecffc6d29dc77b6504c27f1c
2014-12-16 06:41:38 -08:00
Jingguo Yao 3e4825a1c3 fs: correct the permission bit setting
Replace "executeBit" with "n.attr.Mode & 0100" in "0400 & executeBit".
The result is "0400 & n.attr.Mode & 0100" which is always 0. So
"n.attr.Mode" is always 0 after the assignment. The last two "&" should be
"|" in the assignment.

Change-Id: Iaeff864f330b9db07b8a3124b5c28ba1a3469e69
2014-11-09 13:53:23 +08:00
Matthieu Rakotojaona af0d711c01 Fix ReadDir for recent in cammount
Change-Id: I422393ec77034b8408094b663b34121a499ad4a7
2014-10-24 19:56:42 +02:00
Piotr S. Staszewski cac9aa4483 fs: handle directory permanode titles
Set corresponding permanode title on new root,
new directory and directory rename.

Change-Id: I5432e14ef57d6c0c5555b11e895e8b8ad6d8efcf
2014-07-15 08:41:05 +02:00
Eric Drechsel 7e11b360a3 fuse: fix crash populating non-permanode camliPath
https://code.google.com/p/camlistore/issues/detail?id=440

Change-Id: If3b186d03a29ea6b3c9f0945173ede8709e318d6
2014-05-08 22:33:13 +00:00
Brad Fitzpatrick bf94a73859 Get rid of SeekFetcher vs StreamingFetcher distinction and complexity.
StreamingFetcher is now just Fetcher, and its FetchStreaming is now
just Fetch.

SeekFetcher is gone. Blobs are max 16 MB anyway, so we can slurp to
memory when needed. The main thing that cared about SeekFetcher
was the GET handler, ServeBlobref, because http.ServeContent needed
one for range requests. That's rewritten in an earlier commit, using
the FakeSeeker from another earlier commit.

Lot of code got simpler as a result.

Change-Id: Ib819413e48a8f9b8d97f596d0fbf771dab211f11
2014-03-14 12:29:13 -07:00
Brad Fitzpatrick bfe7128e94 fs: avoid possible nil pointer crash
http://camlistore.org/issue/401

Change-Id: I7ae091798e2f250898f14ec325a89cbfad4ee6aa
2014-03-11 13:30:58 -07:00
mpl 3f0974ef13 tests: make sure camlistored is running before cammount
Context: http://camlistore.org/issue/385

Change-Id: I793298745096fc1696f01226698eb6682b24806d
2014-02-24 18:29:08 +01:00
mpl 2194134b70 fs: clean up mountpoints after tests
Otherwise they tend to annoyingly accumulate on long-lived hosts (such
as the  buildbot).

Change-Id: I41eb90423c1f98d8481fb3308c2cdcb74fc86ddd
2014-02-17 23:31:19 +01:00
Brad Fitzpatrick 433a312703 fs: fix bug picking recent filenames when file has no name
e.g. iphone uploads

Change-Id: Ieee398b6f43c261232bc9f6cc0c71cb97c5c49f8
2014-02-02 06:14:44 +01:00
Brad Fitzpatrick 3e0d6521b8 Merge branch 'master' of https://camlistore.googlesource.com/camlistore 2014-01-31 12:27:18 +01:00
Brad Fitzpatrick e5ad2282c4 fs: cache recent dir for a bit
Change-Id: Id85344038d38dedc134435463d96d8b836edbcd7
2014-01-31 11:50:22 +01:00
Dustin Sallings fff8db88a7 fs: tests for xattr operations
Change-Id: I0501a8ec69fb30df7104b105f8e07a1864d2b5f6
2014-01-30 17:57:32 -08:00
Tommi Virtanen 6cda29582b third_party: Switch FUSE library to bazil.org/fuse
import bazil.org/fuse at f6649cd46fb76b1e04ba9eeffb773cb189278d31
remove code.google.com/p/rsc/fuse.

Huge thanks to Tommi Virtanen for the fuse support.

Change-Id: I44b95ac1ea344648593c7376f83ca675a56077b3
2014-01-24 13:28:08 -08:00
Dustin Sallings 70e6306aaf fs: fix crash setting xattr on a root
Change-Id: I76f008bcffcf23c5936a0a16cabb9c5b7c9bbd99
2014-01-17 18:19:45 -08:00
Brad Fitzpatrick aef25ddd81 Merge "fs: don't issue Describe request with no blobs" 2014-01-11 06:48:27 +00:00
Dustin Sallings d634b02b2e fs: don't issue Describe request with no blobs
The request is unnecessary, and the server doesn't appreciate it.

fix http://camlistore.org/issue/335

Change-Id: Ie37f1d187883dbc86a365f536a12c6b9916bc8d9
2014-01-10 20:50:20 -08:00
Brad Fitzpatrick 9c87b07d74 Merge "if permanode or root name provided to cammount, create new mutDir, and mount it" 2014-01-10 22:14:28 +00:00
Dustin Sallings 333cdce979 Reuse memoized mutDirs and mutFiles.
This provides a considerably improved experience for from a single FUSE
client, but not for free.

New dirents introduced outside of FUSE will be visible on the normal
refresh interval.

Removals outside of FUSE are tricky because it's not possible to tell
the difference between a file that was locally created and hasn't made
it into the index yet from a file that was deleted remotely.

Specific dirents that change permanodes outside of FUSE are replaced.

Dirents that change properties outside of FUSE without changing
permanodes (e.g. content, etc...) are never picked up.

Change-Id: I7cc8eaea5951644809053fc97c28455e96508bd4
Fixes:  http://calistore.org/issue/328
2014-01-09 19:58:43 -08:00
Kristopher Cost 7ce12d53f4 if permanode or root name provided to cammount, create new mutDir, and mount it
Change-Id: I97b7508ccb3c564178cb4f0a7b9ff238e486d957
2014-01-09 11:32:45 -08:00
Dustin Sallings edc655a27a Reuse memoized roots on refresh
This is somewhat related to camlistore.org/issue/328

Change-Id: I6bf8d70a42fca886f6b004d65c346be7c0a3e61e
2014-01-07 14:46:08 -08:00
Dustin Sallings c2500c5444 fs: implement {mutFile,mutDir}.Access
On at least OS X, the stat(2) call will use an existing node without
issuing Lookup.  This introduces a filesystem inconsistency where a
delete removes an entry for further requests, but FUSE's cached access
of the node is still used for at least stat.

There's a call to Access directly against the node as retrieved from a
prior Lookup.  By invalidating the nodes when they're deleted and
verifying this at Access time, we keep things more consistent.

This isn't exactly camlistore.org/issue/324 as described, but it was
causing one of the tests to fail on OS X

Change-Id: Ib90a1de79d6d3960f96bac5b4fb448c952c4ba66
2014-01-06 23:47:28 -08:00
Dustin Sallings 8a5ce9c6a5 fs: memoize roots children
If we ever return a particular value for a root, we should continue to
return the same value to provide a consistent view.

camlistore.org/issue/324

Change-Id: I7cfad02ad742b0e70e333f70779d64ba163d68a6
2014-01-06 23:47:28 -08:00
Dustin Sallings c39fb7136d fs: logging cleanup
Change-Id: I9413ce5397453cb91c9293de4dd7dce62f79ccfe
2014-01-06 23:47:28 -08:00
Dustin Sallings c13717e788 fs: extended attribute support
This includes read-write support for extended attributes for mutable
files, and enough support on all other filesystem paths to prevent OS X
from falling back to AppleDouble files.

Change-Id: I2b275591f3bc69c25e1e9c8d59a7fa4cf0bb97ff
2014-01-02 12:02:10 -08:00