/** * Checks file system limits (max component length and max directory items) * during a rename operation. */ static void verifyFsLimitsForRename(FSDirectory fsd, INodesInPath srcIIP, INodesInPath dstIIP) throws PathComponentTooLongException, MaxDirectoryItemsExceededException { byte[] dstChildName = dstIIP.getLastLocalName(); final String parentPath = dstIIP.getParentPath(); fsd.verifyMaxComponentLength(dstChildName, parentPath); // Do not enforce max directory items if renaming within same directory. if (srcIIP.getINode(-2) != dstIIP.getINode(-2)) { fsd.verifyMaxDirItems(dstIIP.getINode(-2).asDirectory(), parentPath); } }
final String parentPath = existing.getPath(); verifyMaxComponentLength(inode.getLocalNameBytes(), parentPath); verifyMaxDirItems(parent, parentPath);
/** * Checks file system limits (max component length and max directory items) * during a rename operation. */ static void verifyFsLimitsForRename(FSDirectory fsd, INodesInPath srcIIP, INodesInPath dstIIP) throws PathComponentTooLongException, MaxDirectoryItemsExceededException { byte[] dstChildName = dstIIP.getLastLocalName(); final String parentPath = dstIIP.getParentPath(); fsd.verifyMaxComponentLength(dstChildName, parentPath); // Do not enforce max directory items if renaming within same directory. if (srcIIP.getINode(-2) != dstIIP.getINode(-2)) { fsd.verifyMaxDirItems(dstIIP.getINode(-2).asDirectory(), parentPath); } }
/** * Checks file system limits (max component length and max directory items) * during a rename operation. */ static void verifyFsLimitsForRename(FSDirectory fsd, INodesInPath srcIIP, INodesInPath dstIIP) throws PathComponentTooLongException, MaxDirectoryItemsExceededException { byte[] dstChildName = dstIIP.getLastLocalName(); final String parentPath = dstIIP.getParentPath(); fsd.verifyMaxComponentLength(dstChildName, parentPath); // Do not enforce max directory items if renaming within same directory. if (srcIIP.getINode(-2) != dstIIP.getINode(-2)) { fsd.verifyMaxDirItems(dstIIP.getINode(-2).asDirectory(), parentPath); } }
final String parentPath = existing.getPath(); verifyMaxComponentLength(inode.getLocalNameBytes(), parentPath); verifyMaxDirItems(parent, parentPath);
final String parentPath = existing.getPath(); verifyMaxComponentLength(inode.getLocalNameBytes(), parentPath); verifyMaxDirItems(parent, parentPath);