aboutsummaryrefslogtreecommitdiffstats
path: root/fs/freevxfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-05-02 10:43:25 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-05-10 22:18:27 -0400
commitdf64c082efd1f71d27d942dbfc628877272e6809 (patch)
tree7bc1dd66527cb4ac02709b59d959c16288f1658e /fs/freevxfs
parentad476fedc7805ca7cec12a56e697afe37566e573 (diff)
freevxfs: switch to simple_follow_link()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/freevxfs')
-rw-r--r--fs/freevxfs/vxfs_extern.h3
-rw-r--r--fs/freevxfs/vxfs_immed.c34
-rw-r--r--fs/freevxfs/vxfs_inode.c7
3 files changed, 5 insertions, 39 deletions
diff --git a/fs/freevxfs/vxfs_extern.h b/fs/freevxfs/vxfs_extern.h
index 881aa3d217f0..e3dcb4467d92 100644
--- a/fs/freevxfs/vxfs_extern.h
+++ b/fs/freevxfs/vxfs_extern.h
@@ -50,9 +50,6 @@ extern daddr_t vxfs_bmap1(struct inode *, long);
50/* vxfs_fshead.c */ 50/* vxfs_fshead.c */
51extern int vxfs_read_fshead(struct super_block *); 51extern int vxfs_read_fshead(struct super_block *);
52 52
53/* vxfs_immed.c */
54extern const struct inode_operations vxfs_immed_symlink_iops;
55
56/* vxfs_inode.c */ 53/* vxfs_inode.c */
57extern const struct address_space_operations vxfs_immed_aops; 54extern const struct address_space_operations vxfs_immed_aops;
58extern struct kmem_cache *vxfs_inode_cachep; 55extern struct kmem_cache *vxfs_inode_cachep;
diff --git a/fs/freevxfs/vxfs_immed.c b/fs/freevxfs/vxfs_immed.c
index 8b9229e2ca5c..cb84f0fcc72a 100644
--- a/fs/freevxfs/vxfs_immed.c
+++ b/fs/freevxfs/vxfs_immed.c
@@ -32,29 +32,15 @@
32 */ 32 */
33#include <linux/fs.h> 33#include <linux/fs.h>
34#include <linux/pagemap.h> 34#include <linux/pagemap.h>
35#include <linux/namei.h>
36 35
37#include "vxfs.h" 36#include "vxfs.h"
38#include "vxfs_extern.h" 37#include "vxfs_extern.h"
39#include "vxfs_inode.h" 38#include "vxfs_inode.h"
40 39
41 40
42static void * vxfs_immed_follow_link(struct dentry *, struct nameidata *);
43
44static int vxfs_immed_readpage(struct file *, struct page *); 41static int vxfs_immed_readpage(struct file *, struct page *);
45 42
46/* 43/*
47 * Inode operations for immed symlinks.
48 *
49 * Unliked all other operations we do not go through the pagecache,
50 * but do all work directly on the inode.
51 */
52const struct inode_operations vxfs_immed_symlink_iops = {
53 .readlink = generic_readlink,
54 .follow_link = vxfs_immed_follow_link,
55};
56
57/*
58 * Address space operations for immed files and directories. 44 * Address space operations for immed files and directories.
59 */ 45 */
60const struct address_space_operations vxfs_immed_aops = { 46const struct address_space_operations vxfs_immed_aops = {
@@ -62,26 +48,6 @@ const struct address_space_operations vxfs_immed_aops = {
62}; 48};
63 49
64/** 50/**
65 * vxfs_immed_follow_link - follow immed symlink
66 * @dp: dentry for the link
67 * @np: pathname lookup data for the current path walk
68 *
69 * Description:
70 * vxfs_immed_follow_link restarts the pathname lookup with
71 * the data obtained from @dp.
72 *
73 * Returns:
74 * Zero on success, else a negative error code.
75 */
76static void *
77vxfs_immed_follow_link(struct dentry *dp, struct nameidata *np)
78{
79 struct vxfs_inode_info *vip = VXFS_INO(d_inode(dp));
80 nd_set_link(np, vip->vii_immed.vi_immed);
81 return NULL;
82}
83
84/**
85 * vxfs_immed_readpage - read part of an immed inode into pagecache 51 * vxfs_immed_readpage - read part of an immed inode into pagecache
86 * @file: file context (unused) 52 * @file: file context (unused)
87 * @page: page frame to fill in. 53 * @page: page frame to fill in.
diff --git a/fs/freevxfs/vxfs_inode.c b/fs/freevxfs/vxfs_inode.c
index 363e3ae25f6b..ef73ed674a27 100644
--- a/fs/freevxfs/vxfs_inode.c
+++ b/fs/freevxfs/vxfs_inode.c
@@ -35,6 +35,7 @@
35#include <linux/pagemap.h> 35#include <linux/pagemap.h>
36#include <linux/kernel.h> 36#include <linux/kernel.h>
37#include <linux/slab.h> 37#include <linux/slab.h>
38#include <linux/namei.h>
38 39
39#include "vxfs.h" 40#include "vxfs.h"
40#include "vxfs_inode.h" 41#include "vxfs_inode.h"
@@ -327,8 +328,10 @@ vxfs_iget(struct super_block *sbp, ino_t ino)
327 ip->i_op = &page_symlink_inode_operations; 328 ip->i_op = &page_symlink_inode_operations;
328 ip->i_mapping->a_ops = &vxfs_aops; 329 ip->i_mapping->a_ops = &vxfs_aops;
329 } else { 330 } else {
330 ip->i_op = &vxfs_immed_symlink_iops; 331 ip->i_op = &simple_symlink_inode_operations;
331 vip->vii_immed.vi_immed[ip->i_size] = '\0'; 332 ip->i_link = vip->vii_immed.vi_immed;
333 nd_terminate_link(ip->i_link, ip->i_size,
334 sizeof(vip->vii_immed.vi_immed) - 1);
332 } 335 }
333 } else 336 } else
334 init_special_inode(ip, ip->i_mode, old_decode_dev(vip->vii_rdev)); 337 init_special_inode(ip, ip->i_mode, old_decode_dev(vip->vii_rdev));