Skip to content

Commit

Permalink
zfs_znode: lift common code to a single shared file
Browse files Browse the repository at this point in the history
For now, userspace has no znode implementation. Some of the property and
path handling code is used there though and is the same on all
platforms, so we only need a single copy of it.

Reviewed by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #16492
  • Loading branch information
robn authored and behlendorf committed Sep 19, 2024
1 parent 4c9b59e commit c22d56e
Show file tree
Hide file tree
Showing 7 changed files with 404 additions and 748 deletions.
2 changes: 2 additions & 0 deletions include/sys/zfs_znode.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ extern "C" {
#define ZFS_DIRENT_OBJ(de) BF64_GET(de, 0, 48)

extern int zfs_obj_to_path(objset_t *osp, uint64_t obj, char *buf, int len);
extern int zfs_obj_to_pobj(objset_t *osp, sa_handle_t *hdl,
sa_attr_type_t *sa_table, uint64_t *pobjp, int *is_xattrdir);
extern int zfs_get_zplprop(objset_t *os, zfs_prop_t prop, uint64_t *value);

#ifdef _KERNEL
Expand Down
2 changes: 1 addition & 1 deletion lib/libzpool/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ nodist_libzpool_la_SOURCES = \
\
module/os/linux/zfs/vdev_file.c \
module/os/linux/zfs/zfs_debug.c \
module/os/linux/zfs/zfs_znode.c \
module/os/linux/zfs/zio_crypt.c \
\
module/zcommon/cityhash.c \
Expand Down Expand Up @@ -183,6 +182,7 @@ nodist_libzpool_la_SOURCES = \
module/zfs/zfs_ratelimit.c \
module/zfs/zfs_rlock.c \
module/zfs/zfs_sa.c \
module/zfs/zfs_znode.c \
module/zfs/zil.c \
module/zfs/zio.c \
module/zfs/zio_checksum.c \
Expand Down
3 changes: 2 additions & 1 deletion module/Kbuild.in
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ ZFS_OBJS := \
zfs_rlock.o \
zfs_sa.o \
zfs_vnops.o \
zfs_znode.o \
zil.o \
zio.o \
zio_checksum.o \
Expand Down Expand Up @@ -458,7 +459,7 @@ ZFS_OBJS_OS := \
zfs_uio.o \
zfs_vfsops.o \
zfs_vnops_os.o \
zfs_znode.o \
zfs_znode_os.o \
zio_crypt.o \
zpl_ctldir.o \
zpl_export.o \
Expand Down
3 changes: 2 additions & 1 deletion module/Makefile.bsd
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ SRCS+= abd_os.c \
zfs_racct.c \
zfs_vfsops.c \
zfs_vnops_os.c \
zfs_znode.c \
zfs_znode_os.c \
zio_crypt.c \
zvol_os.c

Expand Down Expand Up @@ -358,6 +358,7 @@ SRCS+= abd.c \
zfs_rlock.c \
zfs_sa.c \
zfs_vnops.c \
zfs_znode.c \
zil.c \
zio.c \
zio_checksum.c \
Expand Down
Loading

0 comments on commit c22d56e

Please sign in to comment.