throw new IOException("EXT2 implementation is currently readonly");
long blockSize = iNode.getExt2FileSystem().getBlockSize();   if(length<getLength()) { long blockNr 	 = length / blockSize; long blockOffset = length % blockSize; long nextBlock; if(blockOffset==0) nextBlock=blockNr; else nextBlock=blockNr+1;  for(long i=iNode.getAllocatedBlockCount()-1; i>=nextBlock; i--)  { log.debug("setLength(): freeing up block "+i+" of inode"); try{ iNode.freeDataBlock(i); }catch(FileSystemException fse) { throw new IOException(fse); }  } iNode.setSize(length);  try{ iNode.update(); }catch(FileSystemException fse) { throw new IOException(fse); }   iNode.getExt2FileSystem().updateFS();  return; }     if(length>getLength()) { long len = length - getLength(); long blocksAllocated = getLengthInBlocks(); long bytesAllocated  = getLength(); long bytesCovered=0; while( bytesCovered < len ) { long blockIndex = 	(bytesAllocated+bytesCovered) / blockSize; long blockOffset = 	(bytesAllocated+bytesCovered) % blockSize; long newSection = Math.min(len-bytesCovered, blockSize - blockOffset);   if(blockIndex >= blocksAllocated) { try{ iNode.allocateDataBlock(blockIndex); }catch(FileSystemException fe) { throw new IOException("Internal filesystem exception",fe); } blocksAllocated++; }  bytesCovered += newSection; } iNode.setSize(length); return; }
	public void setLength(long length) throws IOException {		throw new IOException("EXT2 implementation is currently readonly");	}