From patchwork Wed Jul 18 15:48:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 1212021 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 184C73FD4F for ; Wed, 18 Jul 2012 15:50:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754636Ab2GRPuX (ORCPT ); Wed, 18 Jul 2012 11:50:23 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:57672 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754501Ab2GRPuX (ORCPT ); Wed, 18 Jul 2012 11:50:23 -0400 Received: by mail-lb0-f174.google.com with SMTP id gm6so2257593lbb.19 for ; Wed, 18 Jul 2012 08:50:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=+SDttgp7HYD4O0a+KkJaADm6JTSHD/SUBLFF0QlhsMk=; b=ouqrc+jU4i5ugDi6Es8DhoEfvEXdxdgqnSnTBnD3GhCVCVNu6Pop/Bvkn2jT7s2poS 22VVl8BpKLzvdKlmUb4/P/hAloZjzzqzG01WA81CzGQtYz+V9n/jXnY1hS2HvRn1DlAR ccewJk7b7qI4y8+F0DLWBZyIzLZkRVishIYaAOH//zdZsVrmsTUGGYrM67uXw5mNouYT CBxdLuNkdjoUachqhDHSmfph4mxy2UVILcsXBlmAMHSbXp823lEOzZSTQ5GLjKlRNwSo hfzLQjjzeKyYE6FjSPuGQOcTeckr4r6XjXKB8QgAuYaSO7wv0kNdgV33wngSy4ZKwCKJ wrAA== Received: by 10.152.113.68 with SMTP id iw4mr3981875lab.50.1342626622501; Wed, 18 Jul 2012 08:50:22 -0700 (PDT) Received: from localhost.localdomain ([178.45.208.11]) by mx.google.com with ESMTPS id p2sm4826985lbj.4.2012.07.18.08.50.20 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Jul 2012 08:50:21 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH 15/45] CIFS: Add SMB2 support for query_file_info Date: Wed, 18 Jul 2012 19:48:31 +0400 Message-Id: <1342626541-29872-16-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1342626541-29872-1-git-send-email-pshilovsky@samba.org> References: <1342626541-29872-1-git-send-email-pshilovsky@samba.org> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Signed-off-by: Pavel Shilovsky --- fs/cifs/smb2ops.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index eba12b3..0fd5801 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -190,6 +190,26 @@ smb2_get_srv_inum(const unsigned int xid, struct cifs_tcon *tcon, return 0; } +static int +smb2_query_file_info(const unsigned int xid, struct cifs_tcon *tcon, + struct cifs_fid *fid, FILE_ALL_INFO *data) +{ + int rc; + struct smb2_file_all_info *smb2_data; + + smb2_data = kzalloc(sizeof(struct smb2_file_all_info) + MAX_NAME * 2, + GFP_KERNEL); + if (smb2_data == NULL) + return -ENOMEM; + + rc = SMB2_query_info(xid, tcon, fid->persistent_fid, fid->volatile_fid, + smb2_data); + if (!rc) + move_smb2_info_to_cifs(data, smb2_data); + kfree(smb2_data); + return rc; +} + static char * smb2_build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, struct cifs_tcon *tcon) @@ -334,6 +354,7 @@ struct smb_version_operations smb21_operations = { .echo = SMB2_echo, .query_path_info = smb2_query_path_info, .get_srv_inum = smb2_get_srv_inum, + .query_file_info = smb2_query_file_info, .build_path_to_root = smb2_build_path_to_root, .mkdir = smb2_mkdir, .mkdir_setinfo = smb2_mkdir_setinfo,