static void *
zpl_follow_link(struct dentry *dentry, struct nameidata *nd)
{
- (void) zfs_follow_link(dentry, nd);
- return NULL;
+ struct inode *ip = dentry->d_inode;
+ struct iovec iov;
+ uio_t uio;
+ char *link;
+ cred_t *cr;
+ int error;
+
+ cr = (cred_t *)get_current_cred();
+
+ iov.iov_len = MAXPATHLEN;
+ iov.iov_base = link = kmem_zalloc(MAXPATHLEN, KM_SLEEP);
+
+ uio.uio_iov = &iov;
+ uio.uio_iovcnt = 1;
+ uio.uio_resid = (MAXPATHLEN - 1);
+ uio.uio_segflg = UIO_SYSSPACE;
+
+ error = -zfs_readlink(ip, &uio, cr);
+ if (error) {
+ kmem_free(link, MAXPATHLEN);
+ nd_set_link(nd, ERR_PTR(error));
+ } else {
+ nd_set_link(nd, link);
+ }
+
+ put_cred(cr);
+ return (NULL);
}
static void
link = nd_get_link(nd);
if (!IS_ERR(link))
- kmem_free(link, MAXPATHLEN + 1);
+ kmem_free(link, MAXPATHLEN);
}
static int
}
const struct inode_operations zpl_inode_operations = {
- .check_acl = NULL,
.create = zpl_create,
.link = zpl_link,
.unlink = zpl_unlink,
};
const struct inode_operations zpl_dir_inode_operations = {
- .check_acl = NULL,
.create = zpl_create,
.lookup = zpl_lookup,
.link = zpl_link,
.mknod = zpl_mknod,
.rename = zpl_rename,
.setattr = zpl_setattr,
+ .getattr = zpl_getattr,
+ .setxattr = generic_setxattr,
+ .getxattr = generic_getxattr,
+ .removexattr = generic_removexattr,
+ .listxattr = zpl_xattr_list,
};
const struct inode_operations zpl_symlink_inode_operations = {
- .check_acl = NULL,
.readlink = generic_readlink,
.follow_link = zpl_follow_link,
.put_link = zpl_put_link,
};
const struct inode_operations zpl_special_inode_operations = {
- .check_acl = NULL,
+ .setattr = zpl_setattr,
+ .getattr = zpl_getattr,
+ .setxattr = generic_setxattr,
+ .getxattr = generic_getxattr,
+ .removexattr = generic_removexattr,
+ .listxattr = zpl_xattr_list,
};