static int sqfs_hl_op_listxattr(const char *path, char *buf, size_t size) { sqfs *fs; sqfs_inode inode; int ferr; if (sqfs_hl_lookup(&fs, &inode, path)) return -ENOENT; ferr = sqfs_listxattr(fs, &inode, buf, &size); if (ferr) return -ferr; return size; }
static void sqfs_ll_op_listxattr(fuse_req_t req, fuse_ino_t ino, size_t size) { sqfs_ll_i lli; char *buf; int ferr; if (sqfs_ll_iget(req, &lli, ino)) return; buf = NULL; if (size && !(buf = malloc(size))) { fuse_reply_err(req, ENOMEM); return; } ferr = sqfs_listxattr(&lli.ll->fs, &lli.inode, buf, &size); if (ferr) { fuse_reply_err(req, ferr); } else if (buf) { fuse_reply_buf(req, buf, size); } else { fuse_reply_xattr(req, size); } free(buf); }