private Block allocateBlock ( String src , INode [ ] inodes ) throws IOException { Block b = new Block ( generateBlockId ( ) , 0 , 0 ) ; while ( isValidBlock ( b ) ) { b . setBlockId ( generateBlockId ( ) ) ; } b . setGenerationStamp ( getGenerationStamp ( ) ) ; b = dir . addBlock ( src , inodes , b ) ; return b ; }
Allocate a block at the given pending filename