aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2ops.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-09-18 19:20:34 -0400
committerSteve French <smfrench@gmail.com>2012-09-24 22:46:30 -0400
commit6fc05c25ca35e65ee1759dd803f23576a268f5ec (patch)
tree048a8fa4bf1e8c0b486d8b037f0b7eaaf0b4c755 /fs/cifs/smb2ops.c
parent76ec5e33846de386f44826f145cd725b92c23630 (diff)
CIFS: Add statfs support for SMB2
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2ops.c')
-rw-r--r--fs/cifs/smb2ops.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 8c72e0768d12..3a8c68258026 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -18,12 +18,14 @@
18 */ 18 */
19 19
20#include <linux/pagemap.h> 20#include <linux/pagemap.h>
21#include <linux/vfs.h>
21#include "cifsglob.h" 22#include "cifsglob.h"
22#include "smb2pdu.h" 23#include "smb2pdu.h"
23#include "smb2proto.h" 24#include "smb2proto.h"
24#include "cifsproto.h" 25#include "cifsproto.h"
25#include "cifs_debug.h" 26#include "cifs_debug.h"
26#include "smb2status.h" 27#include "smb2status.h"
28#include "smb2glob.h"
27 29
28static int 30static int
29change_conf(struct TCP_Server_Info *server) 31change_conf(struct TCP_Server_Info *server)
@@ -522,6 +524,25 @@ smb2_oplock_response(struct cifs_tcon *tcon, struct cifs_fid *fid,
522 cinode->clientCanCacheRead ? 1 : 0); 524 cinode->clientCanCacheRead ? 1 : 0);
523} 525}
524 526
527static int
528smb2_queryfs(const unsigned int xid, struct cifs_tcon *tcon,
529 struct kstatfs *buf)
530{
531 int rc;
532 u64 persistent_fid, volatile_fid;
533 __le16 srch_path = 0; /* Null - open root of share */
534 u8 oplock = SMB2_OPLOCK_LEVEL_NONE;
535
536 rc = SMB2_open(xid, tcon, &srch_path, &persistent_fid, &volatile_fid,
537 FILE_READ_ATTRIBUTES, FILE_OPEN, 0, 0, &oplock, NULL);
538 if (rc)
539 return rc;
540 buf->f_type = SMB2_MAGIC_NUMBER;
541 rc = SMB2_QFS_info(xid, tcon, persistent_fid, volatile_fid, buf);
542 SMB2_close(xid, tcon, persistent_fid, volatile_fid);
543 return rc;
544}
545
525struct smb_version_operations smb21_operations = { 546struct smb_version_operations smb21_operations = {
526 .setup_request = smb2_setup_request, 547 .setup_request = smb2_setup_request,
527 .setup_async_request = smb2_setup_async_request, 548 .setup_async_request = smb2_setup_async_request,
@@ -578,6 +599,7 @@ struct smb_version_operations smb21_operations = {
578 .calc_smb_size = smb2_calc_size, 599 .calc_smb_size = smb2_calc_size,
579 .is_status_pending = smb2_is_status_pending, 600 .is_status_pending = smb2_is_status_pending,
580 .oplock_response = smb2_oplock_response, 601 .oplock_response = smb2_oplock_response,
602 .queryfs = smb2_queryfs,
581}; 603};
582 604
583struct smb_version_values smb21_values = { 605struct smb_version_values smb21_values = {