Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 365599
b: refs/heads/master
c: 712317a
h: refs/heads/master
i:
  365597: 0e33589
  365595: 394986e
  365591: a0ef90c
  365583: 80cd6a4
  365567: 55e7eb5
v: v3
  • Loading branch information
Li Zefan authored and Tejun Heo committed Apr 19, 2013
1 parent bcd16ba commit 63b370e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 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: e57d5cf2f894e3f2727f8cf74bed0bc81cae70c8
refs/heads/master: 712317ad97f41e738e1a19aa0a6392a78a84094e
3 changes: 0 additions & 3 deletions trunk/include/linux/cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,6 @@ struct cftype {
/* CFTYPE_* flags */
unsigned int flags;

/* file xattrs */
struct simple_xattrs xattrs;

int (*open)(struct inode *inode, struct file *file);
ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft,
struct file *file,
Expand Down
11 changes: 6 additions & 5 deletions trunk/kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ struct cfent {
struct list_head node;
struct dentry *dentry;
struct cftype *type;

/* file xattrs */
struct simple_xattrs xattrs;
};

/*
Expand Down Expand Up @@ -882,13 +885,12 @@ static void cgroup_diput(struct dentry *dentry, struct inode *inode)
} else {
struct cfent *cfe = __d_cfe(dentry);
struct cgroup *cgrp = dentry->d_parent->d_fsdata;
struct cftype *cft = cfe->type;

WARN_ONCE(!list_empty(&cfe->node) &&
cgrp != &cgrp->root->top_cgroup,
"cfe still linked for %s\n", cfe->type->name);
simple_xattrs_free(&cfe->xattrs);
kfree(cfe);
simple_xattrs_free(&cft->xattrs);
}
iput(inode);
}
Expand Down Expand Up @@ -2501,7 +2503,7 @@ static struct simple_xattrs *__d_xattrs(struct dentry *dentry)
if (S_ISDIR(dentry->d_inode->i_mode))
return &__d_cgrp(dentry)->xattrs;
else
return &__d_cft(dentry)->xattrs;
return &__d_cfe(dentry)->xattrs;
}

static inline int xattr_enabled(struct dentry *dentry)
Expand Down Expand Up @@ -2677,8 +2679,6 @@ static int cgroup_add_file(struct cgroup *cgrp, struct cgroup_subsys *subsys,
umode_t mode;
char name[MAX_CGROUP_TYPE_NAMELEN + MAX_CFTYPE_NAME + 2] = { 0 };

simple_xattrs_init(&cft->xattrs);

if (subsys && !(cgrp->root->flags & CGRP_ROOT_NOPREFIX)) {
strcpy(name, subsys->name);
strcat(name, ".");
Expand All @@ -2703,6 +2703,7 @@ static int cgroup_add_file(struct cgroup *cgrp, struct cgroup_subsys *subsys,
cfe->type = (void *)cft;
cfe->dentry = dentry;
dentry->d_fsdata = cfe;
simple_xattrs_init(&cfe->xattrs);
list_add_tail(&cfe->node, &parent->files);
cfe = NULL;
}
Expand Down

0 comments on commit 63b370e

Please sign in to comment.