Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177472997
D60268.1794509553.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D60268.1794509553.diff
View Options
diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c
--- a/stand/libsa/zfs/zfsimpl.c
+++ b/stand/libsa/zfs/zfsimpl.c
@@ -3995,38 +3995,11 @@
int rc = 0;
if (dn->dn_bonustype == DMU_OT_SA) {
- sa_hdr_phys_t *sahdrp = NULL;
- size_t size = 0;
- void *buf = NULL;
- int hdrsize;
- char *p;
-
- if (dn->dn_bonuslen != 0) {
- sahdrp = (sa_hdr_phys_t *)DN_BONUS(dn);
- } else {
- blkptr_t *bp;
-
- if ((dn->dn_flags & DNODE_FLAG_SPILL_BLKPTR) == 0)
- return (EIO);
- bp = DN_SPILL_BLKPTR(dn);
+ size_t size = psize;
- size = BP_GET_LSIZE(bp);
- buf = malloc(size);
- if (buf == NULL)
- rc = ENOMEM;
- else
- rc = zio_read(mount->spa, bp, buf);
- if (rc != 0) {
- free(buf);
- return (rc);
- }
- sahdrp = buf;
- }
- hdrsize = SA_HDR_SIZE(sahdrp);
- p = (char *)((uintptr_t)sahdrp + hdrsize + SA_SYMLINK_OFFSET);
- memcpy(path, p, psize);
- free(buf);
- return (0);
+ rc = zfs_dnode_sa_lookup(mount, dn, ZFS_SA_SYMLINK, path,
+ &size);
+ return (rc != 0 ? rc : (size == psize ? 0 : EIO));
}
/*
* Second test is purely to silence bogus compiler
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 12, 6:52 PM (4 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40200452
Default Alt Text
D60268.1794509553.diff (1 KB)
Attached To
Mode
D60268: stand: Implement zfs_dnode_readlink in terms of zfs_dnode_sa_lookup
Attached
Detach File
Event Timeline