Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260822
b: refs/heads/master
c: 09570f9
h: refs/heads/master
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Jul 27, 2011
1 parent 4c8fbde commit f068380
Show file tree
Hide file tree
Showing 5 changed files with 8 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: 5fd00b031530cc476240f654c078c930f1dcd6ea
refs/heads/master: 09570f914914d2beb0db29c5a9c7344934f2fa8c
3 changes: 1 addition & 2 deletions trunk/fs/proc/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,7 @@ static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent,
if (!ent) goto out;

memset(ent, 0, sizeof(struct proc_dir_entry));
memcpy(((char *) ent) + sizeof(struct proc_dir_entry), fn, len + 1);
ent->name = ((char *) ent) + sizeof(*ent);
memcpy(ent->name, fn, len + 1);
ent->namelen = len;
ent->mode = mode;
ent->nlink = nlink;
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/proc/proc_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ static __net_init int proc_net_ns_init(struct net *net)
int err;

err = -ENOMEM;
netd = kzalloc(sizeof(*netd), GFP_KERNEL);
netd = kzalloc(sizeof(*netd) + 4, GFP_KERNEL);
if (!netd)
goto out;

netd->data = net;
netd->nlink = 2;
netd->name = "net";
netd->namelen = 3;
netd->parent = &proc_root;
memcpy(netd->name, "net", 4);

err = -EEXIST;
net_statd = proc_net_mkdir(net, "stat", netd);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/proc/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ static const struct inode_operations proc_root_inode_operations = {
struct proc_dir_entry proc_root = {
.low_ino = PROC_ROOT_INO,
.namelen = 5,
.name = "/proc",
.mode = S_IFDIR | S_IRUGO | S_IXUGO,
.nlink = 2,
.count = ATOMIC_INIT(1),
.proc_iops = &proc_root_inode_operations,
.proc_fops = &proc_root_operations,
.parent = &proc_root,
.name = "/proc",
};

int pid_ns_prepare_proc(struct pid_namespace *ns)
Expand Down
6 changes: 3 additions & 3 deletions trunk/include/linux/proc_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ typedef int (write_proc_t)(struct file *file, const char __user *buffer,

struct proc_dir_entry {
unsigned int low_ino;
unsigned int namelen;
const char *name;
mode_t mode;
nlink_t nlink;
uid_t uid;
Expand All @@ -73,9 +71,11 @@ struct proc_dir_entry {
write_proc_t *write_proc;
atomic_t count; /* use count */
int pde_users; /* number of callers into module in progress */
spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */
struct completion *pde_unload_completion;
struct list_head pde_openers; /* who did ->open, but not ->release */
spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */
u8 namelen;
char name[];
};

enum kcore_type {
Expand Down

0 comments on commit f068380

Please sign in to comment.