| 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; |