On Sat, Sep 07, 2013 at 10:29:15AM +0200, Marco Stornelli wrote:+static int pram_readlink(struct dentry *dentry, char __user *buffer, int buflen)
+{
+ struct inode *inode = dentry->d_inode;
+ struct super_block *sb = inode->i_sb;
+ u64 block;
+ char *blockp;
+
+ block = pram_find_data_block(inode, 0);
+ blockp = pram_get_block(sb, block);
+ return vfs_readlink(dentry, buffer, buflen, blockp);
+}
+static void *pram_follow_link(struct dentry *dentry, struct nameidata *nd)
+{
+ struct inode *inode = dentry->d_inode;
+ struct super_block *sb = inode->i_sb;
+ off_t block;
+ int status;
+ char *blockp;
+
+ block = pram_find_data_block(inode, 0);
+ blockp = pram_get_block(sb, block);
+ status = vfs_follow_link(nd, blockp);
+ return ERR_PTR(status);
+}
Just nd_set_link(nd, blockp) instead of that vfs_follow_link() and be
done with that; that way you can use generic_readlink() instead of
pram_readlink() *and* get lower stack footprint on traversing them.