Date: Wed, 14 Nov 2012 19:10:50 +0000 (UTC) From: Davide Italiano <davide@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243038 - head/sys/fs/smbfs Message-ID: <201211141910.qAEJAoMG033370@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: davide Date: Wed Nov 14 19:10:50 2012 New Revision: 243038 URL: http://svnweb.freebsd.org/changeset/base/243038 Log: Get rid of some old debug code. It provides checks similar to the one offered by RedZone so there's no need to keep it. Sponsored by: iXsystems inc. Modified: head/sys/fs/smbfs/smbfs_node.c head/sys/fs/smbfs/smbfs_vnops.c Modified: head/sys/fs/smbfs/smbfs_node.c ============================================================================== --- head/sys/fs/smbfs/smbfs_node.c Wed Nov 14 18:54:08 2012 (r243037) +++ head/sys/fs/smbfs/smbfs_node.c Wed Nov 14 19:10:50 2012 (r243038) @@ -70,18 +70,8 @@ smbfs_name_alloc(const u_char *name, int u_char *cp; nmlen++; -#ifdef SMBFS_NAME_DEBUG - cp = malloc(nmlen + 2 + sizeof(int), M_SMBNODENAME, M_WAITOK); - *(int*)cp = nmlen; - cp += sizeof(int); - cp[0] = 0xfc; - cp++; - bcopy(name, cp, nmlen - 1); - cp[nmlen] = 0xfe; -#else cp = malloc(nmlen, M_SMBNODENAME, M_WAITOK); bcopy(name, cp, nmlen - 1); -#endif cp[nmlen - 1] = 0; return cp; } @@ -89,26 +79,8 @@ smbfs_name_alloc(const u_char *name, int static void smbfs_name_free(u_char *name) { -#ifdef SMBFS_NAME_DEBUG - int nmlen, slen; - u_char *cp; - cp = name; - cp--; - if (*cp != 0xfc) - panic("First byte of name entry '%s' corrupted", name); - cp -= sizeof(int); - nmlen = *(int*)cp; - slen = strlen(name) + 1; - if (nmlen != slen) - panic("Name length mismatch: was %d, now %d name '%s'", - nmlen, slen, name); - if (name[nmlen] != 0xfe) - panic("Last byte of name entry '%s' corrupted\n", name); - free(cp, M_SMBNODENAME); -#else free(name, M_SMBNODENAME); -#endif } static int __inline Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Wed Nov 14 18:54:08 2012 (r243037) +++ head/sys/fs/smbfs/smbfs_vnops.c Wed Nov 14 19:10:50 2012 (r243038) @@ -1135,18 +1135,6 @@ smbfs_lookup(ap) SMBFSERR("invalid '..'\n"); return EIO; } -#ifdef SMB_VNODE_DEBUG - { - char *cp, c; - - cp = name + nmlen; - c = *cp; - *cp = 0; - SMBVDEBUG("%d '%s' in '%s' id=d\n", nameiop, name, - VTOSMB(dvp)->n_name); - *cp = c; - } -#endif islastcn = flags & ISLASTCN; if (islastcn && (mp->mnt_flag & MNT_RDONLY) && (nameiop != LOOKUP)) return EROFS;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211141910.qAEJAoMG033370>