Exemple #1
0
        /// <exception cref="System.IO.IOException"/>
        internal static SnapshotDiffReport GetSnapshotDiffReport(FSDirectory fsd, SnapshotManager
                                                                 snapshotManager, string path, string fromSnapshot, string toSnapshot)
        {
            SnapshotDiffReport  diffs;
            FSPermissionChecker pc = fsd.GetPermissionChecker();

            fsd.ReadLock();
            try
            {
                if (fsd.IsPermissionEnabled())
                {
                    CheckSubtreeReadPermission(fsd, pc, path, fromSnapshot);
                    CheckSubtreeReadPermission(fsd, pc, path, toSnapshot);
                }
                INodesInPath iip = fsd.GetINodesInPath(path, true);
                diffs = snapshotManager.Diff(iip, path, fromSnapshot, toSnapshot);
            }
            finally
            {
                fsd.ReadUnlock();
            }
            return(diffs);
        }