Re: [PATCH 1/2] fs: introduce APIs to enable sending write-hint with buffer-head

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you for review and suggestion.
I will make that change in V2, once things become clear for second patch
of this set.

On Monday 10 December 2018 07:19 PM, Jan Kara wrote:
On Mon 10-12-18 18:20:03, Kanchan Joshi wrote:
submit_bh and write_dirty_buffer do not take write-hint as
parameter. This patch introduces variants which do.

Signed-off-by: Kanchan Joshi <joshi.k@xxxxxxxxxxx>

...

@@ -3162,6 +3169,20 @@ void write_dirty_buffer(struct buffer_head *bh, int op_flags)
  }
  EXPORT_SYMBOL(write_dirty_buffer);
+void write_dirty_buffer_write_hint(struct buffer_head *bh, int op_flags,
+				   enum rw_hint hint)
+{
+	lock_buffer(bh);
+	if (!test_clear_buffer_dirty(bh)) {
+		unlock_buffer(bh);
+		return;
+	}
+	bh->b_end_io = end_buffer_write_sync;
+	get_bh(bh);
+	submit_bh_wbc(REQ_OP_WRITE, op_flags, bh, hint, NULL);
+}
+EXPORT_SYMBOL(write_dirty_buffer_write_hint);
+

Please implement write_dirty_buffer() as a call to
write_dirty_buffer_write_hint() so that we don't unnecessarily duplicate
the code. Otherwise the patch looks good.

								Honza




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux