vfs: replace VFS_NOTIFY_UPPER_* macros with an enum

This commit is contained in:
Mateusz Guzik 2022-03-19 13:15:55 +00:00
parent cceb91b025
commit eb574ba0b6
2 changed files with 7 additions and 8 deletions

View file

@ -3942,7 +3942,7 @@ vgone(struct vnode *vp)
* Notify upper mounts about reclaimed or unlinked vnode.
*/
void
vfs_notify_upper(struct vnode *vp, int event)
vfs_notify_upper(struct vnode *vp, enum vfs_notify_upper_type event)
{
struct mount *mp;
struct mount_upper_node *ump;
@ -3966,9 +3966,6 @@ vfs_notify_upper(struct vnode *vp, int event)
case VFS_NOTIFY_UPPER_UNLINK:
VFS_UNLINK_LOWERVP(ump->mp, vp);
break;
default:
KASSERT(0, ("invalid event %d", event));
break;
}
MNT_ILOCK(mp);
}

View file

@ -939,9 +939,6 @@ vfs_statfs_t __vfs_statfs;
VN_KNOTE((vp), (hint), 0); \
} while (0)
#define VFS_NOTIFY_UPPER_RECLAIM 1
#define VFS_NOTIFY_UPPER_UNLINK 2
#include <sys/module.h>
/*
@ -967,6 +964,11 @@ vfs_statfs_t __vfs_statfs;
}; \
DECLARE_MODULE(fsname, fsname ## _mod, SI_SUB_VFS, SI_ORDER_MIDDLE)
enum vfs_notify_upper_type {
VFS_NOTIFY_UPPER_RECLAIM,
VFS_NOTIFY_UPPER_UNLINK,
};
/*
* exported vnode operations
*/
@ -1020,7 +1022,7 @@ int vfs_modevent(module_t, int, void *);
void vfs_mount_error(struct mount *, const char *, ...);
void vfs_mountroot(void); /* mount our root filesystem */
void vfs_mountedfrom(struct mount *, const char *from);
void vfs_notify_upper(struct vnode *, int);
void vfs_notify_upper(struct vnode *, enum vfs_notify_upper_type);
struct mount *vfs_ref_from_vp(struct vnode *);
void vfs_ref(struct mount *);
void vfs_rel(struct mount *);