diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-09-18 19:20:33 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-09-24 22:46:30 -0400 |
commit | 76ec5e33846de386f44826f145cd725b92c23630 (patch) | |
tree | 864a76aa2c0aa618995f8b6587b1aa924d745f91 /fs/cifs/cifsfs.c | |
parent | 983c88a497914d60c91f431b05a8449ddda19167 (diff) |
CIFS: Move statfs to ops struct
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 2829f374dbf7..4dda4890d776 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -51,7 +51,6 @@ | |||
51 | #ifdef CONFIG_CIFS_SMB2 | 51 | #ifdef CONFIG_CIFS_SMB2 |
52 | #include "smb2pdu.h" | 52 | #include "smb2pdu.h" |
53 | #endif | 53 | #endif |
54 | #define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */ | ||
55 | 54 | ||
56 | int cifsFYI = 0; | 55 | int cifsFYI = 0; |
57 | int cifsERROR = 1; | 56 | int cifsERROR = 1; |
@@ -164,13 +163,12 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
164 | struct super_block *sb = dentry->d_sb; | 163 | struct super_block *sb = dentry->d_sb; |
165 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); | 164 | struct cifs_sb_info *cifs_sb = CIFS_SB(sb); |
166 | struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); | 165 | struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); |
167 | int rc = -EOPNOTSUPP; | 166 | struct TCP_Server_Info *server = tcon->ses->server; |
168 | unsigned int xid; | 167 | unsigned int xid; |
168 | int rc = 0; | ||
169 | 169 | ||
170 | xid = get_xid(); | 170 | xid = get_xid(); |
171 | 171 | ||
172 | buf->f_type = CIFS_MAGIC_NUMBER; | ||
173 | |||
174 | /* | 172 | /* |
175 | * PATH_MAX may be too long - it would presumably be total path, | 173 | * PATH_MAX may be too long - it would presumably be total path, |
176 | * but note that some servers (includinng Samba 3) have a shorter | 174 | * but note that some servers (includinng Samba 3) have a shorter |
@@ -182,27 +180,8 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
182 | buf->f_files = 0; /* undefined */ | 180 | buf->f_files = 0; /* undefined */ |
183 | buf->f_ffree = 0; /* unlimited */ | 181 | buf->f_ffree = 0; /* unlimited */ |
184 | 182 | ||
185 | /* | 183 | if (server->ops->queryfs) |
186 | * We could add a second check for a QFS Unix capability bit | 184 | rc = server->ops->queryfs(xid, tcon, buf); |
187 | */ | ||
188 | if ((tcon->ses->capabilities & CAP_UNIX) && | ||
189 | (CIFS_POSIX_EXTENSIONS & le64_to_cpu(tcon->fsUnixInfo.Capability))) | ||
190 | rc = CIFSSMBQFSPosixInfo(xid, tcon, buf); | ||
191 | |||
192 | /* | ||
193 | * Only need to call the old QFSInfo if failed on newer one, | ||
194 | * e.g. by OS/2. | ||
195 | **/ | ||
196 | if (rc && (tcon->ses->capabilities & CAP_NT_SMBS)) | ||
197 | rc = CIFSSMBQFSInfo(xid, tcon, buf); | ||
198 | |||
199 | /* | ||
200 | * Some old Windows servers also do not support level 103, retry with | ||
201 | * older level one if old server failed the previous call or we | ||
202 | * bypassed it because we detected that this was an older LANMAN sess | ||
203 | */ | ||
204 | if (rc) | ||
205 | rc = SMBOldQFSInfo(xid, tcon, buf); | ||
206 | 185 | ||
207 | free_xid(xid); | 186 | free_xid(xid); |
208 | return 0; | 187 | return 0; |