Skip to content

Commit

Permalink
Merge branch 'master' of github.com:zfs-linux/spl
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand Mitra committed Feb 18, 2011
2 parents 580c3b2 + 4e62af6 commit 09dbaa0
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 19 deletions.
80 changes: 80 additions & 0 deletions config/spl-build.m4
Expand Up @@ -74,6 +74,10 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
SPL_AC_KVASPRINTF
SPL_AC_3ARGS_FILE_FSYNC
SPL_AC_EXPORTED_RWSEM_IS_LOCKED
SPL_AC_3ARGS_BLKDEV_GET
SPL_AC_1ARGS_BLKDEV_PUT
SPL_AC_2ARGS_FOLLOW_DOWN
SPL_AC_D_ALLOC_ANON
])

AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
Expand Down Expand Up @@ -1680,3 +1684,79 @@ AC_DEFUN([SPL_AC_EXPORTED_RWSEM_IS_LOCKED], [
[rwsem_is_locked() acquires sem->wait_lock])],
[])
])



dnl #
dnl # 2.6.26 API change,
dnl # change in blkdev_get
dnl #
AC_DEFUN([SPL_AC_3ARGS_BLKDEV_GET], [
AC_MSG_CHECKING([whether blkdev_get() wants 3 args])
SPL_LINUX_TRY_COMPILE([
#include <linux/fs.h>
],[
blkdev_get(NULL, NULL, 0);
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_3ARGS_BLKDEV_GET, 1,
[blkdev_get() wants 3 args])
],[
AC_MSG_RESULT(no)
])
])

dnl #
dnl # 2.6.26 API change,
dnl # change in blkdev_put
dnl #
AC_DEFUN([SPL_AC_1ARGS_BLKDEV_PUT], [
AC_MSG_CHECKING([whether blkdev_put() wants 1 args])
SPL_LINUX_TRY_COMPILE([
#include <linux/fs.h>
],[
blkdev_put(NULL);
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_1ARGS_BLKDEV_PUT, 1,
[blkdev_put() wants 1 args])
],[
AC_MSG_RESULT(no)
])
])


dnl #
dnl # 2.6.26 API change,
dnl # change in follow_down
dnl #
AC_DEFUN([SPL_AC_2ARGS_FOLLOW_DOWN], [
AC_MSG_CHECKING([whether follow_down() wants 2 args])
SPL_LINUX_TRY_COMPILE([
#include <linux/namei.h>
],[
follow_down(NULL, NULL);
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_2ARGS_FOLLOW_DOWN, 1,
[follow_down() wants 2 args])
],[
AC_MSG_RESULT(no)
])
])



dnl #
dnl # 2.6.28 API change, check whether d_alloc_anon() is available.
dnl # d_alloc_anon() which was fully removed in 2.6.28
dnl #
AC_DEFUN([SPL_AC_D_ALLOC_ANON], [
SPL_CHECK_SYMBOL_EXPORT(
[d_alloc_anon],
[fs/dcache.c],
[AC_DEFINE(HAVE_D_ALLOC_ANON, 1,
[d_alloc_anon() is available])],
[])
])

8 changes: 6 additions & 2 deletions include/sys/cred.h
Expand Up @@ -41,8 +41,12 @@ typedef struct cred cred_t;

typedef struct task_struct cred_t;

#define kcred ((cred_t *)&init_task)
#define CRED() ((cred_t *)current)
#define kcred ((cred_t *)&init_task)
#define CRED() ((cred_t *)current)
#define current_fsuid(cred) (current->fsuid)
#define current_fsgid(cred) (current->fsgid)
#define put_cred(cred) NULL
#define get_current_cred() ((cred_t *)(get_current))

#endif /* HAVE_CRED_STRUCT */

Expand Down
32 changes: 16 additions & 16 deletions include/sys/vnode.h
Expand Up @@ -214,7 +214,7 @@ typedef struct vnode {
(vp)->v_rdev = (dev); \
}

vnode_t *specvp(struct vnode *vp, dev_t dev, vtype_t type, struct cred *cr);
vnode_t *specvp(struct vnode *vp, dev_t dev, vtype_t type, cred_t *cr);

#define LZFS_ITOV(inode) (container_of(inode, vnode_t, v_inode))
#define LZFS_VTOI(vp) (&(vp)->v_inode)
Expand Down Expand Up @@ -341,47 +341,47 @@ extern vnode_t *rootdir;


void
zfs_inactive(vnode_t *vp, struct cred *cr, caller_context_t *ct);
zfs_inactive(vnode_t *vp, cred_t *cr, caller_context_t *ct);

int
zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, struct pathname *pnp,
int flags, vnode_t *rdir, struct cred *cr, caller_context_t *ct,
int flags, vnode_t *rdir, cred_t *cr, caller_context_t *ct,
int *direntflags, pathname_t *realpnp);

