- char __res_buf[res_entry->original_size];
- const char *res_buf;
- if (lte->is_symlink && lte->symlink_buf) {
- res_buf = lte->symlink_buf;
- } else {
- if (read_full_resource(w->fp, res_entry->size,
- res_entry->original_size,
- res_entry->offset,
- wim_resource_compression_type(w, res_entry),
- __res_buf) != 0)
- return -EIO;
- res_buf = __res_buf;
- }
- return get_symlink_name(res_buf, res_entry->original_size, buf,
- buf_len, dentry->reparse_tag);
-}
-
-static int dentry_set_symlink_buf(struct dentry *dentry,
- struct lookup_table_entry *lte)
-{
- struct ads_entry *ads_entries;
-
- ads_entries = CALLOC(2, sizeof(struct ads_entry));
- if (!ads_entries)
- return WIMLIB_ERR_NOMEM;
-
- wimlib_assert(dentry->num_ads == 0);
- wimlib_assert(dentry->ads_entries == NULL);
-
- ads_entries[1].lte = lte;
-
- /*dentry_free_ads_entries(dentry);*/
- dentry->num_ads = 2;
- dentry->ads_entries = ads_entries;
- return 0;
+ u8 res_buf[wim_resource_size(lte)];
+ ret = read_full_wim_resource(lte, res_buf);
+ if (ret != 0)
+ return -EIO;
+ return get_symlink_name(res_buf, wim_resource_size(lte), buf,
+ buf_len, inode->reparse_tag);