From patchwork Tue Oct 16 00:04:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 1597641 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id AE4F3DFB34 for ; Tue, 16 Oct 2012 00:04:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755006Ab2JPAEY (ORCPT ); Mon, 15 Oct 2012 20:04:24 -0400 Received: from ipmail05.adl6.internode.on.net ([150.101.137.143]:28991 "EHLO ipmail05.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754771Ab2JPAEW (ORCPT ); Mon, 15 Oct 2012 20:04:22 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtEmAMWjfFB5LH33/2dsb2JhbABFuh+EbQKBBYEJgiABAQUnExwjEAgYMRQlAzSIA6tAkFMUjSyBNYJBYAOVa5AxgwE Received: from ppp121-44-125-247.lns20.syd6.internode.on.net (HELO dastard) ([121.44.125.247]) by ipmail05.adl6.internode.on.net with ESMTP; 16 Oct 2012 10:34:16 +1030 Received: from dave by dastard with local (Exim 4.76) (envelope-from ) id 1TNudh-0004R5-Uh; Tue, 16 Oct 2012 11:04:05 +1100 Date: Tue, 16 Oct 2012 11:04:05 +1100 From: Dave Chinner To: zwu.kernel@gmail.com Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, linuxram@linux.vnet.ibm.com, viro@zeniv.linux.org.uk, dave@jikos.cz, tytso@mit.edu, cmm@us.ibm.com, Zhi Yong Wu Subject: [PATCH] xfs: add hot tracking support. Message-ID: <20121016000405.GA2864@dastard> References: <1349863655-29320-1-git-send-email-zwu.kernel@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1349863655-29320-1-git-send-email-zwu.kernel@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Dave Chinner Connect up the VFS hot tracking support so XFS filesystems can make use of it. Signed-off-by: Dave Chinner --- fs/xfs/xfs_mount.h | 1 + fs/xfs/xfs_super.c | 9 +++++++++ 2 files changed, 10 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index a631ca3..d5e7277 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -215,6 +215,7 @@ typedef struct xfs_mount { #define XFS_MOUNT_WSYNC (1ULL << 0) /* for nfs - all metadata ops must be synchronous except for space allocations */ +#define XFS_MOUNT_HOTTRACK (1ULL << 1) /* hot inode tracking */ #define XFS_MOUNT_WAS_CLEAN (1ULL << 3) #define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4) /* atomic stop of all filesystem operations, typically for diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 56c2537..17786ff 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -61,6 +61,7 @@ #include #include #include +#include static const struct super_operations xfs_super_operations; static kmem_zone_t *xfs_ioend_zone; @@ -114,6 +115,7 @@ mempool_t *xfs_ioend_pool; #define MNTOPT_NODELAYLOG "nodelaylog" /* Delayed logging disabled */ #define MNTOPT_DISCARD "discard" /* Discard unused blocks */ #define MNTOPT_NODISCARD "nodiscard" /* Do not discard unused blocks */ +#define MNTOPT_HOTTRACK "hot_track" /* hot inode tracking */ /* * Table driven mount option parser. @@ -371,6 +373,8 @@ xfs_parseargs( mp->m_flags |= XFS_MOUNT_DISCARD; } else if (!strcmp(this_char, MNTOPT_NODISCARD)) { mp->m_flags &= ~XFS_MOUNT_DISCARD; + } else if (!strcmp(this_char, MNTOPT_HOTTRACK)) { + mp->m_flags |= XFS_MOUNT_HOTTRACK; } else if (!strcmp(this_char, "ihashsize")) { xfs_warn(mp, "ihashsize no longer used, option is deprecated."); @@ -1040,6 +1044,9 @@ xfs_fs_put_super( { struct xfs_mount *mp = XFS_M(sb); + if (mp->m_flags & XFS_MOUNT_HOTTRACK) + hot_track_exit(sb); + xfs_filestream_unmount(mp); xfs_unmountfs(mp); @@ -1470,6 +1477,8 @@ xfs_fs_fill_super( error = ENOMEM; goto out_unmount; } + if (mp->m_flags & XFS_MOUNT_HOTTRACK) + hot_track_init(sb); return 0;