Skip to content

Commit

Permalink
restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrens committed Jun 8, 2020
1 parent b42b0fe commit 9641a7e
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 221 deletions.
2 changes: 1 addition & 1 deletion cmd/zhack/zhack.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fatal(spa_t *spa, void *tag, const char *fmt, ...)

/* ARGSUSED */
static int
space_delta_cb(dmu_object_type_t bonustype, void *data,
space_delta_cb(dmu_object_type_t bonustype, const void *data,
zfs_file_info_t *zoi)
{
/*
Expand Down
10 changes: 8 additions & 2 deletions include/sys/dmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ struct zio_prop;
struct sa_handle;
struct dsl_crypto_params;
struct locked_range;
struct zfs_file_info;

typedef struct objset objset_t;
typedef struct dmu_tx dmu_tx_t;
Expand Down Expand Up @@ -1014,7 +1013,14 @@ extern int dmu_snapshot_realname(objset_t *os, char *name, char *real,
extern int dmu_dir_list_next(objset_t *os, int namelen, char *name,
uint64_t *idp, uint64_t *offp);

typedef int file_info_cb_t(dmu_object_type_t bonustype, void *data,
typedef struct zfs_file_info {
uint64_t zfi_user;
uint64_t zfi_group;
uint64_t zfi_project;
uint64_t zfi_generation;
} zfs_file_info_t;

typedef int file_info_cb_t(dmu_object_type_t bonustype, const void *data,
struct zfs_file_info *zoi);
extern void dmu_objset_register_type(dmu_objset_type_t ost,
file_info_cb_t *cb);
Expand Down
11 changes: 2 additions & 9 deletions include/sys/dmu_objset.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,6 @@ struct objset {
int os_upgrade_status;
};

typedef struct zfs_file_info {
uint64_t zfi_user;
uint64_t zfi_group;
uint64_t zfi_project;
uint64_t zfi_generation;
} zfs_file_info_t;

#define DMU_META_OBJSET 0
#define DMU_META_DNODE_OBJECT 0
#define DMU_OBJECT_IS_SPECIAL(obj) ((int64_t)(obj) <= 0)
Expand Down Expand Up @@ -261,8 +254,8 @@ boolean_t dmu_objset_projectquota_enabled(objset_t *os);
boolean_t dmu_objset_projectquota_present(objset_t *os);
boolean_t dmu_objset_projectquota_upgradable(objset_t *os);
void dmu_objset_id_quota_upgrade(objset_t *os);
int dmu_get_file_info(objset_t *os, dmu_object_type_t bonustype, void *data,
zfs_file_info_t *zfi);
int dmu_get_file_info(objset_t *os, dmu_object_type_t bonustype,
const void *data, zfs_file_info_t *zfi);

int dmu_fsname(const char *snapname, char *buf);

Expand Down
2 changes: 1 addition & 1 deletion include/sys/zfs_quota.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct zfsvfs;
struct zfs_file_info_t;

extern int zpl_get_file_info(dmu_object_type_t,
void *, struct zfs_file_info *);
const void *, struct zfs_file_info *);

extern int zfs_userspace_one(struct zfsvfs *, zfs_userquota_prop_t,
const char *, uint64_t, uint64_t *);
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/dmu_objset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ dmu_objset_register_type(dmu_objset_type_t ost, file_info_cb_t *cb)
}

int
dmu_get_file_info(objset_t *os, dmu_object_type_t bonustype, void *data,
dmu_get_file_info(objset_t *os, dmu_object_type_t bonustype, const void *data,
zfs_file_info_t *zfi)
{
file_info_cb_t *cb = file_cbs[os->os_phys->os_type];
Expand Down
Loading

0 comments on commit 9641a7e

Please sign in to comment.