Deleted Added
full compact
smbfs_vfsops.c (175294) smbfs_vfsops.c (176744)
1/*-
2 * Copyright (c) 2000-2001, Boris Popov
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
1/*-
2 * Copyright (c) 2000-2001, Boris Popov
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $FreeBSD: head/sys/fs/smbfs/smbfs_vfsops.c 175294 2008-01-13 14:44:15Z attilio $
32 * $FreeBSD: head/sys/fs/smbfs/smbfs_vfsops.c 176744 2008-03-02 18:56:13Z rwatson $
33 */
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/proc.h>
38#include <sys/bio.h>
39#include <sys/buf.h>
40#include <sys/kernel.h>
41#include <sys/sysctl.h>
42#include <sys/vnode.h>
43#include <sys/mount.h>
44#include <sys/stat.h>
45#include <sys/malloc.h>
46#include <sys/module.h>
33 */
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/proc.h>
38#include <sys/bio.h>
39#include <sys/buf.h>
40#include <sys/kernel.h>
41#include <sys/sysctl.h>
42#include <sys/vnode.h>
43#include <sys/mount.h>
44#include <sys/stat.h>
45#include <sys/malloc.h>
46#include <sys/module.h>
47#include <sys/sx.h>
47
48
49#include <netsmb/smb.h>
50#include <netsmb/smb_conn.h>
51#include <netsmb/smb_subr.h>
52#include <netsmb/smb_dev.h>
53
54#include <fs/smbfs/smbfs.h>

--- 132 unchanged lines hidden (view full) ---

187 error = ENOMEM;
188 goto bad;
189 }
190 bzero(smp, sizeof(*smp));
191 mp->mnt_data = smp;
192 smp->sm_hash = hashinit(desiredvnodes, M_SMBFSHASH, &smp->sm_hashlen);
193 if (smp->sm_hash == NULL)
194 goto bad;
48
49
50#include <netsmb/smb.h>
51#include <netsmb/smb_conn.h>
52#include <netsmb/smb_subr.h>
53#include <netsmb/smb_dev.h>
54
55#include <fs/smbfs/smbfs.h>

--- 132 unchanged lines hidden (view full) ---

188 error = ENOMEM;
189 goto bad;
190 }
191 bzero(smp, sizeof(*smp));
192 mp->mnt_data = smp;
193 smp->sm_hash = hashinit(desiredvnodes, M_SMBFSHASH, &smp->sm_hashlen);
194 if (smp->sm_hash == NULL)
195 goto bad;
195 lockinit(&smp->sm_hashlock, PVFS, "smbfsh", 0, 0);
196 sx_init(&smp->sm_hashlock, "smbfsh");
196 smp->sm_share = ssp;
197 smp->sm_root = NULL;
198 if (1 != vfs_scanopt(mp->mnt_optnew,
199 "caseopt", "%d", &smp->sm_caseopt)) {
200 vfs_mount_error(mp, "Invalid caseopt");
201 error = EINVAL;
202 goto bad;
203 }

--- 55 unchanged lines hidden (view full) ---

259#ifdef DIAGNOSTICS
260 SMBERROR("mp=%p\n", mp);
261#endif
262 return error;
263bad:
264 if (smp) {
265 if (smp->sm_hash)
266 free(smp->sm_hash, M_SMBFSHASH);
197 smp->sm_share = ssp;
198 smp->sm_root = NULL;
199 if (1 != vfs_scanopt(mp->mnt_optnew,
200 "caseopt", "%d", &smp->sm_caseopt)) {
201 vfs_mount_error(mp, "Invalid caseopt");
202 error = EINVAL;
203 goto bad;
204 }

--- 55 unchanged lines hidden (view full) ---

260#ifdef DIAGNOSTICS
261 SMBERROR("mp=%p\n", mp);
262#endif
263 return error;
264bad:
265 if (smp) {
266 if (smp->sm_hash)
267 free(smp->sm_hash, M_SMBFSHASH);
267 lockdestroy(&smp->sm_hashlock);
268 sx_destroy(&smp->sm_hashlock);
268#ifdef SMBFS_USEZONE
269 zfree(smbfsmount_zone, smp);
270#else
271 free(smp, M_SMBFSDATA);
272#endif
273 }
274 if (ssp)
275 smb_share_put(ssp, &scred);

--- 31 unchanged lines hidden (view full) ---

307 error = smb_share_lock(smp->sm_share, LK_EXCLUSIVE, td);
308 if (error)
309 return error;
310 smb_share_put(smp->sm_share, &scred);
311 mp->mnt_data = NULL;
312
313 if (smp->sm_hash)
314 free(smp->sm_hash, M_SMBFSHASH);
269#ifdef SMBFS_USEZONE
270 zfree(smbfsmount_zone, smp);
271#else
272 free(smp, M_SMBFSDATA);
273#endif
274 }
275 if (ssp)
276 smb_share_put(ssp, &scred);

--- 31 unchanged lines hidden (view full) ---

308 error = smb_share_lock(smp->sm_share, LK_EXCLUSIVE, td);
309 if (error)
310 return error;
311 smb_share_put(smp->sm_share, &scred);
312 mp->mnt_data = NULL;
313
314 if (smp->sm_hash)
315 free(smp->sm_hash, M_SMBFSHASH);
315 lockdestroy(&smp->sm_hashlock);
316 sx_destroy(&smp->sm_hashlock);
316#ifdef SMBFS_USEZONE
317 zfree(smbfsmount_zone, smp);
318#else
319 free(smp, M_SMBFSDATA);
320#endif
321 MNT_ILOCK(mp);
322 mp->mnt_flag &= ~MNT_LOCAL;
323 MNT_IUNLOCK(mp);

--- 107 unchanged lines hidden ---
317#ifdef SMBFS_USEZONE
318 zfree(smbfsmount_zone, smp);
319#else
320 free(smp, M_SMBFSDATA);
321#endif
322 MNT_ILOCK(mp);
323 mp->mnt_flag &= ~MNT_LOCAL;
324 MNT_IUNLOCK(mp);

--- 107 unchanged lines hidden ---