@@ -763,8 +763,6 @@ EXPORT_SYMBOL_GPL(cgroup_unlock);
763763 * -> cgroup_mkdir.
764764 */
765765
766- static struct dentry * cgroup_lookup (struct inode * dir ,
767- struct dentry * dentry , struct nameidata * nd );
768766static int cgroup_mkdir (struct inode * dir , struct dentry * dentry , int mode );
769767static int cgroup_rmdir (struct inode * unused_dir , struct dentry * dentry );
770768static int cgroup_populate_dir (struct cgroup * cgrp );
@@ -1451,6 +1449,10 @@ static int cgroup_set_super(struct super_block *sb, void *data)
14511449
14521450static int cgroup_get_rootdir (struct super_block * sb )
14531451{
1452+ static const struct dentry_operations cgroup_dops = {
1453+ .d_iput = cgroup_diput ,
1454+ };
1455+
14541456 struct inode * inode =
14551457 cgroup_new_inode (S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR , sb );
14561458 struct dentry * dentry ;
@@ -1468,6 +1470,8 @@ static int cgroup_get_rootdir(struct super_block *sb)
14681470 return - ENOMEM ;
14691471 }
14701472 sb -> s_root = dentry ;
1473+ /* for everything else we want ->d_op set */
1474+ sb -> s_d_op = & cgroup_dops ;
14711475 return 0 ;
14721476}
14731477
@@ -2191,7 +2195,7 @@ static const struct file_operations cgroup_file_operations = {
21912195};
21922196
21932197static const struct inode_operations cgroup_dir_inode_operations = {
2194- .lookup = cgroup_lookup ,
2198+ .lookup = simple_lookup ,
21952199 .mkdir = cgroup_mkdir ,
21962200 .rmdir = cgroup_rmdir ,
21972201 .rename = cgroup_rename ,
@@ -2207,26 +2211,6 @@ static inline struct cftype *__file_cft(struct file *file)
22072211 return __d_cft (file -> f_dentry );
22082212}
22092213
2210- static int cgroup_delete_dentry (const struct dentry * dentry )
2211- {
2212- return 1 ;
2213- }
2214-
2215- static struct dentry * cgroup_lookup (struct inode * dir ,
2216- struct dentry * dentry , struct nameidata * nd )
2217- {
2218- static const struct dentry_operations cgroup_dentry_operations = {
2219- .d_delete = cgroup_delete_dentry ,
2220- .d_iput = cgroup_diput ,
2221- };
2222-
2223- if (dentry -> d_name .len > NAME_MAX )
2224- return ERR_PTR (- ENAMETOOLONG );
2225- d_set_d_op (dentry , & cgroup_dentry_operations );
2226- d_add (dentry , NULL );
2227- return NULL ;
2228- }
2229-
22302214static int cgroup_create_file (struct dentry * dentry , mode_t mode ,
22312215 struct super_block * sb )
22322216{
0 commit comments