mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
kernfs: Add support for always empty directories.
Add a new function kernfs_create_empty_dir that can be used to create directory that can not be modified. Update the code to use make_empty_dir_inode when reporting a permanently empty directory to the vfs. Update the code to not allow adding to permanently empty directories. Cc: stable@vger.kernel.org Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
parent
eb6d38d542
commit
ea015218f2
3 changed files with 42 additions and 1 deletions
|
@ -296,6 +296,8 @@ static void kernfs_init_inode(struct kernfs_node *kn, struct inode *inode)
|
|||
case KERNFS_DIR:
|
||||
inode->i_op = &kernfs_dir_iops;
|
||||
inode->i_fop = &kernfs_dir_fops;
|
||||
if (kn->flags & KERNFS_EMPTY_DIR)
|
||||
make_empty_dir_inode(inode);
|
||||
break;
|
||||
case KERNFS_FILE:
|
||||
inode->i_size = kn->attr.size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue