summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* mount.nfs: Don't allow the user to specify addr= or clientaddr=.Chuck Lever2007-08-251-8/+24
| | | | | | | | | | | | The current mount.nfs implementation doesn't allow users to specify their own addr= or clientaddr= option. The new string-based interface does allow this, even though nfs(5) does not document 'addr=' and specifically forbids adding 'clientaddr='. Make the addition of either option by the user a permanent error. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Fix nfs4mount_s prototype.Chuck Lever2007-08-251-2/+3
| | | | | | | | The definition of nfs4mount_s in utils/mount/stropts.c doesn't match the prototype declared in utils/mount/stropts.h. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Combine two verbose messages into oneChuck Lever2007-08-241-10/+2
| | | | | | | A little less noise. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: getport() should avoid modifying passed-in argumentsChuck Lever2007-08-241-5/+9
| | | | | | | | Defensive coding: getport() shouldn't alter the passed-in server address, but should treat it as read only. Have it operate on a copy. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Replace fork() with daemon() for backgrounding mountsChuck Lever2007-08-241-3/+8
| | | | | | | | | | Neil recommended this change to address a problem with background mount processes handling signals properly during an init level change. It is also useful for preventing background mount processes from reporting progress on the parent's tty, which is generally just annoying noise. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount: Small tidy up.Neil Brown2007-08-241-3/+1
| | | | | | | 1/ remove confusing sentence from a comment. 2/ remove needless 'exit' - just fall through to common exit. Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: Add -S/--since flag.david m. richter2007-08-161-18/+134
| | | | | | | | | | | | | | | | Read statistics from the file given with -S/--since and display the difference between those and the current statistics. Valid stat files are those in the form of /proc/net/rpc/nfs, /proc/net/rpc/nfsd, or any "pretty" output from nfsstat itself. Statistics that are missing from a "pretty" stat file are treated as zeroes. Similar to Neil Brown's suggestion, one might use this in conjunction with watch(1) like this: $ watch "nfsstat --since /tmp/stats; nfsstat >/tmp/stats" Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: #define stat header labels.david m. richter2007-08-161-20/+35
| | | | | | | | | Make #defines for the stat header labels, use for output, and add to struct statinfo. This will be used by a subsequent patch for -S/--since. Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: Remove some pointer comparisons against global statinfos.david m. richter2007-08-161-12/+15
| | | | | | | | Pass-in an "is_srv" arg instead of doing pointer comparisons against the static statinfo arrays themselves. Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: Obviate and remove copy_stats().david m. richter2007-08-161-25/+18
| | | | | | | | | Rather than copying stats during --sleep, instead introduce a few pointers and rearrange them to avoid the copy. Will be useful with --since, too. Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: rename *_tmp variables to *_old.david m. richter2007-08-161-19/+19
| | | | | | | | | To make a subsequent patch a little clearer, make it explicit that current *_tmp variables are actually always/only the "old" set used in comparisons. Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Restrict -i option to root.Neil Brown2007-08-111-0/+5
| | | | | | As it is still under development, don't expose it - just in case. Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Enable mount.nfs to do text-based mount supportChuck Lever2007-08-111-8/+30
| | | | | | | | | | | | | | | | | A new command line option, "-i", is added to mount.nfs to force the use of the string interface for testing purposes. "-s", "-t", and "-r" are already taken or have legacy meaning so I picked "-i". At some later point, when everyone is comfortable with the string mount option parsing implementation, we will add a switch based on kernel version, and remove the "-i" command line option. For now, I am more comfortable enabling it by hand instead. Since this is a temporary arrangement, I'm leaving the option undocumented in the mount.nfs man page. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Add new files for supporting string-ified mount optionsChuck Lever2007-08-113-2/+358
| | | | | | | | | | | | | | Introduce support files which contain code that builds string mount options and passes them to the kernel. This is a pre-requisite for actually enabling /sbin/mount.nfs to do text-based mounts. This is only partially complete at the moment, but is presented so that folks can start banging on the kernel mount option string parsing code. There are clearly still parts that are not implemented quite yet, such as bg and retry support, but it should be enough to get going. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Replace a "return 0; " that should be an "exit(0); "Chuck Lever2007-08-111-1/+1
| | | | | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Treat another UDP/TCP pair of strings like the restChuck Lever2007-08-111-1/+1
| | | | | | | See the error messages at the end of utils/mount/network.c:get_socket() Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* umount.nfs: Update umount.nfs(8)Chuck Lever2007-08-101-4/+3
| | | | | | | Account for recent changes to the umount.nfs command. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Update the mount.nfs(8) man pageChuck Lever2007-08-102-21/+10
| | | | | | | Account for recent changes to the mount.nfs command. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* nfs-utils: specify a create mode with open(...O_CREAT) call in xflockJeff Layton2007-08-091-1/+1
| | | | | | | | | The xflock function can create a file via open() with O_CREAT, but does not specify the create mode when it does so. I think 0644 should be appropriate given the current usage of this function. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Neil Brown <neilb@suse.de>
* Remove ARCH-specific compile flags for ALPHA.Neil Brown2007-08-091-2/+2
| | | | | | | | | | -mno-fp-regs -ffixed-8 are used for compiling the kernel on alphas, and it seems they were copied into nfs-utils long ago, even though they have no relevance now. As we now use floating point (just a little bit in nfsstat), remove these pointless flags.
* nfsstat: include -Z/--sleep in the manpagedavid m. richter2007-08-091-1/+11
| | | | | | | Add a little blurb about -Z/--sleep to the nfsstat manpage. Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: rename --diff-stat to --sleepdavid m. richter2007-08-091-7/+7
| | | | | | | | As per Bruce Fields' suggestion, rename the clunky -D/--diff-stat to the more-intuitive -Z/--sleep. Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: fix a bug in diff_stats()david m. richter2007-08-091-4/+25
| | | | | | | | | Fix a bug in diff_stats() that causes false-positives in has_stats(), which can result in a bunch of zeros being displayed instead of suppressed as intended. Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: add a comment to has_stats()david m. richter2007-08-091-1/+7
| | | | | | | Clarify what has_stats() is actually doing. Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: display 3 additional NFSv4 client op countersdavid m. richter2007-08-091-4/+5
| | | | | | | | | Display three extra NFSv4 client counters that are already exposed in /proc/net/rpc/nfs: GETACL, SETACL, and FS_LOCATIONS. Won't cause trouble on older kernels that might lack those counters. Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* fix regression with rmtab handling in newer nfs-utils codeJeff Layton2007-08-071-3/+1
| | | | | | | | | commit dbfcba5b03481d49f3e78946fe8fd066e2025545 incorrectly added some mountlist_add calls. Removed them again. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Fix background mountsChuck Lever2007-08-041-1/+23
| | | | | | | | The new mount.nfs helper does not support background mounts. Add support for background mounts. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Refactor mount logic to allow support for "bg" optionChuck Lever2007-08-041-16/+27
| | | | | | | Refactor main() a bit to make adding support for "bg" option easier. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: restore bg argument to nfsmount() and nfs4mount()Chuck Lever2007-08-045-7/+9
| | | | | | | | To enable background mounting again, restore the "bg" argument to nfsmount() and nfs4mount() that was recently removed. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: get_socket() may clobber errno, but preserves .re_errnoChuck Lever2007-08-041-12/+4
| | | | | | | | | | get_socket() guarantees that rpc_createerr.cf_error.re_errno is set correctly after an error, but it can wipe errno if it has to print an error message. Make sure that clnt_ping() checks the correct error code when get_socket() returns. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Always close the socket at the end of getport()Chuck Lever2007-08-041-5/+4
| | | | | | | | These days, none of get_socket()'s callers pass an RPC_ANYSOCK on to the RPC code. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Shorter timeout for TCP connectsChuck Lever2007-08-041-5/+59
| | | | | | | | | | | | | | | The standard TCP connect timeout on Linux is 75 seconds, which can be too long in some cases. The timeout itself can be altered on a system-wide basis, but we'd like mount to have it's own connect timeout that's tunable, and defaults to a shorter value. The get_socket() function is a utility function that does TCP connects for getport, clnt_ping, and other functions. Add logic there to use a non-blocking connect() and select() in order to time out a connect operation that's taking too long. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Remove a redundant port assignmentChuck Lever2007-08-041-1/+0
| | | | | | | | getport() always fills in its port number before calling GETPORT. No need for the caller to do this. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: umount needs to pick up transport option from /etc/mtabChuck Lever2007-08-041-0/+12
| | | | | | | | Now that umount's default transport protocol has become more flexible, it will need to detect both proto=udp and proto=tcp in /etc/mtab. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: fix printf's normally hidden behind NFS_MOUNT_DEBUGChuck Lever2007-08-042-20/+18
| | | | | | | | After I enabled NFS_MOUNT_DEBUG the compiler started spitting out warnings. Fix up commas, output formatting, and double-wide character support. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: Support double-wide characters in printed stringsChuck Lever2007-08-045-44/+54
| | | | | | | | | | | Previous NLS changes missed a spot or two. This patch tries to get most of them, but probably misses a few more. In errors.c:mount_errors() I've removed a period at the end of the error messages; this is consistent with other error messages I've examined. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: add -D/--diff-statdavid m. richter2007-08-011-2/+91
| | | | | | | | | | | Add -D/--diff-stat: instead of immediately displaying total collected NFS stats and exiting, nfsstat will take a snapshot of current statistics and pause until the user hits ^C, at which point it takes a second snapshot and then prints out the difference of the two; i.e., only the statistics collected during the pause. Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: just declare -D/--diff-stat's variablesdavid m. richter2007-08-011-49/+51
| | | | | | | | Add the temp vars -D/--diff-stat will use. (just using a separate patch to make the next one easier to read) Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: use macros to declare struct statinfo arraysdavid m. richter2007-08-011-22/+30
| | | | | | | | | Use macros to build the arrays of struct statinfos. This will make adding the extra set of temporary variables needed by -D/--diff-stat much easier. Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: standardize naming of opcount arraysdavid m. richter2007-08-011-30/+30
| | | | | | | | | | Standardized Naming 2: Make the client and server "call counts" arrays' variable names reflect/include the actual text labels from the /proc files -- e.g., "cltv2info" becomes "cltproc2info". A subsequent patch will rely on this naming scheme. Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: standardize naming of server variablesdavid m. richter2007-08-011-40/+40
| | | | | | | | | | Standardized Naming 1: Instead of having a variety of different server-related variable name prefixes ("srv", "svr", "svc", "SVC"), set them all to "srv" or "SRV". A subsequent patch will rely on this naming scheme. Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: add get_stats()david m. richter2007-08-011-21/+17
| | | | | | | | Share some of the existing statistics-gathering code by folding it into a function, get_stats(). Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* nfsstat: add has_stats()david m. richter2007-08-011-6/+14
| | | | | | | | To help readability, add has_stats() and use it when deciding whether to print. Signed-off-by: David M. Richter <richterd@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Fix more 'prototype' warnings and other warnings.Neil Brown2007-07-305-21/+21
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: clean up a couple of printfs in fstab.cChuck Lever2007-07-301-9/+12
| | | | | | | Clean up for consistent use. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: eliminate another dependency on a global variableChuck Lever2007-07-305-4/+558
| | | | | | | | | | | | | | The file support/nfs/fstab.c, which is linked into libnfs.a, depends on the global variable "verbose." This variable is defined and used only in the mount command, and the functions in fstab.c are used only by the mount command. Move fstab.c and support/include/fstab.h to utils/mount. This file placement is also consistent with at least one other mount helper, mount.ocfs2. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: eliminate conn.c and conn.hChuck Lever2007-07-309-60/+21
| | | | | | | conn.[ch] are now no longer needed. Clean them out and delete them. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* mount.nfs: use nfs_error instead of fprintf in get_socket()Chuck Lever2007-07-301-47/+53
| | | | | | | | | Use nfs_error() where appropriate. I used "goto" here to reduce string splitting and indenting past the point of readability. Gee, it would be nice if C had proper exception handling... Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: move get_socket() function to utils/mount/network.cChuck Lever2007-07-303-80/+73
| | | | | | | | | | Now we can address the real problem: that get_socket() depends on the global variable "verbose" which is only available in the mount command. Move get_socket() into utils/mount/network.c, and make it static. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>
* libnfs.a: move clnt_ping() to utils/mountChuck Lever2007-07-305-77/+83
| | | | | | | | | | Continue clean up of mount functionality in libnfs.a by moving clnt_ping() to utils/mount/network.c. Note that socklen_t is an unsigned int... the i386 gcc compiler threw a signedness warning about the 3rd argument of getsockname(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>