Again, don't forget to adjust the parents size. After removing an entry, there should be some kind of detection mechanism in place to find out if there are enough holes to warrant compaction. This is not hard to do. If the size is eight less than the number of entries the chain pointers can hold, then there are enough holes to fill a directory entry block. In such cases compaction should be done.
Compaction is done by simply filling the holes from the bottom up, or from the top down.
The code returned may indicate that the path is not valid, or that there was a disk access failure, ie. Consider the possibilities that could arise and have an error code that accurately describes the problem. This is the name of the directory to be created, and also includes or implies where it is to be created, ie. This function does more than just add a directory entry, however. An entry list must be created, and the parents size must be increased.