From patchwork Sun Mar 26 04:02:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9644967 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 24A4B60327 for ; Sun, 26 Mar 2017 04:02:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 059E92022C for ; Sun, 26 Mar 2017 04:02:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAB032521E; Sun, 26 Mar 2017 04:02:58 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 567BA2022C for ; Sun, 26 Mar 2017 04:02:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750730AbdCZEC5 (ORCPT ); Sun, 26 Mar 2017 00:02:57 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:34263 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750728AbdCZEC4 (ORCPT ); Sun, 26 Mar 2017 00:02:56 -0400 Received: by mail-pg0-f65.google.com with SMTP id o123so2072057pga.1; Sat, 25 Mar 2017 21:02:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=g3Z5/R/HSEnstYH1bXJ+qpTohfxbQpKYRSJ7bprMLxc=; b=E0+oVlwtBTJMUugQnxdQ//RcIHBxlceq04PNMCmH6+mtSCXuSlA0nkzkwCbksjtOLK edsYfeffcAg2hRz3eOE2BMOLe4NXHxRkC93rNVKkyBPALgRMYbhXnkbqA3SBTNVz76Ug HlallP5V0W6gEcggdXorgosiFRI0ELtywM/JmGDijilxxuxPdo2ThOkVfbsORb4MPnEB EQjIt4mjnp9pYzVSdplXUBImI6MuWzrMDbUVojxlvb3v3ODzBWi0G8eYR//MFVFGYVOY HSHpwIhHgp8Ligl4TcpAluI2SOLq+JIPGLcDT/wlV6o6v0GTt4lnAhihosOoJhJGZwAE 2Bdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=g3Z5/R/HSEnstYH1bXJ+qpTohfxbQpKYRSJ7bprMLxc=; b=Uuso9zB6bD9WJHc53xeGOJ0WXmfrk+8w0+sJ/X15d/uH5mIebYef35TURWl1YaFIo3 HTAidrewmGLOSljYsBvSQU/R1FmeZr3v4Bmumv3gX2J5QZ34zl47MwZ88y8tB1lgfR+G 8fzBp83nXOefgwYid9qfWTAm+BDcCM8QN+NUm3qAbfytXwO4SpKQSE5rrfltO9G+FMra /xwlbVw15sdZinkroAGvhvoUTKUWNP9wdFqRy75f+EA7lU0B4Ehf3aH8lEI2K8CLu6CO dwtnfvBGfbVQsT7f5IlmL3IZsrdqiWV1g0huLP2A/dKQtFBzxv//cIXX0SiERjsWmYNI k3PQ== X-Gm-Message-State: AFeK/H0k357ixzLJP19i5cwB+XH+zWoHZnhK3TjipkOO8BFM8siV8DqyXQIXc+sWGZki9Q== X-Received: by 10.98.61.5 with SMTP id k5mr18260912pfa.229.1490500966856; Sat, 25 Mar 2017 21:02:46 -0700 (PDT) Received: from zzz.hsd1.wa.comcast.net (c-73-239-167-150.hsd1.wa.comcast.net. [73.239.167.150]) by smtp.gmail.com with ESMTPSA id z25sm13030706pfi.28.2017.03.25.21.02.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Mar 2017 21:02:46 -0700 (PDT) From: Eric Biggers To: linux-fsdevel@vger.kernel.org Cc: linux-block@vger.kernel.org, Alexander Viro , Eric Biggers , "Darrick J . Wong" Subject: [PATCH] fs: remove _submit_bh() Date: Sat, 25 Mar 2017 21:02:18 -0700 Message-Id: <20170326040218.28519-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.12.1 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers _submit_bh() allowed submitting a buffer_head for I/O using custom bio_flags. It used to be used by jbd to set BIO_SNAP_STABLE, introduced by commit 713685111774 ("mm: make snapshotting pages for stable writes a per-bio operation"). However, the code and flag has since been removed and no _submit_bh() users remain. These days, bio_flags are mostly used internally by the block layer to track the state of bio's. As such, it doesn't really make sense for filesystems to use them instead of op_flags when wanting special behavior for block requests. Therefore, remove _submit_bh() and trim the bio_flags argument from submit_bh_wbc(). Cc: Darrick J. Wong Signed-off-by: Eric Biggers Reviewed-by: Christoph Hellwig --- fs/buffer.c | 19 +++++-------------- include/linux/buffer_head.h | 2 -- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 9196f2a270da..68dc05ce06a5 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -49,7 +49,6 @@ static int fsync_buffers_list(spinlock_t *lock, struct list_head *list); static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, - unsigned long bio_flags, struct writeback_control *wbc); #define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers) @@ -1830,7 +1829,7 @@ 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_wbc(REQ_OP_WRITE, write_flags, bh, 0, wbc); + submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, wbc); nr_underway++; } bh = next; @@ -1884,7 +1883,7 @@ int __block_write_full_page(struct inode *inode, struct page *page, struct buffer_head *next = bh->b_this_page; if (buffer_async_write(bh)) { clear_buffer_dirty(bh); - submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, 0, wbc); + submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, wbc); nr_underway++; } bh = next; @@ -3095,7 +3094,7 @@ void guard_bio_eod(int op, struct bio *bio) } static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, - unsigned long bio_flags, struct writeback_control *wbc) + struct writeback_control *wbc) { struct bio *bio; @@ -3130,7 +3129,6 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, bio->bi_end_io = end_bio_bh_io_sync; bio->bi_private = bh; - bio->bi_flags |= bio_flags; /* Take care of bh's that straddle the end of the device */ guard_bio_eod(op, bio); @@ -3145,16 +3143,9 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, return 0; } -int _submit_bh(int op, int op_flags, struct buffer_head *bh, - unsigned long bio_flags) +int submit_bh(int op, int op_flags, struct buffer_head *bh) { - return submit_bh_wbc(op, op_flags, bh, bio_flags, NULL); -} -EXPORT_SYMBOL_GPL(_submit_bh); - -int submit_bh(int op, int op_flags, struct buffer_head *bh) -{ - return submit_bh_wbc(op, op_flags, bh, 0, NULL); + return submit_bh_wbc(op, op_flags, bh, NULL); } EXPORT_SYMBOL(submit_bh); diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 79591c3660cc..bd029e52ef5e 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -196,8 +196,6 @@ void ll_rw_block(int, int, int, struct buffer_head * bh[]); int sync_dirty_buffer(struct buffer_head *bh); int __sync_dirty_buffer(struct buffer_head *bh, int op_flags); void write_dirty_buffer(struct buffer_head *bh, int op_flags); -int _submit_bh(int op, int op_flags, struct buffer_head *bh, - unsigned long bio_flags); int submit_bh(int, int, struct buffer_head *); void write_boundary_block(struct block_device *bdev, sector_t bblock, unsigned blocksize);