diff options
Diffstat (limited to 'fs/binfmt_misc.c')
| -rw-r--r-- | fs/binfmt_misc.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 07a4996cca3f..1713c48fef54 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c | |||
| @@ -55,6 +55,7 @@ typedef struct { | |||
| 55 | } Node; | 55 | } Node; |
| 56 | 56 | ||
| 57 | static DEFINE_RWLOCK(entries_lock); | 57 | static DEFINE_RWLOCK(entries_lock); |
| 58 | static struct file_system_type bm_fs_type; | ||
| 58 | static struct vfsmount *bm_mnt; | 59 | static struct vfsmount *bm_mnt; |
| 59 | static int entry_count; | 60 | static int entry_count; |
| 60 | 61 | ||
| @@ -214,10 +215,8 @@ _error: | |||
| 214 | bprm->interp_flags = 0; | 215 | bprm->interp_flags = 0; |
| 215 | bprm->interp_data = 0; | 216 | bprm->interp_data = 0; |
| 216 | _unshare: | 217 | _unshare: |
| 217 | if (files) { | 218 | if (files) |
| 218 | put_files_struct(current->files); | 219 | reset_files_struct(current, files); |
| 219 | current->files = files; | ||
| 220 | } | ||
| 221 | goto _ret; | 220 | goto _ret; |
| 222 | } | 221 | } |
| 223 | 222 | ||
| @@ -506,7 +505,6 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode) | |||
| 506 | inode->i_mode = mode; | 505 | inode->i_mode = mode; |
| 507 | inode->i_uid = 0; | 506 | inode->i_uid = 0; |
| 508 | inode->i_gid = 0; | 507 | inode->i_gid = 0; |
| 509 | inode->i_blksize = PAGE_CACHE_SIZE; | ||
| 510 | inode->i_blocks = 0; | 508 | inode->i_blocks = 0; |
| 511 | inode->i_atime = inode->i_mtime = inode->i_ctime = | 509 | inode->i_atime = inode->i_mtime = inode->i_ctime = |
| 512 | current_fs_time(inode->i_sb); | 510 | current_fs_time(inode->i_sb); |
| @@ -516,7 +514,7 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode) | |||
| 516 | 514 | ||
| 517 | static void bm_clear_inode(struct inode *inode) | 515 | static void bm_clear_inode(struct inode *inode) |
| 518 | { | 516 | { |
| 519 | kfree(inode->u.generic_ip); | 517 | kfree(inode->i_private); |
| 520 | } | 518 | } |
| 521 | 519 | ||
| 522 | static void kill_node(Node *e) | 520 | static void kill_node(Node *e) |
| @@ -544,7 +542,7 @@ static void kill_node(Node *e) | |||
| 544 | static ssize_t | 542 | static ssize_t |
| 545 | bm_entry_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) | 543 | bm_entry_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) |
| 546 | { | 544 | { |
| 547 | Node *e = file->f_dentry->d_inode->u.generic_ip; | 545 | Node *e = file->f_dentry->d_inode->i_private; |
| 548 | loff_t pos = *ppos; | 546 | loff_t pos = *ppos; |
| 549 | ssize_t res; | 547 | ssize_t res; |
| 550 | char *page; | 548 | char *page; |
| @@ -578,7 +576,7 @@ static ssize_t bm_entry_write(struct file *file, const char __user *buffer, | |||
| 578 | size_t count, loff_t *ppos) | 576 | size_t count, loff_t *ppos) |
| 579 | { | 577 | { |
| 580 | struct dentry *root; | 578 | struct dentry *root; |
| 581 | Node *e = file->f_dentry->d_inode->u.generic_ip; | 579 | Node *e = file->f_dentry->d_inode->i_private; |
| 582 | int res = parse_command(buffer, count); | 580 | int res = parse_command(buffer, count); |
| 583 | 581 | ||
| 584 | switch (res) { | 582 | switch (res) { |
| @@ -637,7 +635,7 @@ static ssize_t bm_register_write(struct file *file, const char __user *buffer, | |||
| 637 | if (!inode) | 635 | if (!inode) |
| 638 | goto out2; | 636 | goto out2; |
| 639 | 637 | ||
| 640 | err = simple_pin_fs("binfmt_misc", &bm_mnt, &entry_count); | 638 | err = simple_pin_fs(&bm_fs_type, &bm_mnt, &entry_count); |
| 641 | if (err) { | 639 | if (err) { |
| 642 | iput(inode); | 640 | iput(inode); |
| 643 | inode = NULL; | 641 | inode = NULL; |
| @@ -645,7 +643,7 @@ static ssize_t bm_register_write(struct file *file, const char __user *buffer, | |||
| 645 | } | 643 | } |
| 646 | 644 | ||
| 647 | e->dentry = dget(dentry); | 645 | e->dentry = dget(dentry); |
| 648 | inode->u.generic_ip = e; | 646 | inode->i_private = e; |
| 649 | inode->i_fop = &bm_entry_operations; | 647 | inode->i_fop = &bm_entry_operations; |
| 650 | 648 | ||
| 651 | d_instantiate(dentry, inode); | 649 | d_instantiate(dentry, inode); |
