loop: parse and store disk sequence number
When loop devices are re-used, the disk sequence number is increased. Parse it when creating a loop device and store it. The kernel will never return DISKSEQ=0, so use it to signal that it's not supported by the current kernel.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/loop.h>
|
||||
|
||||
#ifndef LOOP_CONFIGURE
|
||||
@@ -13,3 +14,7 @@ struct loop_config {
|
||||
|
||||
#define LOOP_CONFIGURE 0x4C0A
|
||||
#endif
|
||||
|
||||
#ifndef BLKGETDISKSEQ
|
||||
#define BLKGETDISKSEQ _IOR(0x12,128,__u64)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user