/** @return true if the given inode is an ancestor directory of this inode. */ public final boolean isAncestorDirectory(final INodeDirectory dir) { for(INodeDirectory p = getParent(); p != null; p = p.getParent()) { if (p == dir) { return true; } } return false; }
/** * Check if this directory is a descendant directory * of a snapshot root directory. * @param snapshotRootDir the snapshot root directory * @return true if this directory is a descendant of snapshot root */ public boolean isDescendantOfSnapshotRoot(INodeDirectory snapshotRootDir) { Preconditions.checkArgument(snapshotRootDir.isSnapshottable()); INodeDirectory dir = this; while(dir != null) { if (dir.equals(snapshotRootDir)) { return true; } dir = dir.getParent(); } return false; }
tmpParent = tmpParent.getParent();
/** @return true if the given inode is an ancestor directory of this inode. */ public final boolean isAncestorDirectory(final INodeDirectory dir) { for(INodeDirectory p = getParent(); p != null; p = p.getParent()) { if (p == dir) { return true; } } return false; }
/** @return true if the given inode is an ancestor directory of this inode. */ public final boolean isAncestorDirectory(final INodeDirectory dir) { for(INodeDirectory p = getParent(); p != null; p = p.getParent()) { if (p == dir) { return true; } } return false; }
if (!isRoot() && getParent() == null) {
<T extends INode> INodeDirectory addToParent( byte[][] pathComponents, T newNode, boolean inheritPermission, boolean propagateModTime ) throws FileNotFoundException { int pathLen = pathComponents.length; if (pathLen < 2) // add root return null; newNode.name = pathComponents[pathLen-1]; // insert into the parent children list INodeDirectory parent = getParent(pathComponents); if(parent.addChild(newNode, inheritPermission, propagateModTime, UNKNOWN_INDEX) == null) return null; return parent; }
QuotaCounts counts = snapshotRoot.cleanSubtree(bsps, snapshot.getId(), prior, collectedBlocks, removedINodes); INodeDirectory parent = snapshotRoot.getParent(); if (parent != null) {
QuotaCounts counts = snapshotRoot.cleanSubtree(bsps, snapshot.getId(), prior, collectedBlocks, removedINodes); INodeDirectory parent = snapshotRoot.getParent(); if (parent != null) {
tmpParent = tmpParent.getParent();
tmpParent = tmpParent.getParent();
if (!isRoot() && getParent() == null) {
if (!isRoot() && getParent() == null) {
INodeDirectory barNode = fsdir.getINode4Write(newbar.toString()) .asDirectory(); assertSame(fooNode.asDirectory(), barNode.getParent());