+ * Same as seq_path, but relative to supplied root.
+ *
+ * root may be changed, see __d_path().
+ */
+int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
+ char *esc)
+{
+ char *buf;
+ size_t size = seq_get_buf(m, &buf);
+ int res = -ENAMETOOLONG;
+
+ if (size) {
+ char *p;
+
+ spin_lock(&dcache_lock);
+ p = __d_path(path, root, buf, size);
+ spin_unlock(&dcache_lock);
+ res = PTR_ERR(p);
+ if (!IS_ERR(p)) {
+ char *end = mangle_path(buf, p, esc);
+ if (end)
+ res = end - buf;
+ else
+ res = -ENAMETOOLONG;
+ }
+ }
+ seq_commit(m, res);
+
+ return res < 0 ? res : 0;
+}
+
+/*