int
zfs_create(vnode_t *dvp, char *name, vattr_t *vap, vcexcl_t excl,
int mode, vnode_t **vpp, struct cred *cr, int flag, caller_context_t *ct,
int mode, vnode_t **vpp, cred_t *cr, int flag, caller_context_t *ct,
vsecattr_t *vsecp);

int
zfs_readdir(vnode_t *vp, uio_t *uio, struct cred *cr, int *eofp,
zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int *eofp,
caller_context_t *ct, int flags, filldir_t filldir, uint64_t *pos);

int
zfs_link(vnode_t *tdvp, vnode_t *svp, char *name, struct cred *cr,
zfs_link(vnode_t *tdvp, vnode_t *svp, char *name, cred_t *cr,
caller_context_t *ct, int flags);
int
zfs_remove(vnode_t *dvp, char *name, struct cred *cr, caller_context_t *ct,
zfs_remove(vnode_t *dvp, char *name, cred_t *cr, caller_context_t *ct,
int flags);
int
zfs_mkdir(vnode_t *dvp, char *dirname, vattr_t *vap, vnode_t **vpp,
struct cred *cr,
cred_t *cr,
caller_context_t *ct, int flags, vsecattr_t *vsecp);
int
zfs_rmdir(vnode_t *dvp, char *name, vnode_t *cwd, struct cred *cr,
zfs_rmdir(vnode_t *dvp, char *name, vnode_t *cwd, cred_t *cr,
caller_context_t *ct, int flags);
int
zfs_symlink(vnode_t *dvp, char *name, vattr_t *vap, char *link,
struct cred *cr,
cred_t *cr,
caller_context_t *ct, int flags, vnode_t **vpp);
int
zfs_rename(vnode_t *sdvp, char *snm, vnode_t *tdvp, char *tnm, struct cred *cr,
zfs_rename(vnode_t *sdvp, char *snm, vnode_t *tdvp, char *tnm, cred_t *cr,
caller_context_t *ct, int flags);
int
zfs_setattr(vnode_t *vp, vattr_t *vap, int flags, struct cred *cr,
zfs_setattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
caller_context_t *ct);
int
zfs_readlink(vnode_t *vp, uio_t *uio, struct cred *cr, caller_context_t *ct);
zfs_readlink(vnode_t *vp, uio_t *uio, cred_t *cr, caller_context_t *ct);

int
zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t *cr,
Expand All @@ -396,16 +396,16 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t *cr,
caller_context_t *ct);

int
zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, struct cred *cr,
zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
caller_context_t *ct);
int
zfs_fsync(vnode_t *vp, int syncflag, struct cred *cr,
zfs_fsync(vnode_t *vp, int syncflag, cred_t *cr,
caller_context_t *ct);
void
xva_init(xvattr_t *xvap);

int zfs_space(vnode_t *vp, int cmd, flock64_t *bfp, int flag,
offset_t offset, struct cred *cr, caller_context_t *ct);
offset_t offset, cred_t *cr, caller_context_t *ct);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion module/spl/spl-vnode.c
Expand Up @@ -131,7 +131,7 @@ EXPORT_SYMBOL(vn_get_lin_type);
* inode device type in this function
*/
vnode_t *
specvp(struct vnode *vp, dev_t dev, vtype_t type, struct cred *cr)
specvp(struct vnode *vp, dev_t dev, vtype_t type, cred_t *cr)
{
VN_HOLD(vp);
init_special_inode(&vp->v_inode,vn_get_lin_type(type) , dev);
Expand Down
12 changes: 12 additions & 0 deletions spl_config.h.in
Expand Up @@ -9,6 +9,12 @@
/* Define to 1 to enable detailed kmem tracking */
#undef DEBUG_KMEM_TRACKING

/* blkdev_put() wants 1 args */
#undef HAVE_1ARGS_BLKDEV_PUT

/* follow_down() wants 2 args */
#undef HAVE_2ARGS_FOLLOW_DOWN

/* register_sysctl_table() wants 2 args */
#undef HAVE_2ARGS_REGISTER_SYSCTL

Expand All @@ -18,6 +24,9 @@
/* vfs_unlink() wants 2 args */
#undef HAVE_2ARGS_VFS_UNLINK

/* blkdev_get() wants 3 args */
#undef HAVE_3ARGS_BLKDEV_GET

/* file_fsync() wants 3 args */
#undef HAVE_3ARGS_FILE_FSYNC

Expand Down Expand Up @@ -66,6 +75,9 @@
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H

/* d_alloc_anon() is available */
#undef HAVE_D_ALLOC_ANON

/* linux/fdtable.h exists */
#undef HAVE_FDTABLE_HEADER

Expand Down

0 comments on commit 09dbaa0

Please sign in to comment.