9p: Disable filename tracking by default

This commit is contained in:
Ernest Wong 2018-09-02 11:33:19 +12:00 committed by Fabian
parent c7dda46de1
commit c3739fc22a
2 changed files with 11 additions and 2 deletions

View file

@ -195,6 +195,7 @@ Virtio9p.prototype.set_state = function(state)
// Note: dbg_name is only used for debugging messages and may not be the same as the filename,
// since it is not synchronised with renames done outside of 9p. Hard-links, linking and unlinking
// operations also mean that having a single filename no longer makes sense.
// Set TRACK_FILENAMES = true (in config.js) to sync dbg_name during 9p renames.
Virtio9p.prototype.Createfid = function(inodeid, type, uid, dbg_name) {
return {inodeid, type, uid, dbg_name};
};
@ -627,8 +628,11 @@ Virtio9p.prototype.ReceiveRequest = function (bufchain) {
this.SendReply(bufchain);
break;
}
const newidx = this.fs.Search(this.fids[newdirfid].inodeid, newname);
this.update_dbg_name(newidx, newname);
if(TRACK_FILENAMES)
{
const newidx = this.fs.Search(this.fids[newdirfid].inodeid, newname);
this.update_dbg_name(newidx, newname);
}
this.BuildReply(id, tag, 0);
this.SendReply(bufchain);
break;

View file

@ -34,6 +34,11 @@ var DUMP_GENERATED_WASM = false;
*/
var DUMP_UNCOMPILED_ASSEMBLY = false;
/**
* @const
* More accurate filenames in 9p debug messages at the cost of performance.
*/
var TRACK_FILENAMES = false;
var LOG_LEVEL = LOG_ALL & ~LOG_PS2 & ~LOG_PIT & ~LOG_VIRTIO & ~LOG_9P & ~LOG_PIC &
~LOG_DMA & ~LOG_SERIAL & ~LOG_NET & ~LOG_FLOPPY & ~LOG_DISK & ~LOG_VGA;