From patchwork Thu May 17 12:21:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saugata Das X-Patchwork-Id: 8725 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5777923E23 for ; Thu, 17 May 2012 12:22:19 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 11A22A186CC for ; Thu, 17 May 2012 12:22:18 +0000 (UTC) Received: by yhpp61 with SMTP id p61so2030433yhp.11 for ; Thu, 17 May 2012 05:22:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=bUuF7B6ZCvI4ajyI7+gLqOcfn8b095PovJcQgi/9nFc=; b=NQK4y67VhbJpTh/FfpqV60R+CNA7qSyuadZCkKRem79DYvN5ZbvUBC9L+NnznrLyK0 CknGIpM0tLRJFZy8QHeOUJP94RSlnTj+cti8OnhSNEj8X4KhJwDDkinYhcu6o+e342ux c+FfE/dFS10MoRf/lvH772UW13+dFXr/9ncJRA80KnP/tIf6pza04++55b8pYjGFZm9t BX2BVKXa1byahPpfCwL68QyfO6acr7j468+93FAxiDNt4OQj1HHuzmQBj07JrJUzLDA6 VPnAufx96va2kITVOIw3h2C75XIzvVqRBFuNb6uTKnCKjplsjOI0ahnnUAa+uwyWHM/H IKdQ== Received: by 10.50.85.163 with SMTP id i3mr5006676igz.57.1337257338390; Thu, 17 May 2012 05:22:18 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.35.72 with SMTP id o8csp24184ibd; Thu, 17 May 2012 05:22:17 -0700 (PDT) Received: by 10.14.188.131 with SMTP id a3mr1434821een.92.1337257337250; Thu, 17 May 2012 05:22:17 -0700 (PDT) Received: from eu1sys200aog114.obsmtp.com (eu1sys200aog114.obsmtp.com. [207.126.144.137]) by mx.google.com with SMTP id w50si1776751eef.6.2012.05.17.05.22.04 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 May 2012 05:22:17 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.137 is neither permitted nor denied by best guess record for domain of saugata.das@stericsson.com) client-ip=207.126.144.137; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.137 is neither permitted nor denied by best guess record for domain of saugata.das@stericsson.com) smtp.mail=saugata.das@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob114.postini.com ([207.126.147.11]) with SMTP ID DSNKT7TtZnfCGKj+oJTM8BPDqhYGJHkJde3X@postini.com; Thu, 17 May 2012 12:22:16 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 89ED0A8; Thu, 17 May 2012 12:13:30 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 0044C5CA; Thu, 17 May 2012 12:21:51 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 24581A8074; Thu, 17 May 2012 14:21:46 +0200 (CEST) Received: from localhost (10.201.54.119) by exdcvycastm022.EQ1STM.local (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 17 May 2012 14:21:56 +0200 From: Saugata Das To: , , Cc: , , , , , , , , Saugata Das Subject: [PATCH v2 1/2] block: add BH_Meta flag Date: Thu, 17 May 2012 17:51:29 +0530 Message-ID: <1337257290-28547-1-git-send-email-saugata.das@stericsson.com> X-Mailer: git-send-email 1.7.4.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQl1+NIWPz6bc+9wmQlvKs82YMArtqvOsSDXcduuPUUdNYmrAUSU6ifDXw4R4vPZ/Oi+fXYd From: Saugata Das Today, storage devices like eMMC has special features like data tagging (introduced in MMC-4.5 version) in order to improve performance of some specific writes. On MMC stack, data tagging is used for all writes which has REQ_META flag set. This patch adds the capability to add REQ_META flag during meta data write. Signed-off-by: Saugata Das changes in v2: Replaced the conditionals around submit_bh as suggested in the review comments from Boaz --- fs/buffer.c | 6 ++++-- include/linux/buffer_head.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 36d6665..942c75b 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1685,7 +1685,8 @@ static int __block_write_full_page(struct inode *inode, struct page *page, do { struct buffer_head *next = bh->b_this_page; if (buffer_async_write(bh)) { - submit_bh(write_op, bh); + submit_bh(write_op | + (buffer_meta(bh) << __REQ_META), bh); nr_underway++; } bh = next; @@ -1739,7 +1740,8 @@ recover: struct buffer_head *next = bh->b_this_page; if (buffer_async_write(bh)) { clear_buffer_dirty(bh); - submit_bh(write_op, bh); + submit_bh(write_op | + (buffer_meta(bh) << __REQ_META), bh); nr_underway++; } bh = next; diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 458f497..13bba17 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -34,6 +34,7 @@ enum bh_state_bits { BH_Write_EIO, /* I/O error on write */ BH_Unwritten, /* Buffer is allocated on disk but not written */ BH_Quiet, /* Buffer Error Prinks to be quiet */ + BH_Meta, /* Is meta */ BH_PrivateStart,/* not a state bit, but the first bit available * for private allocation by other entities @@ -124,6 +125,7 @@ BUFFER_FNS(Delay, delay) BUFFER_FNS(Boundary, boundary) BUFFER_FNS(Write_EIO, write_io_error) BUFFER_FNS(Unwritten, unwritten) +BUFFER_FNS(Meta, meta) #define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) #define touch_buffer(bh) mark_page_accessed(bh->b_page)