linux/include/linux/device_cgroup.h

/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/fs.h>

#define DEVCG_ACC_MKNOD
#define DEVCG_ACC_READ
#define DEVCG_ACC_WRITE
#define DEVCG_ACC_MASK

#define DEVCG_DEV_BLOCK
#define DEVCG_DEV_CHAR
#define DEVCG_DEV_ALL


#if defined(CONFIG_CGROUP_DEVICE) || defined(CONFIG_CGROUP_BPF)
int devcgroup_check_permission(short type, u32 major, u32 minor,
			       short access);
static inline int devcgroup_inode_permission(struct inode *inode, int mask)
{}

static inline int devcgroup_inode_mknod(int mode, dev_t dev)
{}

#else
static inline int devcgroup_check_permission(short type, u32 major, u32 minor,
			       short access)
{ return 0; }
static inline int devcgroup_inode_permission(struct inode *inode, int mask)
{ return 0; }
static inline int devcgroup_inode_mknod(int mode, dev_t dev)
{ return 0; }
#endif