MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / InsertDir

Method InsertDir

Kernel/src/fs/ext2.cpp:836–852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

834 }
835
836 int Ext2Volume::InsertDir(Ext2Node* node, List<DirectoryEntry>& newEntries){
837 List<DirectoryEntry> entries;
838 ListDir(node, entries);
839
840
841 for(DirectoryEntry& newEnt : newEntries){
842 for(DirectoryEntry& ent : entries){
843 if(strcmp(ent.name, newEnt.name) == 0){
844 Log::Warning("[Ext2] InsertDir: Entry %s already exists!", newEnt.name);
845 return -EEXIST;
846 }
847 }
848 entries.add_back(newEnt);
849 }
850
851 return WriteDir(node, entries);
852 }
853
854 int Ext2Volume::InsertDir(Ext2Node* node, DirectoryEntry& ent){
855 List<DirectoryEntry> ents;

Callers

nothing calls this directly

Calls 3

strcmpFunction · 0.85
WarningFunction · 0.85
add_backMethod · 0.45

Tested by

no test coverage detected