lkml.org 
[lkml]   [2017]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 4/5] cgroup, buffer_head: implement submit_bh_blkcg_css()
    On Tue 10-10-17 08:54:40, Tejun Heo wrote:
    > Implement submit_bh_blkcg_css() which will be used to override cgroup
    > membership on specific buffer_heads.
    >
    > v2: Reimplemented using create_bh_bio() as suggested by Jan.
    >
    > Signed-off-by: Tejun Heo <tj@kernel.org>
    > Cc: Jan Kara <jack@suse.cz>
    > Cc: Jens Axboe <axboe@kernel.dk>

    Looks good. You can add:

    Reviewed-by: Jan Kara <jack@suse.cz>

    Honza

    > ---
    > fs/buffer.c | 12 ++++++++++++
    > include/linux/buffer_head.h | 3 +++
    > 2 files changed, 15 insertions(+)
    >
    > diff --git a/fs/buffer.c b/fs/buffer.c
    > index b4b2169..ed0e473 100644
    > --- a/fs/buffer.c
    > +++ b/fs/buffer.c
    > @@ -3147,6 +3147,18 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
    > return 0;
    > }
    >
    > +int submit_bh_blkcg_css(int op, int op_flags, struct buffer_head *bh,
    > + struct cgroup_subsys_state *blkcg_css)
    > +{
    > + struct bio *bio;
    > +
    > + bio = create_bh_bio(op, op_flags, bh, 0);
    > + bio_associate_blkcg(bio, blkcg_css);
    > + submit_bio(bio);
    > + return 0;
    > +}
    > +EXPORT_SYMBOL(submit_bh_blkcg_css);
    > +
    > int submit_bh(int op, int op_flags, struct buffer_head *bh)
    > {
    > struct bio *bio;
    > diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
    > index c8dae55..dca5b3b 100644
    > --- a/include/linux/buffer_head.h
    > +++ b/include/linux/buffer_head.h
    > @@ -13,6 +13,7 @@
    > #include <linux/pagemap.h>
    > #include <linux/wait.h>
    > #include <linux/atomic.h>
    > +#include <linux/cgroup.h>
    >
    > #ifdef CONFIG_BLOCK
    >
    > @@ -197,6 +198,8 @@ 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_blkcg_css(int op, int op_flags, struct buffer_head *bh,
    > + struct cgroup_subsys_state *blkcg_css);
    > int submit_bh(int, int, struct buffer_head *);
    > void write_boundary_block(struct block_device *bdev,
    > sector_t bblock, unsigned blocksize);
    > --
    > 2.9.5
    >
    --
    Jan Kara <jack@suse.com>
    SUSE Labs, CR

    \
     
     \ /
      Last update: 2017-10-11 09:56    [W:4.623 / U:0.452 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site