Skip to content

Commit 5c7c43d

Browse files
xuyang0410metan-ucw
authored andcommitted
lapi/loop.h: Add fallback for loop ioctl and flag
Signed-off-by: Yang Xu <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]>
1 parent 37e64c7 commit 5c7c43d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

include/lapi/loop.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later
2+
/*
3+
* Copyright (c) 2020 FUJITSU LIMITED. All rights reserved.
4+
* Author: Yang Xu <[email protected]>
5+
*/
6+
#ifndef LAPI_LOOP_H
7+
#define LAPI_LOOP_H
8+
9+
#include <linux/types.h>
10+
#include <linux/loop.h>
11+
12+
#ifndef LO_FLAGS_PARTSCAN
13+
# define LO_FLAGS_PARTSCAN 8
14+
#endif
15+
16+
#ifndef LO_FLAGS_DIRECT_IO
17+
# define LO_FLAGS_DIRECT_IO 16
18+
#endif
19+
20+
#ifndef LOOP_SET_CAPACITY
21+
# define LOOP_SET_CAPACITY 0x4C07
22+
#endif
23+
24+
#ifndef LOOP_SET_DIRECT_IO
25+
# define LOOP_SET_DIRECT_IO 0x4C08
26+
#endif
27+
28+
#ifndef LOOP_SET_BLOCK_SIZE
29+
# define LOOP_SET_BLOCK_SIZE 0x4C09
30+
#endif
31+
32+
#endif

0 commit comments

Comments
 (0)