summaryrefslogtreecommitdiffstats
path: root/sys/fs/smbfs/smbfs_vfsops.c
diff options
context:
space:
mode:
authordavide <davide@FreeBSD.org>2012-10-25 20:23:04 +0000
committerdavide <davide@FreeBSD.org>2012-10-25 20:23:04 +0000
commitbac20b679d394666359241df51cd79eab738bc5a (patch)
tree80353a474646ca0a147c238f3a413986b57177bd /sys/fs/smbfs/smbfs_vfsops.c
parent7a91df3c3792dc1bed5ff818447fc26896d809d1 (diff)
downloadFreeBSD-src-bac20b679d394666359241df51cd79eab738bc5a.zip
FreeBSD-src-bac20b679d394666359241df51cd79eab738bc5a.tar.gz
- Remove the references to the deprecated zalloc kernel interface
- Use M_ZERO flag in malloc() rather than bzero() - malloc() with M_NOWAIT can't return NULL so there's no need to check Reviewed by: alc Approved by: alc
Diffstat (limited to 'sys/fs/smbfs/smbfs_vfsops.c')
-rw-r--r--sys/fs/smbfs/smbfs_vfsops.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c
index f5460b5..2443001 100644
--- a/sys/fs/smbfs/smbfs_vfsops.c
+++ b/sys/fs/smbfs/smbfs_vfsops.c
@@ -54,13 +54,6 @@ static int smbfs_debuglevel = 0;
static int smbfs_version = SMBFS_VERSION;
-#ifdef SMBFS_USEZONE
-#include <vm/vm.h>
-#include <vm/vm_extern.h>
-
-vm_zone_t smbfsmount_zone;
-#endif
-
SYSCTL_NODE(_vfs, OID_AUTO, smbfs, CTLFLAG_RW, 0, "SMB/CIFS filesystem");
SYSCTL_INT(_vfs_smbfs, OID_AUTO, version, CTLFLAG_RD, &smbfs_version, 0, "");
SYSCTL_INT(_vfs_smbfs, OID_AUTO, debuglevel, CTLFLAG_RW, &smbfs_debuglevel, 0, "");
@@ -172,18 +165,7 @@ smbfs_mount(struct mount *mp)
smb_share_unlock(ssp, 0);
mp->mnt_stat.f_iosize = SSTOVC(ssp)->vc_txmax;
-#ifdef SMBFS_USEZONE
- smp = zalloc(smbfsmount_zone);
-#else
- smp = malloc(sizeof(*smp), M_SMBFSDATA, M_WAITOK);
-#endif
- if (smp == NULL) {
- printf("could not alloc smbmount\n");
- vfs_mount_error(mp, "could not alloc smbmount", v, error);
- error = ENOMEM;
- goto bad;
- }
- bzero(smp, sizeof(*smp));
+ smp = malloc(sizeof(*smp), M_SMBFSDATA, M_WAITOK | M_ZERO);
mp->mnt_data = smp;
smp->sm_hash = hashinit(desiredvnodes, M_SMBFSHASH, &smp->sm_hashlen);
if (smp->sm_hash == NULL)
@@ -261,11 +243,7 @@ bad:
if (smp->sm_hash)
free(smp->sm_hash, M_SMBFSHASH);
sx_destroy(&smp->sm_hashlock);
-#ifdef SMBFS_USEZONE
- zfree(smbfsmount_zone, smp);
-#else
free(smp, M_SMBFSDATA);
-#endif
}
if (ssp)
smb_share_put(ssp, &scred);
@@ -311,11 +289,7 @@ smbfs_unmount(struct mount *mp, int mntflags)
if (smp->sm_hash)
free(smp->sm_hash, M_SMBFSHASH);
sx_destroy(&smp->sm_hashlock);
-#ifdef SMBFS_USEZONE
- zfree(smbfsmount_zone, smp);
-#else
free(smp, M_SMBFSDATA);
-#endif
MNT_ILOCK(mp);
mp->mnt_flag &= ~MNT_LOCAL;
MNT_IUNLOCK(mp);
@@ -383,9 +357,6 @@ smbfs_quotactl(mp, cmd, uid, arg)
int
smbfs_init(struct vfsconf *vfsp)
{
-#ifdef SMBFS_USEZONE
- smbfsmount_zone = zinit("SMBFSMOUNT", sizeof(struct smbmount), 0, 0, 1);
-#endif
smbfs_pbuf_freecnt = nswbuf / 2 + 1;
SMBVDEBUG("done.\n");
return 0;
OpenPOWER on IntegriCloud