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>
This commit is contained in:
parent
a8f66804d5
commit
eb9d9bbd4c
7 changed files with 80 additions and 36 deletions
|
|
@ -93,6 +93,14 @@ int handle_getattr(nfs41_upcall *upcall)
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (info.type == NF4LNK) {
|
||||
nfs41_file_info target_info;
|
||||
int target_status = nfs41_symlink_follow(args->root,
|
||||
state->session, &state->file, &target_info);
|
||||
if (target_status == NO_ERROR && target_info.type == NF4DIR)
|
||||
info.symlink_dir = TRUE;
|
||||
}
|
||||
|
||||
switch (args->query_class) {
|
||||
case FileBasicInformation:
|
||||
nfs_to_basic_info(&info, &args->basic_info);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue