long block512 = fs.getBlockSize()/512; setBlocks( getBlocks()-block512 );
if (i != blockCount - 1) throw new IOException( "Only the last block of the inode can be freed." + "You were trying to free block nr. " + i + ", while inode contains " + +blockCount + " blocks.");
	protected synchronized void freeDataBlock(long i) throws IOException, FileSystemException {		final long blockCount = getAllocatedBlockCount();		final int indirectCount = getIndirectCount();			if(i != blockCount-1)			throw new IOException("Only the last block of the inode can be freed." +				"You were trying to free block nr. "+i+", while inode contains " +				+blockCount+" blocks.");				desc.setLastAllocatedBlockIndex(i-1);				//preallocated blocks follow the last allocated block: when the last block is freed,		//free the preallocated blocks as well		freePreallocatedBlocks();		long block512 = fs.getBlockSize()/512;		setBlocks( getBlocks()-block512 );		setDirty(true);				//see the direct blocks (0; 11)		if(i<12) {			indirectFree(Ext2Utils.get32(data,40+(int)i*4), 0, 0);			Ext2Utils.set32(data, 40+(int)i*4, 0);			return;		}		//see the indirect blocks (12; indirectCount-1)		i-=12;		if(i<indirectCount) {			//the 12th index points to the indirect block			indirectFree( Ext2Utils.get32(data, 40+12*4), i, 1 );			//if this was the last block on the indirect block, then delete the record of 			//the indirect block from the inode			if(i==0)				Ext2Utils.set32(data, 40+12*4, 0); 			return;		}				//see the double indirect blocks (indirectCount; doubleIndirectCount-1)		i-=indirectCount;		if(i<indirectCount * indirectCount) {			//the 13th index points to the double indirect block			indirectFree( Ext2Utils.get32(data, 40+13*4), i, 2 );			//if this was the last block on the double indirect block, then delete the record of 			//the double indirect block from the inode			if(i==0)				Ext2Utils.set32(data, 40+13*4, 0); 			return;		}				//see the triple indirect blocks (doubleIndirectCount; tripleIndirectCount-1)		i-=indirectCount*indirectCount;		if(i<indirectCount*indirectCount*indirectCount) {			//the 14th index points to the triple indirect block			indirectFree( Ext2Utils.get32(data, 40+14*4), i, 3 );			//if this was the last block on the triple indirect block, then delete the record of 			//the triple indirect block from the inode			if(i==0)				Ext2Utils.set32(data, 40+14*4, 0); 			return;		}					//shouldn't get here		throw new IOException(new FileSystemException("Internal FS exception: getDataBlockIndex(i="+i+")"));	}