-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zfs_vnops: refactor + make zfs_get_data OS-independent
- include/sys/zfs_vnops.h contains declarations of vnop functions that implement the same behavior on every platform. Function definitions are in - module/zfs/zfs_vnops.c for OS-independent code - module/os/*/zfs_vnops.c for OS-specific code In order to share the zfs_symlink declaration, the FreeBSD variant had to lose it's constness on the `char*` parameters. - As a PoC, move zfs_get_data to zfs_vnops.c - This required creating a compatible zfs_zrele_async for FreeBSD. Signed-off-by: Christian Schwarz <me@cschwarz.com>
- Loading branch information
Showing
26 changed files
with
255 additions
and
372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#ifndef _SYS_ZFS_VNOPS_H_ | ||
#define _SYS_ZFS_VNOPS_H_ | ||
|
||
#include <sys/zil.h> | ||
|
||
/* | ||
* Functions declared in this file implement equivalent behavior on | ||
* all platforms. | ||
* OS-specific additions are in zfs_vnops_os.h. | ||
*/ | ||
|
||
|
||
/* | ||
* Platform code that asynchronously drops zp's inode / vnode_t. | ||
* | ||
* Asynchronous dropping ensures that the caller will never drop the | ||
* last reference on an inode / vnode_t in the current context. | ||
* Doing so while holding open a tx could result in a deadlock if | ||
* the platform calls into filesystem again in the implementation | ||
* of inode / vnode_t dropping (e.g. call from iput_final()). | ||
*/ | ||
extern void zfs_zrele_async(znode_t *zp); | ||
|
||
extern zil_get_data_t zfs_get_data; | ||
|
||
extern int zfs_create(znode_t *dzp, char *name, vattr_t *vap, int excl, | ||
int mode, znode_t **zpp, cred_t *cr, int flag, vsecattr_t *vsecp); | ||
|
||
extern int zfs_remove(znode_t *dzp, char *name, cred_t *cr, int flags); | ||
extern int zfs_mkdir(znode_t *dzp, char *dirname, vattr_t *vap, | ||
znode_t **zpp, cred_t *cr, int flags, vsecattr_t *vsecp); | ||
extern int zfs_rmdir(znode_t *dzp, char *name, znode_t *cwd, | ||
cred_t *cr, int flags); | ||
extern int zfs_setattr(znode_t *zp, vattr_t *vap, int flag, cred_t *cr); | ||
extern int zfs_rename(znode_t *sdzp, char *snm, znode_t *tdzp, | ||
char *tnm, cred_t *cr, int flags); | ||
extern int zfs_symlink(znode_t *dzp, char *name, vattr_t *vap, char *link, | ||
znode_t **zpp, cred_t *cr, int flags); | ||
extern int zfs_link(znode_t *tdzp, znode_t *sp, | ||
char *name, cred_t *cr, int flags); | ||
extern int zfs_space(znode_t *zp, int cmd, struct flock *bfp, int flag, | ||
offset_t offset, cred_t *cr); | ||
extern int zfs_setsecattr(znode_t *zp, vsecattr_t *vsecp, int flag, | ||
cred_t *cr); | ||
extern int zfs_write_simple(znode_t *zp, const void *data, size_t len, | ||
loff_t pos, size_t *resid); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.