mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
stand: zfs_dnode_stat move from spa to mount argument
When reading dynamic system attributes, we'll need the mount argument since we can no longer hard-code the offsets. Adjust zfs_dnode_stat to take it. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D60261
This commit is contained in:
1 parent
acbcb68c9f
commit
ecd41c0df3
3 files changed
+6
-6
No files matched your search
@@ -217,7 +217,7 @@ load(const char *filepath, dev_info_t *devinfo, void **bufp, size_t *bufsize)
|
||||
}
|
||||
|
||||
/* Only st_size is inspected here, so identity is irrelevant. */
|
||||
if ((err = zfs_dnode_stat(spa, &dn, &st, 0, 0)) != 0) {
|
||||
if ((err = zfs_dnode_stat(&zmount, &dn, &st, 0, 0)) != 0) {
|
||||
printf("Failed to stat '%s' on pool '%s' (%d)\n", filepath,
|
||||
spa->spa_name, err);
|
||||
return (EFI_INVALID_PARAMETER);
|
||||
|
||||
@@ -218,7 +218,7 @@ zfs_stat(struct open_file *f, struct stat *sb)
|
||||
struct zfsmount *zm = dev->d_opendata;
|
||||
struct file *fp = (struct file *)f->f_fsdata;
|
||||
|
||||
return (zfs_dnode_stat(zm->spa, &fp->f_dnode, sb, zm->fsid_guid,
|
||||
return (zfs_dnode_stat(zm, &fp->f_dnode, sb, zm->fsid_guid,
|
||||
fp->f_objnum));
|
||||
}
|
||||
|
||||
|
||||
@@ -3713,7 +3713,7 @@ zfs_spa_init(spa_t *spa)
|
||||
}
|
||||
|
||||
static int
|
||||
zfs_dnode_stat(const spa_t *spa, dnode_phys_t *dn, struct stat *sb,
|
||||
zfs_dnode_stat(struct zfsmount *mount, dnode_phys_t *dn, struct stat *sb,
|
||||
uint64_t fsid_guid, uint64_t objnum)
|
||||
{
|
||||
|
||||
@@ -3749,7 +3749,7 @@ zfs_dnode_stat(const spa_t *spa, dnode_phys_t *dn, struct stat *sb,
|
||||
if (buf == NULL)
|
||||
error = ENOMEM;
|
||||
else
|
||||
error = zio_read(spa, bp, buf);
|
||||
error = zio_read(mount->spa, bp, buf);
|
||||
|
||||
if (error != 0) {
|
||||
free(buf);
|
||||
@@ -3933,7 +3933,7 @@ zfs_lookup(struct zfsmount *mount, const char *upath,
|
||||
p = q;
|
||||
|
||||
/* Only st_mode is inspected here, so identity is irrelevant. */
|
||||
if ((rc = zfs_dnode_stat(spa, &dn, &sb, 0, 0)) != 0)
|
||||
if ((rc = zfs_dnode_stat(mount, &dn, &sb, 0, 0)) != 0)
|
||||
goto done;
|
||||
if (!S_ISDIR(sb.st_mode)) {
|
||||
rc = ENOTDIR;
|
||||
@@ -3959,7 +3959,7 @@ zfs_lookup(struct zfsmount *mount, const char *upath,
|
||||
* Check for symlink.
|
||||
*/
|
||||
/* Only st_mode is inspected here, so identity is irrelevant. */
|
||||
rc = zfs_dnode_stat(spa, &dn, &sb, 0, 0);
|
||||
rc = zfs_dnode_stat(mount, &dn, &sb, 0, 0);
|
||||
if (rc)
|
||||
goto done;
|
||||
if (S_ISLNK(sb.st_mode)) {
|
||||
|
||||
Reference in new issue
Block a user