Use new path_conv_handle functions to access file info
This avoids having to call nfs_fetch_fattr3/file_get_fai depending on FS type as well as having to extract the info FS dependent. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
		| @@ -254,7 +254,7 @@ fhandler_base::fstat_by_nfs_ea (struct stat *buf) | |||||||
| 	 NFS client. */ | 	 NFS client. */ | ||||||
|       if (get_access () & GENERIC_WRITE) |       if (get_access () & GENERIC_WRITE) | ||||||
| 	FlushFileBuffers (get_io_handle ()); | 	FlushFileBuffers (get_io_handle ()); | ||||||
|       nfs_fetch_fattr3 (get_io_handle (), nfs_attr); |       pc.get_finfo (get_io_handle ()); | ||||||
|     } |     } | ||||||
|   buf->st_dev = nfs_attr->fsid; |   buf->st_dev = nfs_attr->fsid; | ||||||
|   buf->st_ino = nfs_attr->fileid; |   buf->st_ino = nfs_attr->fileid; | ||||||
| @@ -326,7 +326,7 @@ fhandler_base::fstat_by_handle (struct stat *buf) | |||||||
|      on the information stored in pc.fai.  So we overwrite them here. */ |      on the information stored in pc.fai.  So we overwrite them here. */ | ||||||
|   if (get_io_handle ()) |   if (get_io_handle ()) | ||||||
|     { |     { | ||||||
|       status = file_get_fai (h, pc.fai ()); |       status = pc.get_finfo (h); | ||||||
|       if (!NT_SUCCESS (status)) |       if (!NT_SUCCESS (status)) | ||||||
|        { |        { | ||||||
| 	 debug_printf ("%y = NtQueryInformationFile(%S, FileAllInformation)", | 	 debug_printf ("%y = NtQueryInformationFile(%S, FileAllInformation)", | ||||||
|   | |||||||
| @@ -2794,19 +2794,9 @@ restart: | |||||||
| 	     This speeds up path_conv noticably (~10%). */ | 	     This speeds up path_conv noticably (~10%). */ | ||||||
| 	  && (fs.inited () || fs.update (&upath, h))) | 	  && (fs.inited () || fs.update (&upath, h))) | ||||||
| 	{ | 	{ | ||||||
| 	  if (fs.is_nfs ()) | 	  status = conv_hdl.get_finfo (h, fs.is_nfs ()); | ||||||
| 	    { | 	  if (NT_SUCCESS (status)) | ||||||
| 	      status = nfs_fetch_fattr3 (h, conv_hdl.nfsattr ()); | 	    fileattr = conv_hdl.get_dosattr (fs.is_nfs ()); | ||||||
| 	      if (NT_SUCCESS (status)) |  | ||||||
| 		fileattr = ((conv_hdl.nfsattr ()->type & 7) == NF3DIR) |  | ||||||
| 			    ? FILE_ATTRIBUTE_DIRECTORY : 0; |  | ||||||
| 	    } |  | ||||||
| 	  else |  | ||||||
| 	    { |  | ||||||
| 	      status = file_get_fai (h, conv_hdl.fai ()); |  | ||||||
| 	      if (NT_SUCCESS (status)) |  | ||||||
| 		fileattr = conv_hdl.fai ()->BasicInformation.FileAttributes; |  | ||||||
| 	    } |  | ||||||
| 	} | 	} | ||||||
|       if (!NT_SUCCESS (status)) |       if (!NT_SUCCESS (status)) | ||||||
| 	{ | 	{ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user