Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327223
b: refs/heads/master
c: adb37c4
h: refs/heads/master
i:
  327221: e1dbef7
  327219: 16e7841
  327215: 409c1a7
v: v3
  • Loading branch information
Eric W. Biederman committed Aug 15, 2012
1 parent a5a9959 commit 86785af
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fc5795c8a94c2d0b221dffae9ebb22686b3dafd8
refs/heads/master: adb37c4c67f807f16beb222028fb3ce9a354dc2b
4 changes: 4 additions & 0 deletions trunk/fs/seq_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <linux/export.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/cred.h>

#include <asm/uaccess.h>
#include <asm/page.h>
Expand Down Expand Up @@ -56,6 +57,9 @@ int seq_open(struct file *file, const struct seq_operations *op)
memset(p, 0, sizeof(*p));
mutex_init(&p->lock);
p->op = op;
#ifdef CONFIG_USER_NS
p->user_ns = file->f_cred->user_ns;
#endif

/*
* Wrappers around seq_open(e.g. swaps_open) need to be
Expand Down
14 changes: 14 additions & 0 deletions trunk/include/linux/seq_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct file;
struct path;
struct inode;
struct dentry;
struct user_namespace;

struct seq_file {
char *buf;
Expand All @@ -25,6 +26,9 @@ struct seq_file {
struct mutex lock;
const struct seq_operations *op;
int poll_event;
#ifdef CONFIG_USER_NS
struct user_namespace *user_ns;
#endif
void *private;
};

Expand Down Expand Up @@ -128,6 +132,16 @@ int seq_put_decimal_ull(struct seq_file *m, char delimiter,
int seq_put_decimal_ll(struct seq_file *m, char delimiter,
long long num);

static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
{
#ifdef CONFIG_USER_NS
return seq->user_ns;
#else
extern struct user_namespace init_user_ns;
return &init_user_ns;
#endif
}

#define SEQ_START_TOKEN ((void *)1)
/*
* Helpers for iteration over list_head-s in seq_files
Expand Down

0 comments on commit 86785af

Please sign in to comment.