]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/kernfs/mount.c
blktrace: add an option to allow displaying cgroup path
[linux.git] / fs / kernfs / mount.c
index fa323589704f828c808127304af1615ca0f3f6df..7c452f4d83e937e3d66def4841c7b693b0023551 100644 (file)
@@ -65,6 +65,25 @@ const struct super_operations kernfs_sops = {
        .show_path      = kernfs_sop_show_path,
 };
 
+/*
+ * Similar to kernfs_fh_get_inode, this one gets kernfs node from inode
+ * number and generation
+ */
+struct kernfs_node *kernfs_get_node_by_id(struct kernfs_root *root,
+       const union kernfs_node_id *id)
+{
+       struct kernfs_node *kn;
+
+       kn = kernfs_find_and_get_node_by_ino(root, id->ino);
+       if (!kn)
+               return NULL;
+       if (kn->id.generation != id->generation) {
+               kernfs_put(kn);
+               return NULL;
+       }
+       return kn;
+}
+
 static struct inode *kernfs_fh_get_inode(struct super_block *sb,
                u64 ino, u32 generation)
 {