File tree Expand file tree Collapse file tree 3 files changed +7
-16
lines changed Expand file tree Collapse file tree 3 files changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -116,26 +116,17 @@ export abstract class Fd {
116116 }
117117}
118118
119- class InoIssuer {
120- // NOTE: ino 0 is reserved for the root directory
121- private next_ino : bigint = 1n ;
122-
123- issue ( _node : unknown ) : bigint {
124- // TODO: consider recycling ino if the node is deallocated
125- return this . next_ino ++ ;
126- }
127- }
128-
129119export abstract class Inode {
130120 ino : bigint ;
131121
132122 constructor ( ) {
133- this . ino = Inode . issue_ino ( this ) ;
123+ this . ino = Inode . issue_ino ( ) ;
134124 }
135125
136- static default_issuer = new InoIssuer ( ) ;
137- static issue_ino ( node : unknown ) : bigint {
138- return Inode . default_issuer . issue ( node ) ;
126+ // NOTE: ino 0 is reserved for the root directory
127+ private static next_ino : bigint = 1n ;
128+ static issue_ino ( ) : bigint {
129+ return Inode . next_ino ++ ;
139130 }
140131 static root_ino ( ) : bigint {
141132 return 0n ;
Original file line number Diff line number Diff line change @@ -726,7 +726,7 @@ export class ConsoleStdout extends Fd {
726726
727727 constructor ( write : ( buffer : Uint8Array ) => void ) {
728728 super ( ) ;
729- this . ino = Inode . issue_ino ( this ) ;
729+ this . ino = Inode . issue_ino ( ) ;
730730 this . write = write ;
731731 }
732732
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export class OpenSyncOPFSFile extends Fd {
7070 constructor ( file : SyncOPFSFile ) {
7171 super ( ) ;
7272 this . file = file ;
73- this . ino = Inode . issue_ino ( this ) ;
73+ this . ino = Inode . issue_ino ( ) ;
7474 }
7575
7676 fd_allocate ( offset : bigint , len : bigint ) : number {
You can’t perform that action at this time.
0 commit comments