summaryrefslogtreecommitdiffstats
path: root/sys/fs/smbfs/smbfs_vfsops.c
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2014-04-15 09:10:01 +0000
committerae <ae@FreeBSD.org>2014-04-15 09:10:01 +0000
commitb95b3ecef4cb3f615612c9cd3dd758cdb532391b (patch)
treeada0964cc24f63d420ec93ef2dbf4690c3fe4a91 /sys/fs/smbfs/smbfs_vfsops.c
parentd8b63f3ba114f723e55129a2d5ce79fea9e568a6 (diff)
downloadFreeBSD-src-b95b3ecef4cb3f615612c9cd3dd758cdb532391b.zip
FreeBSD-src-b95b3ecef4cb3f615612c9cd3dd758cdb532391b.tar.gz
Use SMB_QUERY_FS_SIZE_INFO request to populate statfs structure.
When server doesn't support this request, try to use SMB_INFO_ALLOCATION. And use SMB_COM_QUERY_INFORMATION_DISK request as fallback. MFC after: 2 weeks
Diffstat (limited to 'sys/fs/smbfs/smbfs_vfsops.c')
-rw-r--r--sys/fs/smbfs/smbfs_vfsops.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c
index 2d33df3..8277982 100644
--- a/sys/fs/smbfs/smbfs_vfsops.c
+++ b/sys/fs/smbfs/smbfs_vfsops.c
@@ -390,7 +390,7 @@ smbfs_statfs(struct mount *mp, struct statfs *sbp)
struct smbnode *np = smp->sm_root;
struct smb_share *ssp = smp->sm_share;
struct smb_cred *scred;
- int error = 0;
+ int error;
if (np == NULL) {
vfs_mount_error(mp, "np == NULL");
@@ -400,16 +400,9 @@ smbfs_statfs(struct mount *mp, struct statfs *sbp)
sbp->f_iosize = SSTOVC(ssp)->vc_txmax; /* optimal transfer block size */
scred = smbfs_malloc_scred();
smb_makescred(scred, td, td->td_ucred);
-
- if (SMB_DIALECT(SSTOVC(ssp)) >= SMB_DIALECT_LANMAN2_0)
- error = smbfs_smb_statfs2(ssp, sbp, scred);
- else
- error = smbfs_smb_statfs(ssp, sbp, scred);
- if (error) {
- smbfs_free_scred(scred);
- return error;
- }
- sbp->f_flags = 0; /* copy of mount exported flags */
+ error = smbfs_smb_statfs(ssp, sbp, scred);
+ if (error == 0)
+ sbp->f_flags = 0; /* copy of mount exported flags */
smbfs_free_scred(scred);
- return 0;
+ return (error);
}
OpenPOWER on IntegriCloud