From owner-freebsd-arch Tue Feb 4 3:29:53 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 105C837B401 for ; Tue, 4 Feb 2003 03:29:52 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3EFBA43F93 for ; Tue, 4 Feb 2003 03:29:51 -0800 (PST) (envelope-from phk@freebsd.org) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id h14BToYu019573 for ; Tue, 4 Feb 2003 12:29:50 +0100 (CET) (envelope-from phk@freebsd.org) To: arch@freebsd.org Subject: length of device names. From: phk@freebsd.org Date: Tue, 04 Feb 2003 12:29:50 +0100 Message-ID: <19572.1044358190@critter.freebsd.dk> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG There are some irritating implications of making device names truly variable size, and I am not yet comfortable making the semantic changes it causes, people calle makedev() and make_dev() from the damnest places. In fact, I am not even convinced doing the work would have a positive payoff in the end compared to sticking with KISS and just taking the memory hit for a longer default buffer. I decided to increase the limit to 63 characters for now, and revisit the issue if this limit ever becomes a problem. I personally expect and hope that any device name approaching than 63 characters would hit against other (esthetical) boundaries first. We currently allocate 50 dev_t's at compile time (to be able to make it until malloc(9) works) and the rest with malloc(9). The current size of a dev_t is 140 bytes + space for the name, so in theory we can allow for 116 bytes long names at a net cost of only 50 times the increase since malloc(9) already allocates us 256 bytes buckets, so the net cost of this change was 2400 bytes. Summary: I'm shelving the unlimited name length for now, hoping that 63 or subsequently 116 will be enough to cater for our needs. Poul-Henning In message <200302041107.h14B7ST1060100@repoman.freebsd.org>, Poul-Henning Kamp writes: >phk 2003/02/04 03:07:28 PST > > Modified files: > sys/sys param.h > Log: > Increase the allowed length of device names to 63 characters. > > This is a band-aid while I fret over how much breakage removing the > restriction entirely will result in. > > Please note that this is still a limit for the entire pathname > relative to the mountpoint of devfs, so the length of "/dev/fd/3" > is 4 characters. > > Revision Changes Path > 1.142 +1 -1 src/sys/sys/param.h > -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message