Filestorage: (minor) Improve naming can_uncache() -> uncache()

This commit is contained in:
Ernest Wong 2018-11-19 21:44:24 +13:00 committed by Fabian
parent d6bfa143ed
commit 840415a052
2 changed files with 7 additions and 7 deletions

View file

@ -702,7 +702,7 @@ FS.prototype.CloseInode = async function(id) { // jshint ignore:line
} }
if(inode.status === STATUS_ON_STORAGE) if(inode.status === STATUS_ON_STORAGE)
{ {
this.storage.can_uncache(inode.sha256sum); this.storage.uncache(inode.sha256sum);
} }
if (inode.status == STATUS_UNLINKED) { if (inode.status == STATUS_UNLINKED) {
//message.Debug("Filesystem: Delete unlinked file"); //message.Debug("Filesystem: Delete unlinked file");
@ -1100,7 +1100,7 @@ FS.prototype.set_data = async function(idx, buffer) // jshint ignore:line
if(this.inodes[idx].status === STATUS_ON_STORAGE) if(this.inodes[idx].status === STATUS_ON_STORAGE)
{ {
this.inodes[idx].status = STATUS_OK; this.inodes[idx].status = STATUS_OK;
this.storage.can_uncache(this.inodes[idx].sha256sum); this.storage.uncache(this.inodes[idx].sha256sum);
} }
}; // jshint ignore:line }; // jshint ignore:line

View file

@ -36,7 +36,7 @@ FileStorageInterface.prototype.set = function(sha256sum, data) {};
* version is already out of date. It is used to help prevent accumulation of unused files in * version is already out of date. It is used to help prevent accumulation of unused files in
* memory in the long run for some FileStorage mediums. * memory in the long run for some FileStorage mediums.
*/ */
FileStorageInterface.prototype.can_uncache = function(sha256sum) {}; FileStorageInterface.prototype.uncache = function(sha256sum) {};
/** /**
* @constructor * @constructor
@ -85,7 +85,7 @@ MemoryFileStorage.prototype.set = async function(sha256sum, data) // jshint igno
/** /**
* @param {string} sha256sum * @param {string} sha256sum
*/ */
MemoryFileStorage.prototype.can_uncache = function(sha256sum) MemoryFileStorage.prototype.uncache = function(sha256sum)
{ {
this.filedata.delete(sha256sum); this.filedata.delete(sha256sum);
}; };
@ -315,7 +315,7 @@ IndexedDBFileStorage.prototype.set = async function(sha256sum, data) // jshint i
/** /**
* @param {string} sha256sum * @param {string} sha256sum
*/ */
IndexedDBFileStorage.prototype.can_uncache = function(sha256sum) IndexedDBFileStorage.prototype.uncache = function(sha256sum)
{ {
// No-op. // No-op.
}; };
@ -379,7 +379,7 @@ ServerFileStorageWrapper.prototype.set = async function(sha256sum, data) // jshi
/** /**
* @param {string} sha256sum * @param {string} sha256sum
*/ */
ServerFileStorageWrapper.prototype.can_uncache = function(sha256sum) ServerFileStorageWrapper.prototype.uncache = function(sha256sum)
{ {
this.storage.can_uncache(sha256sum); this.storage.uncache(sha256sum);
}; };