9p: Track filename during RENAMEAT
This commit is contained in:
parent
0d885e5e8c
commit
1a7dc59f07
1 changed files with 11 additions and 0 deletions
11
lib/9p.js
11
lib/9p.js
|
|
@ -199,6 +199,14 @@ Virtio9p.prototype.Createfid = function(inodeid, type, uid, dbg_name) {
|
|||
return {inodeid, type, uid, dbg_name};
|
||||
};
|
||||
|
||||
Virtio9p.prototype.update_dbg_name = function(idx, newname)
|
||||
{
|
||||
for(const fid of this.fids)
|
||||
{
|
||||
if(fid.inodeid === idx) fid.dbg_name = newname;
|
||||
}
|
||||
};
|
||||
|
||||
Virtio9p.prototype.Reset = function() {
|
||||
this.fids = [];
|
||||
};
|
||||
|
|
@ -389,6 +397,7 @@ Virtio9p.prototype.ReceiveRequest = function (bufchain) {
|
|||
var idx = this.fs.CreateFile(name, this.fids[fid].inodeid);
|
||||
this.fids[fid].inodeid = idx;
|
||||
this.fids[fid].type = FID_INODE;
|
||||
this.fids[fid].dbg_name = name;
|
||||
var inode = this.fs.GetInode(idx);
|
||||
inode.uid = this.fids[fid].uid;
|
||||
inode.gid = gid;
|
||||
|
|
@ -618,6 +627,8 @@ 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);
|
||||
this.BuildReply(id, tag, 0);
|
||||
this.SendReply(bufchain);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue