From: Stelian P. <st...@po...> - 2008-06-30 09:09:00
|
Le vendredi 27 juin 2008 à 14:09 -0700, Kenneth Porter a écrit : > The missing file case would need to walk up the path to the mountpoint of > the filesystem being verified, looking for a node that exists, What you need is a routine that, given a pathname, returns the filesystem on which this file would be stored on. So for a pathname of the form: /a/b/c/d/node You need to check: if '/a/b/c/d' is a mountpoint return the filesystem mounted on '/a/b/c/d/.' else if '/a/b/c' is a mountpoint return the filesystem mounted on '/a/b/c/.' else if '/a/b' is a mountpoint return the filesystem mounted on '/a/b/.' else if '/a' is a mountpoint return the filesystem mounted on '/a/.' else return the filesystem mounted on '/' > and either > report the current message if the node is in the right filesystem, or the > "masked by mountpoint" message if not. exactly. I guess it is unnecessary to even continue the compare for given inode it it is masked. > Is the runtime cost of doing that > prohibitive? If you build a table of mountpoints before starting the compare (like dump does for example), and you limit the runtime checks to the strcmp() calls walking up the chain of mountpoints the cost should not be prohibitive, and restore isn't performance driven anyway. BTW, maybe you can reuse the code existing in dump for building the mountpoint table, but I haven't looked at that. > If not, I can look into constructing a patch to do this. This would be perfect. Stelian. -- Stelian Pop <st...@po...> |