summaryrefslogtreecommitdiffstats
path: root/sys/fs/smbfs/smbfs_vfsops.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2009-05-11 15:33:26 +0000
committerattilio <attilio@FreeBSD.org>2009-05-11 15:33:26 +0000
commit1dcb84131b6679f5d53452314d4ca1dfe2d8c5f0 (patch)
tree6591f00318da636f44a6ceb26f517e7795eb1b44 /sys/fs/smbfs/smbfs_vfsops.c
parentebcb20267286e4ffadb3f603af56bd7a1df1f422 (diff)
downloadFreeBSD-src-1dcb84131b6679f5d53452314d4ca1dfe2d8c5f0.zip
FreeBSD-src-1dcb84131b6679f5d53452314d4ca1dfe2d8c5f0.tar.gz
Remove the thread argument from the FSD (File-System Dependent) parts of
the VFS. Now all the VFS_* functions and relating parts don't want the context as long as it always refers to curthread. In some points, in particular when dealing with VOPs and functions living in the same namespace (eg. vflush) which still need to be converted, pass curthread explicitly in order to retain the old behaviour. Such loose ends will be fixed ASAP. While here fix a bug: now, UFS_EXTATTR can be compiled alone without the UFS_EXTATTR_AUTOSTART option. VFS KPI is heavilly changed by this commit so thirdy parts modules needs to be recompiled. Bump __FreeBSD_version in order to signal such situation.
Diffstat (limited to 'sys/fs/smbfs/smbfs_vfsops.c')
-rw-r--r--sys/fs/smbfs/smbfs_vfsops.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c
index 71b3960..b762bde 100644
--- a/sys/fs/smbfs/smbfs_vfsops.c
+++ b/sys/fs/smbfs/smbfs_vfsops.c
@@ -104,7 +104,7 @@ MODULE_DEPEND(smbfs, libmchain, 1, 1, 1);
int smbfs_pbuf_freecnt = -1; /* start out unlimited */
static int
-smbfs_cmount(struct mntarg *ma, void * data, int flags, struct thread *td)
+smbfs_cmount(struct mntarg *ma, void * data, int flags)
{
struct smbfs_args args;
int error;
@@ -143,16 +143,18 @@ static const char *smbfs_opts[] = {
};
static int
-smbfs_mount(struct mount *mp, struct thread *td)
+smbfs_mount(struct mount *mp)
{
struct smbmount *smp = NULL;
struct smb_vc *vcp;
struct smb_share *ssp = NULL;
struct vnode *vp;
+ struct thread *td;
struct smb_cred scred;
int error, v;
char *pc, *pe;
+ td = curthread;
if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS))
return EOPNOTSUPP;
@@ -249,7 +251,7 @@ smbfs_mount(struct mount *mp, struct thread *td)
}
}
vfs_getnewfsid(mp);
- error = smbfs_root(mp, LK_EXCLUSIVE, &vp, td);
+ error = smbfs_root(mp, LK_EXCLUSIVE, &vp);
if (error) {
vfs_mount_error(mp, "smbfs_root error: %d", error);
goto bad;
@@ -279,13 +281,15 @@ bad:
/* Unmount the filesystem described by mp. */
static int
-smbfs_unmount(struct mount *mp, int mntflags, struct thread *td)
+smbfs_unmount(struct mount *mp, int mntflags)
{
+ struct thread *td;
struct smbmount *smp = VFSTOSMBFS(mp);
struct smb_cred scred;
int error, flags;
SMBVDEBUG("smbfs_unmount: flags=%04x\n", mntflags);
+ td = curthread;
flags = 0;
if (mntflags & MNT_FORCE)
flags |= FORCECLOSE;
@@ -329,16 +333,20 @@ smbfs_unmount(struct mount *mp, int mntflags, struct thread *td)
* Return locked root vnode of a filesystem
*/
static int
-smbfs_root(struct mount *mp, int flags, struct vnode **vpp, struct thread *td)
+smbfs_root(struct mount *mp, int flags, struct vnode **vpp)
{
struct smbmount *smp = VFSTOSMBFS(mp);
struct vnode *vp;
struct smbnode *np;
struct smbfattr fattr;
- struct ucred *cred = td->td_ucred;
+ struct thread *td;
+ struct ucred *cred;
struct smb_cred scred;
int error;
+ td = curthread;
+ cred = td->td_ucred;
+
if (smp == NULL) {
SMBERROR("smp == NULL (bug in umount)\n");
vfs_mount_error(mp, "smp == NULL (bug in umount)");
@@ -368,12 +376,11 @@ smbfs_root(struct mount *mp, int flags, struct vnode **vpp, struct thread *td)
*/
/* ARGSUSED */
static int
-smbfs_quotactl(mp, cmd, uid, arg, td)
+smbfs_quotactl(mp, cmd, uid, arg)
struct mount *mp;
int cmd;
uid_t uid;
void *arg;
- struct thread *td;
{
SMBVDEBUG("return EOPNOTSUPP\n");
return EOPNOTSUPP;
@@ -404,8 +411,9 @@ smbfs_uninit(struct vfsconf *vfsp)
* smbfs_statfs call
*/
int
-smbfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td)
+smbfs_statfs(struct mount *mp, struct statfs *sbp)
{
+ struct thread *td = curthread;
struct smbmount *smp = VFSTOSMBFS(mp);
struct smbnode *np = smp->sm_root;
struct smb_share *ssp = smp->sm_share;
OpenPOWER on IntegriCloud