From 4fa49ab869ecc59c8d25862401514a6454f84ec4 Mon Sep 17 00:00:00 2001 From: christos Date: Tue, 27 Sep 2011 01:01:43 +0000 Subject: [PATCH] define and use ISO_MAXNAMLEN instead of MAXNAMLEN --- sys/fs/cd9660/cd9660_util.c | 8 ++++---- sys/fs/cd9660/cd9660_vfsops.c | 6 +++--- sys/fs/cd9660/iso.h | 4 +++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/fs/cd9660/cd9660_util.c b/sys/fs/cd9660/cd9660_util.c index d0dfecad36d1..a8d0ef23803d 100644 --- a/sys/fs/cd9660/cd9660_util.c +++ b/sys/fs/cd9660/cd9660_util.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_util.c,v 1.9 2008/02/27 19:43:36 matt Exp $ */ +/* $NetBSD: cd9660_util.c,v 1.10 2011/09/27 01:01:43 christos Exp $ */ /*- * Copyright (c) 1994 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cd9660_util.c,v 1.9 2008/02/27 19:43:36 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd9660_util.c,v 1.10 2011/09/27 01:01:43 christos Exp $"); #include #include @@ -187,10 +187,10 @@ isofntrans(const u_char *infn, int infnlen, u_char *outfn, u_short *outfnlen, break; } - sz = wput(outfn, MAXNAMLEN - fnidx, c, joliet_level); + sz = wput(outfn, ISO_MAXNAMLEN - fnidx, c, joliet_level); if (sz == 0) { /* not enough space to write the character */ - if (fnidx < MAXNAMLEN) { + if (fnidx < ISO_MAXNAMLEN) { *outfn = '?'; fnidx++; } diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index ba499338ddbb..086e26737be0 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_vfsops.c,v 1.72 2011/06/12 03:35:52 rmind Exp $ */ +/* $NetBSD: cd9660_vfsops.c,v 1.73 2011/09/27 01:01:43 christos Exp $ */ /*- * Copyright (c) 1994 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.72 2011/06/12 03:35:52 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.73 2011/09/27 01:01:43 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -444,7 +444,7 @@ iso_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, mp->mnt_stat.f_fsidx.__fsid_val[0] = (long)dev; mp->mnt_stat.f_fsidx.__fsid_val[1] = makefstype(MOUNT_CD9660); mp->mnt_stat.f_fsid = mp->mnt_stat.f_fsidx.__fsid_val[0]; - mp->mnt_stat.f_namemax = MAXNAMLEN; + mp->mnt_stat.f_namemax = ISO_MAXNAMLEN; mp->mnt_flag |= MNT_LOCAL; mp->mnt_iflag |= IMNT_MPSAFE; mp->mnt_dev_bshift = iso_bsize; diff --git a/sys/fs/cd9660/iso.h b/sys/fs/cd9660/iso.h index 69b50d37dd2f..14dd98616411 100644 --- a/sys/fs/cd9660/iso.h +++ b/sys/fs/cd9660/iso.h @@ -1,4 +1,4 @@ -/* $NetBSD: iso.h,v 1.9 2007/01/27 07:20:31 cbiere Exp $ */ +/* $NetBSD: iso.h,v 1.10 2011/09/27 01:01:44 christos Exp $ */ /*- * Copyright (c) 1994 @@ -62,6 +62,8 @@ struct iso_volume_descriptor { #define ISO_STANDARD_ID "CD001" #define ISO_ECMA_ID "CDW01" +#define ISO_MAXNAMLEN 255 + struct iso_primary_descriptor { char type [ISODCL ( 1, 1)]; /* 711 */ char id [ISODCL ( 2, 6)];