CIFS: Move statfs to ops struct
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
Cette révision appartient à :

révisé par
Steve French

Parent
983c88a497
révision
76ec5e3384
@@ -51,7 +51,6 @@
|
||||
#ifdef CONFIG_CIFS_SMB2
|
||||
#include "smb2pdu.h"
|
||||
#endif
|
||||
#define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */
|
||||
|
||||
int cifsFYI = 0;
|
||||
int cifsERROR = 1;
|
||||
@@ -164,13 +163,12 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
|
||||
struct super_block *sb = dentry->d_sb;
|
||||
struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
|
||||
struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
|
||||
int rc = -EOPNOTSUPP;
|
||||
struct TCP_Server_Info *server = tcon->ses->server;
|
||||
unsigned int xid;
|
||||
int rc = 0;
|
||||
|
||||
xid = get_xid();
|
||||
|
||||
buf->f_type = CIFS_MAGIC_NUMBER;
|
||||
|
||||
/*
|
||||
* PATH_MAX may be too long - it would presumably be total path,
|
||||
* but note that some servers (includinng Samba 3) have a shorter
|
||||
@@ -182,27 +180,8 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
|
||||
buf->f_files = 0; /* undefined */
|
||||
buf->f_ffree = 0; /* unlimited */
|
||||
|
||||
/*
|
||||
* We could add a second check for a QFS Unix capability bit
|
||||
*/
|
||||
if ((tcon->ses->capabilities & CAP_UNIX) &&
|
||||
(CIFS_POSIX_EXTENSIONS & le64_to_cpu(tcon->fsUnixInfo.Capability)))
|
||||
rc = CIFSSMBQFSPosixInfo(xid, tcon, buf);
|
||||
|
||||
/*
|
||||
* Only need to call the old QFSInfo if failed on newer one,
|
||||
* e.g. by OS/2.
|
||||
**/
|
||||
if (rc && (tcon->ses->capabilities & CAP_NT_SMBS))
|
||||
rc = CIFSSMBQFSInfo(xid, tcon, buf);
|
||||
|
||||
/*
|
||||
* Some old Windows servers also do not support level 103, retry with
|
||||
* older level one if old server failed the previous call or we
|
||||
* bypassed it because we detected that this was an older LANMAN sess
|
||||
*/
|
||||
if (rc)
|
||||
rc = SMBOldQFSInfo(xid, tcon, buf);
|
||||
if (server->ops->queryfs)
|
||||
rc = server->ops->queryfs(xid, tcon, buf);
|
||||
|
||||
free_xid(xid);
|
||||
return 0;
|
||||
|
Référencer dans un nouveau ticket
Bloquer un utilisateur