diff options
author | Karel Zak | 2018-05-16 13:20:01 +0200 |
---|---|---|
committer | Karel Zak | 2018-06-21 13:07:46 +0200 |
commit | 8c3d9cad1ecb3c4ba78604ea4416620f6a6566ab (patch) | |
tree | b9505991b5bd2c0579996ac1527ae52d31a20ac9 /lib | |
parent | lib/sysfs: make possible to call sysfs_blkdev_deinit_path() in loop (diff) | |
download | kernel-qcow2-util-linux-8c3d9cad1ecb3c4ba78604ea4416620f6a6566ab.tar.gz kernel-qcow2-util-linux-8c3d9cad1ecb3c4ba78604ea4416620f6a6566ab.tar.xz kernel-qcow2-util-linux-8c3d9cad1ecb3c4ba78604ea4416620f6a6566ab.zip |
lib/sysfs: add sysfs_blkdev_get_parent()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sysfs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sysfs.c b/lib/sysfs.c index 5b4031e00..953627715 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -148,6 +148,12 @@ int sysfs_blkdev_set_parent(struct path_cxt *pc, struct path_cxt *parent) return 0; } +struct path_cxt *sysfs_blkdev_get_parent(struct path_cxt *pc) +{ + struct sysfs_blkdev *blk = ul_path_get_dialect(pc); + return blk ? blk->parent : NULL; +} + /* * Redirects ENOENT errors to the parent, if the path is to the queue/ * sysfs directory. For example |