summaryrefslogtreecommitdiffstats
path: root/support/export/export.c
Commit message (Collapse)AuthorAgeFilesLines
* mountd: Add exportent_release()Chuck Lever2012-10-221-7/+12
| | | | | | | | | Split out the logic that releases dynamically allocated data in an exportent. The junction resolution code will invoke this to clean up the junction exportent once it has been dumped to the kernel. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Exportfs crashes with long pathIvan Romanov2012-10-151-1/+1
| | | | | Acked-by: Bruce Fields <bfields@fieldses.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* export: Ensure that we free struct exportent->e_uuidTrond Myklebust2010-10-141-0/+1
| | | | | | | | | | | | | | | | | | Currently, the exportent->e_uuid is initialised in support/nfs/exports.c:parseopts(), but it is never freed. Also ensure that exportent->e_uuid is duplicated correctly in dupexportent(). Adjusted to account for the new export_free() helper. Also, e_uuid points to memory that is always allocated with strdup(3), not with xstrdup(). Thus it must be freed via free(3) and not via xfree(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Add documenting commentsChuck Lever2010-06-221-6/+17
| | | | | | | | Clean up. Add a few additional documenting comments for globally visible functions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Make export_add() staticChuck Lever2010-06-221-4/+2
| | | | | | | | Clean up: export_add() is not called from outside of export.c, so make it a static helper. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Make export_read() return voidChuck Lever2010-06-221-2/+6
| | | | | | | | Clean up: export_read()'s return value is always zero, and its only caller never checks it. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Replace "struct hostent" with "struct addrinfo"Chuck Lever2010-06-221-14/+32
| | | | | | | | | | | | | | | | | | | struct hostent can store either IPv4 or IPv6 addresses, but it can't store both address families concurrently for the same host. Neither can hostent deal with parts of socket addresses that are outside of the sin{,6}_addr field. Replace the use of "struct hostent" everywhere in libexport.a, mountd, and exportfs with "struct addrinfo". This is a large change, but there are so many strong dependencies on struct hostent that this can't easily be broken into smaller pieces. One benefit of this change is that hostent_dup() is no longer required, since the results of getaddrinfo(3) are already dynamically allocated. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: export_find() should handle address parsing errorsChuck Lever2010-04-161-0/+4
| | | | | | | | | | | | | | | An address mask parsing error can cause client_init(), and therefore client_dup(), to make our process exit suddenly. Soon we want to add more complex address parsing in client_init(), so we need this interface to be a little more robust. Since export_find() can return NULL in some cases, it can handle NULL returns from its subroutines if an address parsing error occurs, or if memory is exhausted. Allow for client_dup() to return NULL instead of exiting sideways. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Add export_free()Chuck Lever2010-04-161-10/+17
| | | | | | | Clean up: Introduce a helper to free an nfs_export record. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: e_fslocdata should be freed with free(3)Chuck Lever2010-03-221-1/+1
| | | | | | | | Clean up: Since e_fslocdata is allocated with strdup(3), and not xstrdup(), it should be freed with free(3), and not xfree(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Fix whitespace damage in support/export/export.cChuck Lever2010-03-221-5/+6
| | | | | | | Clean up whitespace damage introduced by commit 4cacc965. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exports: export_read() cleanupJ. Bruce Fields2010-01-131-19/+21
| | | | | | Use standard indentation, move warnings to helper function. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
* Exportfs and rpc.mountd optimalizationTomas Richter2009-02-181-27/+87
| | | | | | | | | | | | | | | | | | | | | | | | There were some problems with exportfs and rpc.mountd for long export lists - see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=76643 I do optimalization as my bachelors thesis (Facuulty of informatics, Masaryk's university Brno, Czech Republic), under lead of Yenya Kasprzak. Both exportfs and rpc.mount build linked list of exports (shared functions in export.c). Every time they are inserting new export into list, they search for same export in list. I replaced linked list by hash table and functions export_add and export_lookup by functions hash_export_add and hash_export_lookup (export.c). Because some other functions required exportlist as linked list, hash table has some implementation modification im comparison with ordinary hash table. It also keeps exports in linked list and has pointer to head of the list. So there's no need of implementation function <for_all_in_hash_table>. Signed-off-by: Tomas Richter <krik3t@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Remove redundant m_path fieldJ. Bruce Fields2008-08-281-12/+0
| | | | | | | | | | | | | | | | | Contrary to the comment above its definition, the field m_path always has the same value as e_path: the *only* modifications of m_path are all of the form: strncpy(exp->m_export.m_path, exp->m_export.e_path, sizeof (exp->m_export.m_path) - 1); exp->m_export.m_path[sizeof (exp->m_export.m_path) - 1] = '\0'; So m_path is always just a copy of e_path. In places where we need to store a path to a submount of a CROSSMNT-exported filesystem, as in cache.c, we just use a local variable. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.mountd: make exportent->e_hostname a dynamically-allocated stringJeff Layton2007-09-281-0/+5
| | | | | | | | | | | | This makes the e_hostname field of the exportent into a pointer to a dynamically allocated string. This is necessary since this is field is often filled out from the m_hostname. This too adds a few micro-optimizations as we can avoid copying the string in some places and simply pass a pointer to the original string instead. Signed-off-by: Jeff Layton <jlayton@redhat.com> Acked-by: Steve Dickson <steved@redhat.com> Signed-off-by: Neil Brown <neilb@suse.de>
* Make warning about host matching multiple exports more helpful.Neil Brown2007-03-191-0/+2
| | | | | 1/ only warn once per export, as it could get too noisy. 2/ make it a little clearer why this might be a problem.
* Extend the exportfs/mountd interface to pass fslocations info into the kernelFred Isaman2007-02-271-0/+2
| | | | | | | | Fix up a few issues with the fsloc code. Signed-off-by: Fred Isaman <iisaman@citi.umich.edu> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* fix exportfs with multiple matchesNeil Brown2006-06-051-1/+1
| | | | | | | Fixes a problem with exportfs -o and multiple entries of the same type for the same patch that matches a given client. The entire rationale and problem description can be found at http://bugs.debian.org/245449 (fumihiko kakuma <kakmy@mvh.biglobe.ne.jp>)
* Autogen updateneilbrown2005-12-201-1/+3
|
* Fixes to make unexporting and exporting with wildcardsneilbrown2003-07-031-6/+3
| | | | work more sensibly.
* new "mountpoint" export option.neilbrown2003-05-301-0/+2
|
* See Changelogneilbrown2002-05-291-1/+1
|
* See Changelogneilbrown2001-12-201-1/+1
|
* make "exportfs -au" do no DNS lookupneilbrown2001-09-201-6/+6
|
* Thu Oct 28 11:27:51 EST 1999 Neil Brown <neilb@cse.unsw.edu.au>neilbrown1999-10-281-2/+2
| | | | | | | | | | * support/include/nfs/export.h addedd NFSEXP_NOSUBTREECHECK * support/nfs/exports.c: added {no_,}subtree_check and changed crossmnt to nohide * utils/exportfs/exports.man: added no_subtree_check and nohide and removed irrelevant stuff from unfsd. * support/export/rmtab.c: rmtab_read didn't quite do the right thing if a pathname from rmtab was a subdirectory of an export-point
* Initial revisionhjl1999-10-181-0/+259