Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226692
b: refs/heads/master
c: 5adcee1
h: refs/heads/master
v: v3
  • Loading branch information
Nick Piggin committed Jan 7, 2011
1 parent 5aebeff commit c0b6cbe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e880fb5e4bb6a012035e3edd0586ee2817c2e24
refs/heads/master: 5adcee1d8d32d7f305f6f5aaefdbf8f35adca177
27 changes: 22 additions & 5 deletions trunk/kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,8 @@ EXPORT_SYMBOL_GPL(cgroup_unlock);
* -> cgroup_mkdir.
*/

static struct dentry *cgroup_lookup(struct inode *dir,
struct dentry *dentry, struct nameidata *nd);
static int cgroup_mkdir(struct inode *dir, struct dentry *dentry, int mode);
static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry);
static int cgroup_populate_dir(struct cgroup *cgrp);
Expand Down Expand Up @@ -2180,7 +2182,7 @@ static const struct file_operations cgroup_file_operations = {
};

static const struct inode_operations cgroup_dir_inode_operations = {
.lookup = simple_lookup,
.lookup = cgroup_lookup,
.mkdir = cgroup_mkdir,
.rmdir = cgroup_rmdir,
.rename = cgroup_rename,
Expand All @@ -2196,13 +2198,29 @@ static inline struct cftype *__file_cft(struct file *file)
return __d_cft(file->f_dentry);
}

static int cgroup_create_file(struct dentry *dentry, mode_t mode,
struct super_block *sb)
static int cgroup_delete_dentry(struct dentry *dentry)
{
return 1;
}

static struct dentry *cgroup_lookup(struct inode *dir,
struct dentry *dentry, struct nameidata *nd)
{
static const struct dentry_operations cgroup_dops = {
static const struct dentry_operations cgroup_dentry_operations = {
.d_delete = cgroup_delete_dentry,
.d_iput = cgroup_diput,
};

if (dentry->d_name.len > NAME_MAX)
return ERR_PTR(-ENAMETOOLONG);
dentry->d_op = &cgroup_dentry_operations;
d_add(dentry, NULL);
return NULL;
}

static int cgroup_create_file(struct dentry *dentry, mode_t mode,
struct super_block *sb)
{
struct inode *inode;

if (!dentry)
Expand All @@ -2228,7 +2246,6 @@ static int cgroup_create_file(struct dentry *dentry, mode_t mode,
inode->i_size = 0;
inode->i_fop = &cgroup_file_operations;
}
dentry->d_op = &cgroup_dops;
d_instantiate(dentry, inode);
dget(dentry); /* Extra count - pin the dentry in core */
return 0;
Expand Down

0 comments on commit c0b6cbe

Please sign in to comment.