From patchwork Thu Aug 25 23:43:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 9300421 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 3ECD560757 for ; Thu, 25 Aug 2016 23:44:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E49F292E8 for ; Thu, 25 Aug 2016 23:44:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22F6529384; Thu, 25 Aug 2016 23:44:48 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from oss.sgi.com (oss.sgi.com [192.48.182.195]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2D2AD292E8 for ; Thu, 25 Aug 2016 23:44:47 +0000 (UTC) Received: from oss.sgi.com (localhost [IPv6:::1]) by oss.sgi.com (Postfix) with ESMTP id CE1897FED; Thu, 25 Aug 2016 18:44:01 -0500 (CDT) X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id AC1007FDD for ; Thu, 25 Aug 2016 18:43:59 -0500 (CDT) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 2FFD1AC002 for ; Thu, 25 Aug 2016 16:43:59 -0700 (PDT) X-ASG-Debug-ID: 1472168636-0bf81509b01dfa30001-NocioJ Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by cuda.sgi.com with ESMTP id YE08eXwL6Ufw8ea6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 25 Aug 2016 16:43:57 -0700 (PDT) X-Barracuda-Envelope-From: darrick.wong@oracle.com X-Barracuda-Effective-Source-IP: userp1040.oracle.com[156.151.31.81] X-Barracuda-Apparent-Source-IP: 156.151.31.81 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u7PNht6C026239 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Aug 2016 23:43:55 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id u7PNhsMA016832 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 25 Aug 2016 23:43:55 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u7PNhsiF017410; Thu, 25 Aug 2016 23:43:54 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 25 Aug 2016 16:43:52 -0700 Subject: [PATCH 04/20] xfs: widen xfs_refcount_irec fields to handle realtime rmapbt From: "Darrick J. Wong" X-ASG-Orig-Subj: [PATCH 04/20] xfs: widen xfs_refcount_irec fields to handle realtime rmapbt To: david@fromorbit.com, darrick.wong@oracle.com Date: Thu, 25 Aug 2016 16:43:51 -0700 Message-ID: <147216863155.3688.8152957980694721928.stgit@birch.djwong.org> In-Reply-To: <147216860614.3688.3200692982609112535.stgit@birch.djwong.org> References: <147216860614.3688.3200692982609112535.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Barracuda-Connect: userp1040.oracle.com[156.151.31.81] X-Barracuda-Start-Time: 1472168636 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 13064 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.32328 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Cc: linux-xfs@vger.kernel.org, xfs@oss.sgi.com X-BeenThere: xfs@oss.sgi.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com X-Virus-Scanned: ClamAV using ClamSMTP Change the startblock and blockcount fields of xfs_refcount_irec to be 64 bits wide. This enables us to use the same high level rmap code for either tree. We'll also collect all the resulting breakage fixes here. Signed-off-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_format.h | 4 ++- fs/xfs/libxfs/xfs_rmap.c | 58 ++++++++++++++++++++++---------------------- fs/xfs/libxfs/xfs_rmap.h | 20 ++++++++------- fs/xfs/xfs_trace.h | 38 ++++++++++++++--------------- 4 files changed, 60 insertions(+), 60 deletions(-) diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h index 5703b57..62c19ce 100644 --- a/fs/xfs/libxfs/xfs_format.h +++ b/fs/xfs/libxfs/xfs_format.h @@ -1436,8 +1436,8 @@ struct xfs_rmap_rec { XFS_RMAP_BMBT_BLOCK) #define XFS_RMAP_REC_FLAGS (XFS_RMAP_UNWRITTEN) struct xfs_rmap_irec { - xfs_agblock_t rm_startblock; /* extent start block */ - xfs_extlen_t rm_blockcount; /* extent length */ + xfs_fsblock_t rm_startblock; /* extent start block */ + xfs_filblks_t rm_blockcount; /* extent length */ __uint64_t rm_owner; /* extent owner */ __uint64_t rm_offset; /* offset within the owner */ unsigned int rm_flags; /* state flags */ diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c index b22f93d..aa5052f 100644 --- a/fs/xfs/libxfs/xfs_rmap.c +++ b/fs/xfs/libxfs/xfs_rmap.c @@ -46,8 +46,8 @@ int xfs_rmap_lookup_le( struct xfs_btree_cur *cur, - xfs_agblock_t bno, - xfs_extlen_t len, + xfs_fsblock_t bno, + xfs_filblks_t len, uint64_t owner, uint64_t offset, unsigned int flags, @@ -68,8 +68,8 @@ xfs_rmap_lookup_le( int xfs_rmap_lookup_eq( struct xfs_btree_cur *cur, - xfs_agblock_t bno, - xfs_extlen_t len, + xfs_fsblock_t bno, + xfs_filblks_t len, uint64_t owner, uint64_t offset, unsigned int flags, @@ -115,8 +115,8 @@ xfs_rmap_update( int xfs_rmap_insert( struct xfs_btree_cur *rcur, - xfs_agblock_t agbno, - xfs_extlen_t len, + xfs_fsblock_t agbno, + xfs_filblks_t len, uint64_t owner, uint64_t offset, unsigned int flags) @@ -151,8 +151,8 @@ done: STATIC int xfs_rmap_delete( struct xfs_btree_cur *rcur, - xfs_agblock_t agbno, - xfs_extlen_t len, + xfs_fsblock_t agbno, + xfs_filblks_t len, uint64_t owner, uint64_t offset, unsigned int flags) @@ -252,7 +252,7 @@ xfs_rmap_find_left_neighbor_helper( int xfs_rmap_find_left_neighbor( struct xfs_btree_cur *cur, - xfs_agblock_t bno, + xfs_fsblock_t bno, uint64_t owner, uint64_t offset, unsigned int flags, @@ -330,7 +330,7 @@ xfs_rmap_lookup_le_range_helper( int xfs_rmap_lookup_le_range( struct xfs_btree_cur *cur, - xfs_agblock_t bno, + xfs_fsblock_t bno, uint64_t owner, uint64_t offset, unsigned int flags, @@ -387,8 +387,8 @@ xfs_rmap_lookup_le_range( STATIC int xfs_rmap_unmap( struct xfs_btree_cur *cur, - xfs_agblock_t bno, - xfs_extlen_t len, + xfs_fsblock_t bno, + xfs_filblks_t len, bool unwritten, struct xfs_owner_info *oinfo) { @@ -528,7 +528,7 @@ xfs_rmap_unmap( * Result: |rrrrr| |rrrr| * bno len */ - xfs_extlen_t orig_len = ltrec.rm_blockcount; + xfs_filblks_t orig_len = ltrec.rm_blockcount; ltrec.rm_blockcount = bno - ltrec.rm_startblock; error = xfs_rmap_update(cur, <rec); @@ -638,8 +638,8 @@ xfs_rmap_is_mergeable( STATIC int xfs_rmap_map( struct xfs_btree_cur *cur, - xfs_agblock_t bno, - xfs_extlen_t len, + xfs_fsblock_t bno, + xfs_filblks_t len, bool unwritten, struct xfs_owner_info *oinfo) { @@ -862,8 +862,8 @@ out_error: STATIC int xfs_rmap_convert( struct xfs_btree_cur *cur, - xfs_agblock_t bno, - xfs_extlen_t len, + xfs_fsblock_t bno, + xfs_filblks_t len, bool unwritten, struct xfs_owner_info *oinfo) { @@ -1287,8 +1287,8 @@ done: STATIC int xfs_rmap_convert_shared( struct xfs_btree_cur *cur, - xfs_agblock_t bno, - xfs_extlen_t len, + xfs_fsblock_t bno, + xfs_filblks_t len, bool unwritten, struct xfs_owner_info *oinfo) { @@ -1674,8 +1674,8 @@ done: STATIC int xfs_rmap_unmap_shared( struct xfs_btree_cur *cur, - xfs_agblock_t bno, - xfs_extlen_t len, + xfs_fsblock_t bno, + xfs_filblks_t len, bool unwritten, struct xfs_owner_info *oinfo) { @@ -1792,7 +1792,7 @@ xfs_rmap_unmap_shared( * Result: |rrrrr| |rrrr| * bno len */ - xfs_extlen_t orig_len = ltrec.rm_blockcount; + xfs_filblks_t orig_len = ltrec.rm_blockcount; /* Shrink the left side of the rmap */ error = xfs_rmap_lookup_eq(cur, ltrec.rm_startblock, @@ -1836,8 +1836,8 @@ out_error: STATIC int xfs_rmap_map_shared( struct xfs_btree_cur *cur, - xfs_agblock_t bno, - xfs_extlen_t len, + xfs_fsblock_t bno, + xfs_filblks_t len, bool unwritten, struct xfs_owner_info *oinfo) { @@ -2062,7 +2062,7 @@ xfs_rmap_finish_one( int error = 0; xfs_agnumber_t agno; struct xfs_owner_info oinfo; - xfs_agblock_t bno; + xfs_fsblock_t bno; bool unwritten; agno = XFS_FSB_TO_AGNO(mp, startblock); @@ -2251,8 +2251,8 @@ xfs_rmap_alloc_extent( struct xfs_mount *mp, struct xfs_defer_ops *dfops, xfs_agnumber_t agno, - xfs_agblock_t bno, - xfs_extlen_t len, + xfs_fsblock_t bno, + xfs_filblks_t len, __uint64_t owner) { struct xfs_bmbt_irec bmap; @@ -2275,8 +2275,8 @@ xfs_rmap_free_extent( struct xfs_mount *mp, struct xfs_defer_ops *dfops, xfs_agnumber_t agno, - xfs_agblock_t bno, - xfs_extlen_t len, + xfs_fsblock_t bno, + xfs_filblks_t len, __uint64_t owner) { struct xfs_bmbt_irec bmap; diff --git a/fs/xfs/libxfs/xfs_rmap.h b/fs/xfs/libxfs/xfs_rmap.h index c5c5817..06f7e73 100644 --- a/fs/xfs/libxfs/xfs_rmap.h +++ b/fs/xfs/libxfs/xfs_rmap.h @@ -142,14 +142,14 @@ int xfs_rmap_free(struct xfs_trans *tp, struct xfs_buf *agbp, xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len, struct xfs_owner_info *oinfo); -int xfs_rmap_lookup_le(struct xfs_btree_cur *cur, xfs_agblock_t bno, - xfs_extlen_t len, uint64_t owner, uint64_t offset, +int xfs_rmap_lookup_le(struct xfs_btree_cur *cur, xfs_fsblock_t bno, + xfs_filblks_t len, uint64_t owner, uint64_t offset, unsigned int flags, int *stat); -int xfs_rmap_lookup_eq(struct xfs_btree_cur *cur, xfs_agblock_t bno, - xfs_extlen_t len, uint64_t owner, uint64_t offset, +int xfs_rmap_lookup_eq(struct xfs_btree_cur *cur, xfs_fsblock_t bno, + xfs_filblks_t len, uint64_t owner, uint64_t offset, unsigned int flags, int *stat); -int xfs_rmap_insert(struct xfs_btree_cur *rcur, xfs_agblock_t agbno, - xfs_extlen_t len, uint64_t owner, uint64_t offset, +int xfs_rmap_insert(struct xfs_btree_cur *rcur, xfs_fsblock_t agbno, + xfs_filblks_t len, uint64_t owner, uint64_t offset, unsigned int flags); int xfs_rmap_get_rec(struct xfs_btree_cur *cur, struct xfs_rmap_irec *irec, int *stat); @@ -193,10 +193,10 @@ int xfs_rmap_convert_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops, struct xfs_inode *ip, int whichfork, struct xfs_bmbt_irec *imap); int xfs_rmap_alloc_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops, - xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len, + xfs_agnumber_t agno, xfs_fsblock_t bno, xfs_filblks_t len, __uint64_t owner); int xfs_rmap_free_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops, - xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len, + xfs_agnumber_t agno, xfs_fsblock_t bno, xfs_filblks_t len, __uint64_t owner); void xfs_rmap_finish_one_cleanup(struct xfs_trans *tp, @@ -206,10 +206,10 @@ int xfs_rmap_finish_one(struct xfs_trans *tp, enum xfs_rmap_intent_type type, xfs_fsblock_t startblock, xfs_filblks_t blockcount, xfs_exntst_t state, struct xfs_btree_cur **pcur); -int xfs_rmap_find_left_neighbor(struct xfs_btree_cur *cur, xfs_agblock_t bno, +int xfs_rmap_find_left_neighbor(struct xfs_btree_cur *cur, xfs_fsblock_t bno, uint64_t owner, uint64_t offset, unsigned int flags, struct xfs_rmap_irec *irec, int *stat); -int xfs_rmap_lookup_le_range(struct xfs_btree_cur *cur, xfs_agblock_t bno, +int xfs_rmap_lookup_le_range(struct xfs_btree_cur *cur, xfs_fsblock_t bno, uint64_t owner, uint64_t offset, unsigned int flags, struct xfs_rmap_irec *irec, int *stat); union xfs_btree_rec; diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index 74963a1..8d916dd 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h @@ -2430,14 +2430,14 @@ DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred); /* rmap tracepoints */ DECLARE_EVENT_CLASS(xfs_rmap_class, TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, - xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, + xfs_fsblock_t bno, xfs_filblks_t len, bool unwritten, struct xfs_owner_info *oinfo), - TP_ARGS(mp, agno, agbno, len, unwritten, oinfo), + TP_ARGS(mp, agno, bno, len, unwritten, oinfo), TP_STRUCT__entry( __field(dev_t, dev) __field(xfs_agnumber_t, agno) - __field(xfs_agblock_t, agbno) - __field(xfs_extlen_t, len) + __field(xfs_fsblock_t, bno) + __field(xfs_filblks_t, len) __field(uint64_t, owner) __field(uint64_t, offset) __field(unsigned long, flags) @@ -2445,7 +2445,7 @@ DECLARE_EVENT_CLASS(xfs_rmap_class, TP_fast_assign( __entry->dev = mp->m_super->s_dev; __entry->agno = agno; - __entry->agbno = agbno; + __entry->bno = bno; __entry->len = len; __entry->owner = oinfo->oi_owner; __entry->offset = oinfo->oi_offset; @@ -2453,10 +2453,10 @@ DECLARE_EVENT_CLASS(xfs_rmap_class, if (unwritten) __entry->flags |= XFS_RMAP_UNWRITTEN; ), - TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx", + TP_printk("dev %d:%d agno %d bno %llu len %llu owner %lld offset %llu flags 0x%lx", MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno, - __entry->agbno, + __entry->bno, __entry->len, __entry->owner, __entry->offset, @@ -2465,9 +2465,9 @@ DECLARE_EVENT_CLASS(xfs_rmap_class, #define DEFINE_RMAP_EVENT(name) \ DEFINE_EVENT(xfs_rmap_class, name, \ TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ - xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \ + xfs_fsblock_t bno, xfs_filblks_t len, bool unwritten, \ struct xfs_owner_info *oinfo), \ - TP_ARGS(mp, agno, agbno, len, unwritten, oinfo)) + TP_ARGS(mp, agno, bno, len, unwritten, oinfo)) /* simple AG-based error/%ip tracepoint class */ DECLARE_EVENT_CLASS(xfs_ag_error_class, @@ -2486,7 +2486,7 @@ DECLARE_EVENT_CLASS(xfs_ag_error_class, __entry->error = error; __entry->caller_ip = caller_ip; ), - TP_printk("dev %d:%d agno %u error %d caller %ps", + TP_printk("dev %d:%d agno %d error %d caller %ps", MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno, __entry->error, @@ -2512,14 +2512,14 @@ DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state); DECLARE_EVENT_CLASS(xfs_rmapbt_class, TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, - xfs_agblock_t agbno, xfs_extlen_t len, + xfs_fsblock_t bno, xfs_filblks_t len, uint64_t owner, uint64_t offset, unsigned int flags), - TP_ARGS(mp, agno, agbno, len, owner, offset, flags), + TP_ARGS(mp, agno, bno, len, owner, offset, flags), TP_STRUCT__entry( __field(dev_t, dev) __field(xfs_agnumber_t, agno) - __field(xfs_agblock_t, agbno) - __field(xfs_extlen_t, len) + __field(xfs_fsblock_t, bno) + __field(xfs_filblks_t, len) __field(uint64_t, owner) __field(uint64_t, offset) __field(unsigned int, flags) @@ -2527,16 +2527,16 @@ DECLARE_EVENT_CLASS(xfs_rmapbt_class, TP_fast_assign( __entry->dev = mp->m_super->s_dev; __entry->agno = agno; - __entry->agbno = agbno; + __entry->bno = bno; __entry->len = len; __entry->owner = owner; __entry->offset = offset; __entry->flags = flags; ), - TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x", + TP_printk("dev %d:%d agno %d bno %llu len %llu owner %lld offset %llu flags 0x%x", MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno, - __entry->agbno, + __entry->bno, __entry->len, __entry->owner, __entry->offset, @@ -2545,9 +2545,9 @@ DECLARE_EVENT_CLASS(xfs_rmapbt_class, #define DEFINE_RMAPBT_EVENT(name) \ DEFINE_EVENT(xfs_rmapbt_class, name, \ TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ - xfs_agblock_t agbno, xfs_extlen_t len, \ + xfs_fsblock_t bno, xfs_filblks_t len, \ uint64_t owner, uint64_t offset, unsigned int flags), \ - TP_ARGS(mp, agno, agbno, len, owner, offset, flags)) + TP_ARGS(mp, agno, bno, len, owner, offset, flags)) #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);