vfs: protect i_nlink
Prevent direct modification of i_nlink by making it const and adding a non-const __i_nlink alias. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Tested-by: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
committed by
Christoph Hellwig
parent
bfe8684869
commit
a78ef704a8
@@ -142,7 +142,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode)
|
||||
atomic_set(&inode->i_count, 1);
|
||||
inode->i_op = &empty_iops;
|
||||
inode->i_fop = &empty_fops;
|
||||
inode->i_nlink = 1;
|
||||
inode->__i_nlink = 1;
|
||||
inode->i_opflags = 0;
|
||||
inode->i_uid = 0;
|
||||
inode->i_gid = 0;
|
||||
|
Reference in New Issue
Block a user