doubt regarding kmalloc() in fs/super.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
        }

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux