From patchwork Wed Aug 31 13:01:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9307181 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 23263601C0 for ; Wed, 31 Aug 2016 13:02:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13A9A28F28 for ; Wed, 31 Aug 2016 13:02:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0850428F24; Wed, 31 Aug 2016 13:02:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9FDF28F24 for ; Wed, 31 Aug 2016 13:02:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934432AbcHaNCA (ORCPT ); Wed, 31 Aug 2016 09:02:00 -0400 Received: from hr2.samba.org ([144.76.82.148]:31417 "EHLO hr2.samba.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934309AbcHaNBz (ORCPT ); Wed, 31 Aug 2016 09:01:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42627210; h=Message-Id:Date:Cc:To:From; bh=C/5Isig9omMC1notZzCG4UkFdiVxnDTUGbmFq5osIVQ=; b=sV1yfhj+dH43WOl8WrXNvcW+Y2kg12VPgwRtpF45wGCRfi1gMzPR2XIgJp6kltLUjHN0pa0Oj52hkxgqtYgs7fDTf/WeZ/4c0tbvMXmc51E7rxLKZtZVM3IoecOZr1JZvzih/7yv/ASCJ9HtZiC7WblQe4iKmIx0mm7yKiUbA2E=; Received: from [127.0.0.2] (localhost [127.0.0.1]) by hr2.samba.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim) id 1bf59N-0003ib-8f; Wed, 31 Aug 2016 13:01:53 +0000 From: Jeff Layton To: samba-technical@lists.samba.org Cc: ira@wakeful.net, ceph-devel@vger.kernel.org Subject: [samba RFC PATCH 4/6] vfs:ceph: change cephwrap_fstatx to use ceph_fstatx Date: Wed, 31 Aug 2016 09:01:12 -0400 Message-Id: <1472648474-3131-5-git-send-email-jlayton@samba.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472648474-3131-1-git-send-email-jlayton@samba.org> References: <1472648474-3131-1-git-send-email-jlayton@samba.org> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jeff Layton --- source3/modules/vfs_ceph.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index f8c43f93f4b5..a1480201c628 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -598,6 +598,32 @@ static int cephwrap_stat(struct vfs_handle_struct *handle, return result; } +static int cephwrap_fstat(struct vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf) +{ + int result = -1; + struct ceph_statx stx; + + DEBUG(10, ("[CEPH] fstat(%p, %d)\n", handle, fsp->fh->fd)); + result = ceph_fstatx(handle->data, fsp->fh->fd, &stx, + CEPH_STATX_BASIC_STATS|CEPH_STATX_BTIME, 0); + DEBUG(10, ("[CEPH] fstat(...) = %d\n", result)); + if (result < 0) { + WRAP_RETURN(result); + } else { + DEBUG(10, ("[CEPH]\tstx = {dev = %llx/%llx, ino = %llu, mode = 0x%x, nlink = %llu, " + "uid = %d, gid = %d, rdev = %llx/%llx, size = %llu, blksize = %llu, " + "blocks = %llu, atime = %llu, mtime = %llu, ctime = %llu, btime = %llu}\n", + llu(stx.stx_dev_major), llu(stx.stx_dev_minor), llu(stx.stx_ino), stx.stx_mode, + llu(stx.stx_nlink), stx.stx_uid, stx.stx_gid, llu(stx.stx_rdev_major), + llu(stx.stx_rdev_minor), llu(stx.stx_size), llu(stx.stx_blksize), + llu(stx.stx_blocks), llu(stx.stx_atime), llu(stx.stx_mtime), llu(stx.stx_ctime), + llu(stx.stx_btime))); + } + init_stat_ex_from_ceph_statx(sbuf, &stx); + DEBUG(10, ("[CEPH] mode = 0x%x\n", sbuf->st_ex_mode)); + return result; +} + #else /* HAVE_CEPH_STATX */ static int cephwrap_stat(struct vfs_handle_struct *handle, @@ -631,7 +657,6 @@ static int cephwrap_stat(struct vfs_handle_struct *handle, DEBUG(10, ("[CEPH] mode = 0x%x\n", smb_fname->st.st_ex_mode)); return result; } -#endif /* HAVE_CEPH_STATX */ static int cephwrap_fstat(struct vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf) { @@ -658,6 +683,7 @@ static int cephwrap_fstat(struct vfs_handle_struct *handle, files_struct *fsp, S DEBUG(10, ("[CEPH] mode = 0x%x\n", sbuf->st_ex_mode)); return result; } +#endif /* HAVE_CEPH_STATX */ static int cephwrap_lstat(struct vfs_handle_struct *handle, struct smb_filename *smb_fname)