X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fzpl_inode.c;h=888dc17cc45d0c9832befbcd937a7269d96eddc1;hb=a31a70bbd1c3d6b27a68280e53103c5b9a8ebd65;hp=e866dcd4d508117010dde8a79d281a0ba5ef7ae9;hpb=ee154f01bf0bdb5e85524c518c19964272d33cd9;p=zfs.git diff --git a/module/zfs/zpl_inode.c b/module/zfs/zpl_inode.c index e866dcd..888dc17 100644 --- a/module/zfs/zpl_inode.c +++ b/module/zfs/zpl_inode.c @@ -245,8 +245,33 @@ out: 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 @@ -256,7 +281,7 @@ zpl_put_link(struct dentry *dentry, struct nameidata *nd, void *ptr) link = nd_get_link(nd); if (!IS_ERR(link)) - kmem_free(link, MAXPATHLEN + 1); + kmem_free(link, MAXPATHLEN); } static int @@ -288,7 +313,6 @@ out: } const struct inode_operations zpl_inode_operations = { - .check_acl = NULL, .create = zpl_create, .link = zpl_link, .unlink = zpl_unlink, @@ -306,7 +330,6 @@ const struct inode_operations zpl_inode_operations = { }; const struct inode_operations zpl_dir_inode_operations = { - .check_acl = NULL, .create = zpl_create, .lookup = zpl_lookup, .link = zpl_link, @@ -317,15 +340,24 @@ const struct inode_operations zpl_dir_inode_operations = { .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, };