// Path: src/jext2/exceptions/FileTooLarge.java
// public class FileTooLarge extends JExt2Exception {
// 	static final long serialVersionUID = 42;
// 	protected final static int ERRNO = Errno.EFBIG;
// 
// 	public int getErrno() {
// 		return ERRNO;
// 	}
// }
// 
// Path: src/jext2/exceptions/IoError.java
// public class IoError extends JExt2Exception {
// 	static final long serialVersionUID = 42;
// 	protected static final int ERRNO=Errno.EIO;
// 	public IoError(String msg) {
// 		super(msg);
// 	}
// 	public IoError() {
// 		super();
// 	}
// 	public int getErrno() {
// 		return ERRNO;
// 	}
// }
// 
// Path: src/jext2/exceptions/JExt2Exception.java
// public class JExt2Exception extends Exception {
// 	protected static final int ERRNO = -1;
// 
// 	private static final long serialVersionUID = -7429088074385678308L;
// 
// 	Logger logger = Filesystem.getLogger();
// 
// 	public JExt2Exception() {
// 		log("");
// 	}
// 
// 	public JExt2Exception(String msg) {
// 		log(msg);
// 	}
// 
// 	private void log(String msg) {
// 		if (logger.isLoggable(Level.FINE)) {
// 			StackTraceElement[] stack = getStackTrace();
// 
// 			StringBuilder log = new StringBuilder();
// 			log.append("JEXT2 exception was raised: ");
// 			log.append(this.getClass().getSimpleName());
// 			log.append(" source=");
// 			log.append(stack[0].getClassName());
// 			log.append("->");
// 			log.append(stack[0].getMethodName());
// 			log.append(" msg=");
// 			log.append(msg);
// 			log.append(" errno=");
// 			log.append(getErrno());
// 
// 			logger.fine(log.toString());
// 		}
// 	}
// 
// 	public int getErrno() {
// 		throw new RuntimeException("This method should not be executed. " +
// 				"- The errno value defined here is meaningless");
// 	}
// }
// 
// Path: src/jext2/exceptions/NoSpaceLeftOnDevice.java
// public class NoSpaceLeftOnDevice extends JExt2Exception {
// 	static final long serialVersionUID = 42;
// 	protected final static int ERRNO = Errno.ENOSPC;
// 
// 	public int getErrno() {
// 		return ERRNO;
// 	}
// }


import java.nio.ByteBuffer;
import java.util.Date;
import java.util.LinkedList;
import java.util.logging.Logger;
import org.apache.commons.lang.builder.HashCodeBuilder;
import jext2.exceptions.FileTooLarge;
import jext2.exceptions.IoError;
import jext2.exceptions.JExt2Exception;
import jext2.exceptions.NoSpaceLeftOnDevice;
				blockAccess.writeFromBufferUnsynchronized((blockNrs.getFirst() & 0xffffffff) * blocksize, onDisk);
			} else { /* write whole block */
				buf.limit(buf.position() + blocksize);

				blockAccess.writeFromBufferUnsynchronized(
						(blockNrs.getFirst() & 0xffffffff) * blocksize, buf);
			}

			start += 1;
			startOff = 0;
			accessData().unlockHierarchyChanges();

		}
		int written = buf.position();
		assert written == buf.capacity();

		/* increase inode.size if we grew the file */
		if (offset + written > getSize()) { /* file grew */
			setStatusChangeTime(new Date());
			setSize(offset + written);
		}

		return written;
	}

	protected DataInode(long blockNr, int offset) {
		super(blockNr, offset);
	}

	@Override
// Path: src/jext2/exceptions/FileTooLarge.java
// public class FileTooLarge extends JExt2Exception {
// 	static final long serialVersionUID = 42;
// 	protected final static int ERRNO = Errno.EFBIG;
// 
// 	public int getErrno() {
// 		return ERRNO;
// 	}
// }
// 
// Path: src/jext2/exceptions/IoError.java
// public class IoError extends JExt2Exception {
// 	static final long serialVersionUID = 42;
// 	protected static final int ERRNO=Errno.EIO;
// 	public IoError(String msg) {
// 		super(msg);
// 	}
// 	public IoError() {
// 		super();
// 	}
// 	public int getErrno() {
// 		return ERRNO;
// 	}
// }
// 
// Path: src/jext2/exceptions/JExt2Exception.java
// public class JExt2Exception extends Exception {
// 	protected static final int ERRNO = -1;
// 
// 	private static final long serialVersionUID = -7429088074385678308L;
// 
// 	Logger logger = Filesystem.getLogger();
// 
// 	public JExt2Exception() {
// 		log("");
// 	}
// 
// 	public JExt2Exception(String msg) {
// 		log(msg);
// 	}
// 
// 	private void log(String msg) {
// 		if (logger.isLoggable(Level.FINE)) {
// 			StackTraceElement[] stack = getStackTrace();
// 
// 			StringBuilder log = new StringBuilder();
// 			log.append("JEXT2 exception was raised: ");
// 			log.append(this.getClass().getSimpleName());
// 			log.append(" source=");
// 			log.append(stack[0].getClassName());
// 			log.append("->");
// 			log.append(stack[0].getMethodName());
// 			log.append(" msg=");
// 			log.append(msg);
// 			log.append(" errno=");
// 			log.append(getErrno());
// 
// 			logger.fine(log.toString());
// 		}
// 	}
// 
// 	public int getErrno() {
// 		throw new RuntimeException("This method should not be executed. " +
// 				"- The errno value defined here is meaningless");
// 	}
// }
// 
// Path: src/jext2/exceptions/NoSpaceLeftOnDevice.java
// public class NoSpaceLeftOnDevice extends JExt2Exception {
// 	static final long serialVersionUID = 42;
// 	protected final static int ERRNO = Errno.ENOSPC;
// 
// 	public int getErrno() {
// 		return ERRNO;
// 	}
// }


// Path: src/jext2/DataInode.java
import java.nio.ByteBuffer;
import java.util.Date;
import java.util.LinkedList;
import java.util.logging.Logger;
import org.apache.commons.lang.builder.HashCodeBuilder;
import jext2.exceptions.FileTooLarge;
import jext2.exceptions.IoError;
import jext2.exceptions.JExt2Exception;
import jext2.exceptions.NoSpaceLeftOnDevice;

				blockAccess.writeFromBufferUnsynchronized((blockNrs.getFirst() & 0xffffffff) * blocksize, onDisk);
			} else { /* write whole block */
				buf.limit(buf.position() + blocksize);

				blockAccess.writeFromBufferUnsynchronized(
						(blockNrs.getFirst() & 0xffffffff) * blocksize, buf);
			}

			start += 1;
			startOff = 0;
			accessData().unlockHierarchyChanges();

		}
		int written = buf.position();
		assert written == buf.capacity();

		/* increase inode.size if we grew the file */
		if (offset + written > getSize()) { /* file grew */
			setStatusChangeTime(new Date());
			setSize(offset + written);
		}

		return written;
	}

	protected DataInode(long blockNr, int offset) {
		super(blockNr, offset);
	}

	@Override
	protected void read(ByteBuffer buf) throws IoError {