diff options
Diffstat (limited to 'fs/cifs/smb2ops.c')
-rw-r--r-- | fs/cifs/smb2ops.c | 103 |
1 files changed, 85 insertions, 18 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 4d9dbe0b7385..d79de7bc4435 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c | |||
@@ -262,23 +262,6 @@ smb2_query_file_info(const unsigned int xid, struct cifs_tcon *tcon, | |||
262 | return rc; | 262 | return rc; |
263 | } | 263 | } |
264 | 264 | ||
265 | static char * | ||
266 | smb2_build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, | ||
267 | struct cifs_tcon *tcon) | ||
268 | { | ||
269 | int pplen = vol->prepath ? strlen(vol->prepath) : 0; | ||
270 | char *full_path = NULL; | ||
271 | |||
272 | /* if no prefix path, simply set path to the root of share to "" */ | ||
273 | if (pplen == 0) { | ||
274 | full_path = kzalloc(2, GFP_KERNEL); | ||
275 | return full_path; | ||
276 | } | ||
277 | |||
278 | cERROR(1, "prefixpath is not supported for SMB2 now"); | ||
279 | return NULL; | ||
280 | } | ||
281 | |||
282 | static bool | 265 | static bool |
283 | smb2_can_echo(struct TCP_Server_Info *server) | 266 | smb2_can_echo(struct TCP_Server_Info *server) |
284 | { | 267 | { |
@@ -613,7 +596,6 @@ struct smb_version_operations smb21_operations = { | |||
613 | .set_path_size = smb2_set_path_size, | 596 | .set_path_size = smb2_set_path_size, |
614 | .set_file_size = smb2_set_file_size, | 597 | .set_file_size = smb2_set_file_size, |
615 | .set_file_info = smb2_set_file_info, | 598 | .set_file_info = smb2_set_file_info, |
616 | .build_path_to_root = smb2_build_path_to_root, | ||
617 | .mkdir = smb2_mkdir, | 599 | .mkdir = smb2_mkdir, |
618 | .mkdir_setinfo = smb2_mkdir_setinfo, | 600 | .mkdir_setinfo = smb2_mkdir_setinfo, |
619 | .rmdir = smb2_rmdir, | 601 | .rmdir = smb2_rmdir, |
@@ -641,6 +623,91 @@ struct smb_version_operations smb21_operations = { | |||
641 | .get_lease_key = smb2_get_lease_key, | 623 | .get_lease_key = smb2_get_lease_key, |
642 | .set_lease_key = smb2_set_lease_key, | 624 | .set_lease_key = smb2_set_lease_key, |
643 | .new_lease_key = smb2_new_lease_key, | 625 | .new_lease_key = smb2_new_lease_key, |
626 | .calc_signature = smb2_calc_signature, | ||
627 | }; | ||
628 | |||
629 | |||
630 | struct smb_version_operations smb30_operations = { | ||
631 | .compare_fids = smb2_compare_fids, | ||
632 | .setup_request = smb2_setup_request, | ||
633 | .setup_async_request = smb2_setup_async_request, | ||
634 | .check_receive = smb2_check_receive, | ||
635 | .add_credits = smb2_add_credits, | ||
636 | .set_credits = smb2_set_credits, | ||
637 | .get_credits_field = smb2_get_credits_field, | ||
638 | .get_credits = smb2_get_credits, | ||
639 | .get_next_mid = smb2_get_next_mid, | ||
640 | .read_data_offset = smb2_read_data_offset, | ||
641 | .read_data_length = smb2_read_data_length, | ||
642 | .map_error = map_smb2_to_linux_error, | ||
643 | .find_mid = smb2_find_mid, | ||
644 | .check_message = smb2_check_message, | ||
645 | .dump_detail = smb2_dump_detail, | ||
646 | .clear_stats = smb2_clear_stats, | ||
647 | .print_stats = smb2_print_stats, | ||
648 | .is_oplock_break = smb2_is_valid_oplock_break, | ||
649 | .need_neg = smb2_need_neg, | ||
650 | .negotiate = smb2_negotiate, | ||
651 | .negotiate_wsize = smb2_negotiate_wsize, | ||
652 | .negotiate_rsize = smb2_negotiate_rsize, | ||
653 | .sess_setup = SMB2_sess_setup, | ||
654 | .logoff = SMB2_logoff, | ||
655 | .tree_connect = SMB2_tcon, | ||
656 | .tree_disconnect = SMB2_tdis, | ||
657 | .is_path_accessible = smb2_is_path_accessible, | ||
658 | .can_echo = smb2_can_echo, | ||
659 | .echo = SMB2_echo, | ||
660 | .query_path_info = smb2_query_path_info, | ||
661 | .get_srv_inum = smb2_get_srv_inum, | ||
662 | .query_file_info = smb2_query_file_info, | ||
663 | .set_path_size = smb2_set_path_size, | ||
664 | .set_file_size = smb2_set_file_size, | ||
665 | .set_file_info = smb2_set_file_info, | ||
666 | .mkdir = smb2_mkdir, | ||
667 | .mkdir_setinfo = smb2_mkdir_setinfo, | ||
668 | .rmdir = smb2_rmdir, | ||
669 | .unlink = smb2_unlink, | ||
670 | .rename = smb2_rename_path, | ||
671 | .create_hardlink = smb2_create_hardlink, | ||
672 | .open = smb2_open_file, | ||
673 | .set_fid = smb2_set_fid, | ||
674 | .close = smb2_close_file, | ||
675 | .flush = smb2_flush_file, | ||
676 | .async_readv = smb2_async_readv, | ||
677 | .async_writev = smb2_async_writev, | ||
678 | .sync_read = smb2_sync_read, | ||
679 | .sync_write = smb2_sync_write, | ||
680 | .query_dir_first = smb2_query_dir_first, | ||
681 | .query_dir_next = smb2_query_dir_next, | ||
682 | .close_dir = smb2_close_dir, | ||
683 | .calc_smb_size = smb2_calc_size, | ||
684 | .is_status_pending = smb2_is_status_pending, | ||
685 | .oplock_response = smb2_oplock_response, | ||
686 | .queryfs = smb2_queryfs, | ||
687 | .mand_lock = smb2_mand_lock, | ||
688 | .mand_unlock_range = smb2_unlock_range, | ||
689 | .push_mand_locks = smb2_push_mandatory_locks, | ||
690 | .get_lease_key = smb2_get_lease_key, | ||
691 | .set_lease_key = smb2_set_lease_key, | ||
692 | .new_lease_key = smb2_new_lease_key, | ||
693 | .calc_signature = smb3_calc_signature, | ||
694 | }; | ||
695 | |||
696 | struct smb_version_values smb20_values = { | ||
697 | .version_string = SMB20_VERSION_STRING, | ||
698 | .protocol_id = SMB20_PROT_ID, | ||
699 | .req_capabilities = 0, /* MBZ */ | ||
700 | .large_lock_type = 0, | ||
701 | .exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK, | ||
702 | .shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK, | ||
703 | .unlock_lock_type = SMB2_LOCKFLAG_UNLOCK, | ||
704 | .header_size = sizeof(struct smb2_hdr), | ||
705 | .max_header_size = MAX_SMB2_HDR_SIZE, | ||
706 | .read_rsp_size = sizeof(struct smb2_read_rsp) - 1, | ||
707 | .lock_cmd = SMB2_LOCK, | ||
708 | .cap_unix = 0, | ||
709 | .cap_nt_find = SMB2_NT_FIND, | ||
710 | .cap_large_files = SMB2_LARGE_FILES, | ||
644 | }; | 711 | }; |
645 | 712 | ||
646 | struct smb_version_values smb21_values = { | 713 | struct smb_version_values smb21_values = { |