The code shown below is
present in alloc_super() in fs/super.c.In this code kmalloc() is used to
allocate memory for super_block structure.
Which flag(type flag) should be passed in kmalloc()?
since this code is executed in kernel space.
why can't we use GFP_KERNEL instead of GFP_USER?
struct super_block *s = kmalloc(sizeof(struct super_block), GFP_USER);
static struct super_operations default_op;
if (s) {
memset(s, 0, sizeof(struct super_block));
if (security_sb_alloc(s)) {
kfree(s);
s = NULL;
goto out;
}