Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POC] Store file id in extended attributes where possible #14546

Closed
wants to merge 2 commits into from

Conversation

icewind1991
Copy link
Contributor

Requires http://pecl.php.net/package/xattr to be installed and the filesystem to support user extended attributes (default on btrfs, mount option for ext(3|4) iirc)

To test:

  • upload a new file to a folder
  • share the file
  • delete the cache entry for the file
  • check that the file is no longer shown in the web interface
  • run the filescanner
  • check that the file is back in the web interface and still shared

cc @PVince81 @DeepDiver1975

@@ -213,12 +213,27 @@ protected function removeFromCache($path) {
protected function addToCache($path, $data, $fileId = -1) {
\OC_Hook::emit('Scanner', 'addToCache', array('file' => $path, 'data' => $data));
$this->emit('\OC\Files\Cache\Scanner', 'addToCache', array($path, $this->storageId, $data));
if ($this->storage->instanceOfStorage('OCP\Files\Storage\IAttribute') and $fileId === -1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it mean you need to add getAttribute and setAttribute to the default storage wrapper, to make sure they are forwarded to the underlying storage ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there are magic methods to handle that

@PVince81
Copy link
Contributor

Sweet.

We should probably also check for file id clashes. What happens if two files have the same file id attribute ? (for whatever reason)

@scrutinizer-notifier
Copy link

The inspection completed: No issues found

@PVince81 PVince81 mentioned this pull request Mar 23, 2015
3 tasks
@ghost
Copy link

ghost commented Apr 30, 2015

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/12025/
💣 Test FAILed. 💣

nooo432

@MorrisJobke
Copy link
Contributor

@icewind1991 rebase needed

@PVince81
Copy link
Contributor

PVince81 commented Jul 3, 2015

I wonder if we should do this as an optional separate app and register a storage wrapper or something ? This requires the FS to support xattr and the FS must be local, so no external storage (except the one of type "Local").

@icewind1991
Copy link
Contributor Author

Some external storages support adding arbitrary metadata to files which could be used.

I'm not sure if this can be cleanly implemented in an app due to the changes to the scanner logic (which apps cant overwrite without hacks)

@PVince81
Copy link
Contributor

PVince81 commented Sep 1, 2015

Would it make sense to move this to an app instead ?

@DeepDiver1975
Copy link
Member

This could be an alternative implementation for the upcoming storage based cache Händler.i vote die close for the time being.

@icewind1991 icewind1991 closed this Sep 1, 2015
@MorrisJobke MorrisJobke deleted the extended-attributes branch September 1, 2015 12:21
@lock lock bot locked as resolved and limited conversation to collaborators Aug 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants