Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174501890
D60266.id188503.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D60266.id188503.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
@@ -3892,6 +3892,38 @@
return (ENOENT);
}
+static int
+zfs_dnode_sa_lookup(struct zfsmount *mount, dnode_phys_t *dn,
+ enum zfs_sa_attr_id attr, void *value, size_t *size)
+{
+ void *buf;
+ size_t buflen, valuesize;
+ int error;
+
+ if (dn->dn_bonuslen != 0) {
+ valuesize = *size;
+ error = zfs_sa_lookup(mount, DN_BONUS(dn), dn->dn_bonuslen,
+ attr, value, &valuesize);
+ if (error == 0) {
+ *size = valuesize;
+ return (0);
+ }
+ if (error != ENOENT)
+ return (error);
+ }
+ if ((dn->dn_flags & DNODE_FLAG_SPILL_BLKPTR) == 0)
+ return (ENOENT);
+ buflen = BP_GET_LSIZE(DN_SPILL_BLKPTR(dn));
+ buf = malloc(buflen);
+ if (buf == NULL)
+ return (ENOMEM);
+ error = zio_read(mount->spa, DN_SPILL_BLKPTR(dn), buf);
+ if (error == 0)
+ error = zfs_sa_lookup(mount, buf, buflen, attr, value, size);
+ free(buf);
+ return (error);
+}
+
static int
zfs_dnode_stat(struct zfsmount *mount, dnode_phys_t *dn, struct stat *sb,
uint64_t fsid_guid, uint64_t objnum)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 4, 6:24 PM (6 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40152198
Default Alt Text
D60266.id188503.diff (1 KB)
Attached To
Mode
D60266: stand: Lookup specific SA value in a dnode
Attached
Detach File
Event Timeline
Log In to Comment