Commit graph

27 commits

Author SHA1 Message Date
Olga Kornievskaia
2e1df56572 [readdir] using last_error to convey lack of space 2012-03-19 15:04:41 -04:00
Casey Bodley
bbb1ed696c license changed to LGPL: added COPYING file, changed source file comments
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-03-19 12:24:43 -04:00
Casey Bodley
afd1a3c0db readdir: removed unused readdir_upcall_args.buf
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-02-28 12:13:27 -05:00
Olga Kornievskaia
27030b1764 removing copies from readdir path 2011-09-27 12:21:26 -04:00
Olga Kornievskaia
0e287a87be simplifying logic in handle_readdir 2011-08-25 13:07:00 -04:00
Olga Kornievskaia
04ab888492 [cosmetic] minor license changes
added 2011 year to the copyright line
added authors info to the license
added UofM license to libtirpc files that we modified
(but i probably missed some)
2011-08-12 13:20:12 -04:00
Casey Bodley
2b5a5fb071 daemon: cleaned up compiler warnings
raised warning level to /Wall
changed nfs41_file_info.owner, owner_group to char[] to avoid casting

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-07-18 15:24:20 -04:00
Olga Kornievskaia
529d7ce6db moving session and open_state in upcall header
every upcall (except few) pass session and open_state pointer, so
add that to marshal_nfs41_header() in the driver. remove passing
of session and open_state elsewhere in marshal functions.

in the deamon, upcall.c now reads and stores pointers to session
and open_state in nfs41_upcall datastructure instead of having
each individual upcall store their own pointers. setattrl
and readdir args keeping pointer because the rest of the code
uses them a lot.

in upcall_parse() up refcounts on session and open_state if
valid handles were passed in. down refcounts upcall_cleanup() as
before. but need to be careful with count value for mount and open
upcalls. we need to take an extra ref because upcall_cleanup() now
will always decrement it.
2011-04-13 20:07:37 -04:00
Olga Kornievskaia
b9e369fac6 adding query for FileInternalInformation infoclass
this query asks for a file index which is unique identifier for a file which
we can satisfy from file attribute called "fileid"
2011-04-12 14:06:13 -04:00
Olga Kornievskaia
79455f9855 OP_GETATTR queries OWNER and OWNER_GROUP 2011-03-08 13:34:25 -05:00
Casey Bodley
8321939c90 fix for warning C4204: non-constant aggregate initializer
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-11-08 12:29:47 -05:00
Casey Bodley
38813e13d8 cosmetic: cleaning up small functions
attempted to get rid of short functions that are only called from one place

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-11-05 15:10:20 -04:00
Casey Bodley
bcc707d3b8 ref counting for nfs41_root
very similar to the issue with nfs41_open_state, an abandoned upcall could outlive its mount. to prevent their nfs41_root from being freed, upcalls need to hold a reference until they're finished. this also keeps all of its clients/sessions/rpc connections alive

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-27 16:18:23 -04:00
Olga Kornievskaia
006bdfa47a ref counting for nfs41_open_state 2010-10-27 16:18:12 -04:00
Casey Bodley
ae4c67c21e upcall: added upcall_cleanup() to interface
added call to upcall_cleanup() after both upcall_marshall() and upcall_cancel()
individual upcall operations define their nfs41_upcall_op structs locally, instead of putting tons of function prototypes in upcall.c
made the upcall_marshall() function optional; most marshall functions are noops

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-27 16:16:17 -04:00
Casey Bodley
7e7f73766d readdir cookie is stored with nfs41_open_state
fixes a memory leak that occurs when a readdir loop doesn't complete, since the cookie was only freed on the last readdir upcall.  by storing the cookie with nfs41_open_state, we can avoid passing the cookie to the driver and back, and not worry about having to free it separately

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-27 15:25:27 -04:00
unknown
bacbf060e3 making eprintfs include filename in symlink 2010-10-19 11:18:32 -04:00
Casey Bodley
eb9d9bbd4c symlink: nfs41_symlink_follow() for readdir and open
added nfs41_file_info.symlink_dir to replace readdir's info.cansettime hack.  when nfs_file_info_to_attributes() finds info.type==NF4LNK, it adds the FILE_ATTRIBUTE_DIRECTORY flag if info.symlink_dir is set

renamed nfs41_symlink_follow() to nfs41_symlink_target()
generalized lookup_symlink() into nfs41_symlink_follow(), which is called by readdir and open (also avoids an extra lookup)

added queries for symlink target type when doing normal GETATTRs (getattr.c) and opens with OPEN_REPARSE_POINT set (open.c)

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-14 16:57:53 -04:00
Casey Bodley
30cc2e1d32 symlink: readdir and directory symlinks
windows differentiates between directory and file symlinks because a file can have both FILE_ATTRIBUTE_DIRECTORY and FILE_ATTRIBUTE_REPARSE_POINT flags.  nfs can only be one of NF4REG/DIR/LNK, so we have to do a readlink and look up the target file for symlinks to know whether or not to set the directory attribute flag.  this is done recursively when we encounter links to links

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-14 12:42:37 -04:00
Casey Bodley
b51bd2f9d1 symlink: set reparse tag for symlinks
getattr upcall for FileAttributeTagInformation sets ReparseTag=IO_REPARSE_TAG_SYMLINK

readdir upcall sets EaSize=IO_REPARSE_TAG_SYMLINK; this makes the 'dir' command show files as <SYMLINK>, and causes a FSCTL_GET_REPARSE_POINT to query the symlink target

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-14 12:42:32 -04:00
Casey Bodley
f727a1e4b4 max_path: get_name() avoids copying from upcall buffer
because we no longer have to convert strings from unicode, we can avoid copying them out of the upcall buffer

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-12 10:36:10 -04:00
Casey Bodley
95361423f3 upcall: set upcall.status on parse failure
when open parsing fails, we were still returning upcall.status==NO_ERROR, so the driver assumed the open succeeded.  other operations then sent up an open_state==NULL, and crashed the daemon.  when upcall_parse() returns an error, set upcall.status to notify the driver

upcall_parse() prints a 'parsing of upcall <name> failed with <error>.' message on failure, so i removed redundant messages from the individual upcall parsing functions

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-12 10:36:08 -04:00
Casey Bodley
06fa6934cb readdir: view broken referrals as directories
if readdir fails to look up a referred entry, set its type to NF4DIR so windows explorer shows it as a directory.  when you double-click on the directory, it gives a message saying that it "refers to a location that is unavailable"

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-12 10:36:00 -04:00
Casey Bodley
680e415104 readdir: look up attributes for referral entries
handle rdattr_error == NFS4ERR_MOVED by calling nfs41_lookup() for attributes

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-12 10:35:59 -04:00
Casey Bodley
0d3af99159 cosmetic: moved lookup_entry()
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-12 10:35:59 -04:00
Casey Bodley
30decd1af7 readdir: generalized lookup_entry() for use with referrals
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-12 10:35:58 -04:00
Casey Bodley
0ad4db4fad fresh git tree for public release
we regretfully had to remove our git history for licensing reasons

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-12 10:15:48 -04:00