diff options
Diffstat (limited to 'fs/hppfs/hppfs_kern.c')
| -rw-r--r-- | fs/hppfs/hppfs_kern.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/fs/hppfs/hppfs_kern.c b/fs/hppfs/hppfs_kern.c index ff150fedb981..52930915bad8 100644 --- a/fs/hppfs/hppfs_kern.c +++ b/fs/hppfs/hppfs_kern.c | |||
| @@ -38,7 +38,7 @@ struct hppfs_inode_info { | |||
| 38 | 38 | ||
| 39 | static inline struct hppfs_inode_info *HPPFS_I(struct inode *inode) | 39 | static inline struct hppfs_inode_info *HPPFS_I(struct inode *inode) |
| 40 | { | 40 | { |
| 41 | return(list_entry(inode, struct hppfs_inode_info, vfs_inode)); | 41 | return container_of(inode, struct hppfs_inode_info, vfs_inode); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | #define HPPFS_SUPER_MAGIC 0xb00000ee | 44 | #define HPPFS_SUPER_MAGIC 0xb00000ee |
| @@ -662,42 +662,36 @@ static int hppfs_readlink(struct dentry *dentry, char *buffer, int buflen) | |||
| 662 | { | 662 | { |
| 663 | struct file *proc_file; | 663 | struct file *proc_file; |
| 664 | struct dentry *proc_dentry; | 664 | struct dentry *proc_dentry; |
| 665 | int (*readlink)(struct dentry *, char *, int); | 665 | int ret; |
| 666 | int err, n; | ||
| 667 | 666 | ||
| 668 | proc_dentry = HPPFS_I(dentry->d_inode)->proc_dentry; | 667 | proc_dentry = HPPFS_I(dentry->d_inode)->proc_dentry; |
| 669 | proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY); | 668 | proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY); |
| 670 | err = PTR_ERR(proc_dentry); | 669 | if (IS_ERR(proc_file)) |
| 671 | if(IS_ERR(proc_dentry)) | 670 | return PTR_ERR(proc_file); |
| 672 | return(err); | ||
| 673 | 671 | ||
| 674 | readlink = proc_dentry->d_inode->i_op->readlink; | 672 | ret = proc_dentry->d_inode->i_op->readlink(proc_dentry, buffer, buflen); |
| 675 | n = (*readlink)(proc_dentry, buffer, buflen); | ||
| 676 | 673 | ||
| 677 | fput(proc_file); | 674 | fput(proc_file); |
| 678 | 675 | ||
| 679 | return(n); | 676 | return ret; |
| 680 | } | 677 | } |
| 681 | 678 | ||
| 682 | static int hppfs_follow_link(struct dentry *dentry, struct nameidata *nd) | 679 | static void* hppfs_follow_link(struct dentry *dentry, struct nameidata *nd) |
| 683 | { | 680 | { |
| 684 | struct file *proc_file; | 681 | struct file *proc_file; |
| 685 | struct dentry *proc_dentry; | 682 | struct dentry *proc_dentry; |
| 686 | int (*follow_link)(struct dentry *, struct nameidata *); | 683 | void *ret; |
| 687 | int err, n; | ||
| 688 | 684 | ||
| 689 | proc_dentry = HPPFS_I(dentry->d_inode)->proc_dentry; | 685 | proc_dentry = HPPFS_I(dentry->d_inode)->proc_dentry; |
| 690 | proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY); | 686 | proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY); |
| 691 | err = PTR_ERR(proc_dentry); | 687 | if (IS_ERR(proc_file)) |
| 692 | if(IS_ERR(proc_dentry)) | 688 | return proc_file; |
| 693 | return(err); | ||
| 694 | 689 | ||
| 695 | follow_link = proc_dentry->d_inode->i_op->follow_link; | 690 | ret = proc_dentry->d_inode->i_op->follow_link(proc_dentry, nd); |
| 696 | n = (*follow_link)(proc_dentry, nd); | ||
| 697 | 691 | ||
| 698 | fput(proc_file); | 692 | fput(proc_file); |
| 699 | 693 | ||
| 700 | return(n); | 694 | return ret; |
| 701 | } | 695 | } |
| 702 | 696 | ||
| 703 | static struct inode_operations hppfs_dir_iops = { | 697 | static struct inode_operations hppfs_dir_iops = { |
