diff options
| -rw-r--r-- | fs/cifs/cifsfs.c | 2 | ||||
| -rw-r--r-- | fs/cifs/cifsfs.h | 2 | ||||
| -rw-r--r-- | fs/cifs/link.c | 7 | ||||
| -rw-r--r-- | fs/ecryptfs/inode.c | 12 | ||||
| -rw-r--r-- | fs/gfs2/inode.c | 9 | ||||
| -rw-r--r-- | fs/libfs.c | 10 | ||||
| -rw-r--r-- | fs/proc/self.c | 10 | ||||
| -rw-r--r-- | include/linux/fs.h | 1 |
8 files changed, 15 insertions, 38 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index a16b4e58bcc6..801975c34cf9 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
| @@ -860,7 +860,7 @@ const struct inode_operations cifs_file_inode_ops = { | |||
| 860 | const struct inode_operations cifs_symlink_inode_ops = { | 860 | const struct inode_operations cifs_symlink_inode_ops = { |
| 861 | .readlink = generic_readlink, | 861 | .readlink = generic_readlink, |
| 862 | .follow_link = cifs_follow_link, | 862 | .follow_link = cifs_follow_link, |
| 863 | .put_link = cifs_put_link, | 863 | .put_link = kfree_put_link, |
| 864 | .permission = cifs_permission, | 864 | .permission = cifs_permission, |
| 865 | /* BB add the following two eventually */ | 865 | /* BB add the following two eventually */ |
| 866 | /* revalidate: cifs_revalidate, | 866 | /* revalidate: cifs_revalidate, |
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index 6d0b07217ac9..26a754f49ba1 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
| @@ -115,8 +115,6 @@ extern struct vfsmount *cifs_dfs_d_automount(struct path *path); | |||
| 115 | 115 | ||
| 116 | /* Functions related to symlinks */ | 116 | /* Functions related to symlinks */ |
| 117 | extern void *cifs_follow_link(struct dentry *direntry, struct nameidata *nd); | 117 | extern void *cifs_follow_link(struct dentry *direntry, struct nameidata *nd); |
| 118 | extern void cifs_put_link(struct dentry *direntry, | ||
| 119 | struct nameidata *nd, void *); | ||
| 120 | extern int cifs_readlink(struct dentry *direntry, char __user *buffer, | 118 | extern int cifs_readlink(struct dentry *direntry, char __user *buffer, |
| 121 | int buflen); | 119 | int buflen); |
| 122 | extern int cifs_symlink(struct inode *inode, struct dentry *direntry, | 120 | extern int cifs_symlink(struct inode *inode, struct dentry *direntry, |
diff --git a/fs/cifs/link.c b/fs/cifs/link.c index 7e36ceba0c7a..cc0234710ddb 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c | |||
| @@ -621,10 +621,3 @@ symlink_exit: | |||
| 621 | free_xid(xid); | 621 | free_xid(xid); |
| 622 | return rc; | 622 | return rc; |
| 623 | } | 623 | } |
| 624 | |||
| 625 | void cifs_put_link(struct dentry *direntry, struct nameidata *nd, void *cookie) | ||
| 626 | { | ||
| 627 | char *p = nd_get_link(nd); | ||
| 628 | if (!IS_ERR(p)) | ||
| 629 | kfree(p); | ||
| 630 | } | ||
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 2ca62c40c6c2..0f9b66eaa767 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
| @@ -703,16 +703,6 @@ out: | |||
| 703 | return NULL; | 703 | return NULL; |
| 704 | } | 704 | } |
| 705 | 705 | ||
| 706 | static void | ||
| 707 | ecryptfs_put_link(struct dentry *dentry, struct nameidata *nd, void *ptr) | ||
| 708 | { | ||
| 709 | char *buf = nd_get_link(nd); | ||
| 710 | if (!IS_ERR(buf)) { | ||
| 711 | /* Free the char* */ | ||
| 712 | kfree(buf); | ||
| 713 | } | ||
| 714 | } | ||
| 715 | |||
| 716 | /** | 706 | /** |
| 717 | * upper_size_to_lower_size | 707 | * upper_size_to_lower_size |
| 718 | * @crypt_stat: Crypt_stat associated with file | 708 | * @crypt_stat: Crypt_stat associated with file |
| @@ -1121,7 +1111,7 @@ out: | |||
| 1121 | const struct inode_operations ecryptfs_symlink_iops = { | 1111 | const struct inode_operations ecryptfs_symlink_iops = { |
| 1122 | .readlink = generic_readlink, | 1112 | .readlink = generic_readlink, |
| 1123 | .follow_link = ecryptfs_follow_link, | 1113 | .follow_link = ecryptfs_follow_link, |
| 1124 | .put_link = ecryptfs_put_link, | 1114 | .put_link = kfree_put_link, |
| 1125 | .permission = ecryptfs_permission, | 1115 | .permission = ecryptfs_permission, |
| 1126 | .setattr = ecryptfs_setattr, | 1116 | .setattr = ecryptfs_setattr, |
| 1127 | .getattr = ecryptfs_getattr_link, | 1117 | .getattr = ecryptfs_getattr_link, |
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index ced3257f06e8..d2384f7c53e1 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
| @@ -1506,13 +1506,6 @@ out: | |||
| 1506 | return NULL; | 1506 | return NULL; |
| 1507 | } | 1507 | } |
| 1508 | 1508 | ||
| 1509 | static void gfs2_put_link(struct dentry *dentry, struct nameidata *nd, void *p) | ||
| 1510 | { | ||
| 1511 | char *s = nd_get_link(nd); | ||
| 1512 | if (!IS_ERR(s)) | ||
| 1513 | kfree(s); | ||
| 1514 | } | ||
| 1515 | |||
| 1516 | /** | 1509 | /** |
| 1517 | * gfs2_permission - | 1510 | * gfs2_permission - |
| 1518 | * @inode: The inode | 1511 | * @inode: The inode |
| @@ -1864,7 +1857,7 @@ const struct inode_operations gfs2_dir_iops = { | |||
| 1864 | const struct inode_operations gfs2_symlink_iops = { | 1857 | const struct inode_operations gfs2_symlink_iops = { |
| 1865 | .readlink = generic_readlink, | 1858 | .readlink = generic_readlink, |
| 1866 | .follow_link = gfs2_follow_link, | 1859 | .follow_link = gfs2_follow_link, |
| 1867 | .put_link = gfs2_put_link, | 1860 | .put_link = kfree_put_link, |
| 1868 | .permission = gfs2_permission, | 1861 | .permission = gfs2_permission, |
| 1869 | .setattr = gfs2_setattr, | 1862 | .setattr = gfs2_setattr, |
| 1870 | .getattr = gfs2_getattr, | 1863 | .getattr = gfs2_getattr, |
diff --git a/fs/libfs.c b/fs/libfs.c index 828622a31d30..8c5018493154 100644 --- a/fs/libfs.c +++ b/fs/libfs.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/vfs.h> | 10 | #include <linux/vfs.h> |
| 11 | #include <linux/quotaops.h> | 11 | #include <linux/quotaops.h> |
| 12 | #include <linux/mutex.h> | 12 | #include <linux/mutex.h> |
| 13 | #include <linux/namei.h> | ||
| 13 | #include <linux/exportfs.h> | 14 | #include <linux/exportfs.h> |
| 14 | #include <linux/writeback.h> | 15 | #include <linux/writeback.h> |
| 15 | #include <linux/buffer_head.h> /* sync_mapping_buffers */ | 16 | #include <linux/buffer_head.h> /* sync_mapping_buffers */ |
| @@ -992,3 +993,12 @@ int noop_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
| 992 | return 0; | 993 | return 0; |
| 993 | } | 994 | } |
| 994 | EXPORT_SYMBOL(noop_fsync); | 995 | EXPORT_SYMBOL(noop_fsync); |
| 996 | |||
| 997 | void kfree_put_link(struct dentry *dentry, struct nameidata *nd, | ||
| 998 | void *cookie) | ||
| 999 | { | ||
| 1000 | char *s = nd_get_link(nd); | ||
| 1001 | if (!IS_ERR(s)) | ||
| 1002 | kfree(s); | ||
| 1003 | } | ||
| 1004 | EXPORT_SYMBOL(kfree_put_link); | ||
diff --git a/fs/proc/self.c b/fs/proc/self.c index 6b6a993b5c25..ffeb202ec942 100644 --- a/fs/proc/self.c +++ b/fs/proc/self.c | |||
| @@ -36,18 +36,10 @@ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
| 36 | return NULL; | 36 | return NULL; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | static void proc_self_put_link(struct dentry *dentry, struct nameidata *nd, | ||
| 40 | void *cookie) | ||
| 41 | { | ||
| 42 | char *s = nd_get_link(nd); | ||
| 43 | if (!IS_ERR(s)) | ||
| 44 | kfree(s); | ||
| 45 | } | ||
| 46 | |||
| 47 | static const struct inode_operations proc_self_inode_operations = { | 39 | static const struct inode_operations proc_self_inode_operations = { |
| 48 | .readlink = proc_self_readlink, | 40 | .readlink = proc_self_readlink, |
| 49 | .follow_link = proc_self_follow_link, | 41 | .follow_link = proc_self_follow_link, |
| 50 | .put_link = proc_self_put_link, | 42 | .put_link = kfree_put_link, |
| 51 | }; | 43 | }; |
| 52 | 44 | ||
| 53 | static unsigned self_inum; | 45 | static unsigned self_inum; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 3f40547ba191..d80c2437d624 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -2502,6 +2502,7 @@ extern int __page_symlink(struct inode *inode, const char *symname, int len, | |||
| 2502 | int nofs); | 2502 | int nofs); |
| 2503 | extern int page_symlink(struct inode *inode, const char *symname, int len); | 2503 | extern int page_symlink(struct inode *inode, const char *symname, int len); |
| 2504 | extern const struct inode_operations page_symlink_inode_operations; | 2504 | extern const struct inode_operations page_symlink_inode_operations; |
| 2505 | extern void kfree_put_link(struct dentry *, struct nameidata *, void *); | ||
| 2505 | extern int generic_readlink(struct dentry *, char __user *, int); | 2506 | extern int generic_readlink(struct dentry *, char __user *, int); |
| 2506 | extern void generic_fillattr(struct inode *, struct kstat *); | 2507 | extern void generic_fillattr(struct inode *, struct kstat *); |
| 2507 | extern int vfs_getattr(struct path *, struct kstat *); | 2508 | extern int vfs_getattr(struct path *, struct kstat *); |
