Subject: bin/2126: patch to add "readdirsize" option to amd
To: None <gnats-bugs@NetBSD.ORG>
From: None <millert@cs.colorado.edu>
List: netbsd-bugs
Date: 02/25/1996 16:40:26
>Number:         2126
>Category:       bin
>Synopsis:       amd needs to support setting the readdirsize nfs option
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 25 18:50:03 1996
>Last-Modified:
>Originator:     Todd C. Miller
>Organization:
Todd C. Miller   Sysadmin--University of Colorado   Todd.Miller@cs.colorado.edu
>Release:        NetBSD-current as of 2/24/96
>Environment:
System: NetBSD scrap.cs.colorado.edu 1.1A NetBSD 1.1A (PEECEE) #0: Sat Feb 24 13:00:25 EST 1996 millert@scrap.cs.colorado.edu:/usr/src/sys/arch/i386/compile/PEECEE i386


>Description:
	Since the "readdirsize" field in nfs_args is not changed
	by setting the "rsize" field there needs to be a way to
	set "readdirsize" from amd.  mount_nfs(8) recommends
	setting "readdirsize" <= "rsize".
>How-To-Repeat:
	Make an amd map that sets rsize.
>Fix:
	Two patches follow.  The first simply adds a "readdirsize"
	option while the second also sets "readdirsize" to
	"rsize" if "rsize" is set and "readdirsize" is not.
	I find the second patch to be the more useful one but
	I leave it to your discretion.

[ this patch adds a readdirsize option to amd ]

*** nfs_ops.c.DIST	Tue Feb 20 05:46:50 1996
--- /tmp/nfs_ops.c	Sun Feb 25 15:05:32 1996
***************
*** 549,554 ****
--- 549,559 ----
  		strcpy(host + HOSTNAMESZ - 3, "..");
  #endif /* HOSTNAMESZ */
  
+ #ifdef NFSMNT_READDIRSIZE
+ 	if (nfs_args.readdirsize = hasmntval(&mnt, "readdirsize"))
+ 		nfs_args.flags |= NFSMNT_READDIRSIZE;
+ #endif
+ 
  	if (nfs_args.rsize = hasmntval(&mnt, "rsize"))
  		nfs_args.flags |= NFSMNT_RSIZE;
  
[ this one does the same but defines readdirsize to be rsize 
  if readdirsize is not defined and rsize is... ]

*** nfs_ops.c.DIST	Tue Feb 20 05:46:50 1996
--- nfs_ops.c	Sun Feb 25 15:16:40 1996
***************
*** 552,557 ****
--- 552,566 ----
  	if (nfs_args.rsize = hasmntval(&mnt, "rsize"))
  		nfs_args.flags |= NFSMNT_RSIZE;
  
+ #ifdef NFSMNT_READDIRSIZE
+ 	if (nfs_args.readdirsize = hasmntval(&mnt, "readdirsize")) {
+ 		nfs_args.flags |= NFSMNT_READDIRSIZE;
+ 	} else if (nfs_args.rsize) {
+ 		nfs_args.readdirsize = nfs_args.rsize;
+ 		nfs_args.flags |= NFSMNT_READDIRSIZE;
+ 	}
+ #endif
+ 
  	if (nfs_args.wsize = hasmntval(&mnt, "wsize"))
  		nfs_args.flags |= NFSMNT_WSIZE;
  
>Audit-Trail:
>Unformatted: