Skip to content
Snippets Groups Projects
Select Git revision
  • 839a8e8660b6777e7fe4e80af1a048aebe2b5977
  • add-vdpu381-and-383-to-rkvdec-v2
  • add-vdpu381-and-383-to-rkvdec
  • prepare-add-vdpu381-and-383-to-rkvdec
  • add-rkvdec2-driver-vdpu383-hevc
  • add-rkvdec2-driver-vdpu383
  • add-rkvdec2-driver-hevc
  • rkvdec-mov-to-structs
  • av1-fix-postproc-leak
  • add-rkvdec2-driver-iommu-422-10bits
  • patch-queue/jamba/trixie
  • hdmi-fix-1080p-rock4d-6.11
  • upstreaming/rk3576-rock4d-spi-v1
  • upstreaming/rk3576-rock4d-support-v5
  • upstreaming/rk3588-hdmi-audio-6
  • upstreaming/rk3576-rock4d-support-v3
  • upstreaming/rk3576-rock4d-support-v1
  • upstreaming/rk3576-rock4d-support
  • add-rkvdec2-driver-iommu
  • upstream/rk3576-rock-4d
  • rk3588-hdmi-audio-2
  • v6.3
  • v6.3-rc1
  • v6.2-rc1
  • v6.0-rc1
  • v5.19-rc3
  • v5.19-rc2
  • v5.19-rc1
  • v5.18
  • v5.18-rc7
  • v5.18-rc6
  • v5.18-rc5
  • v5.18-rc4
  • v5.18-rc3
  • v5.18-rc2
  • v5.18-rc1
  • v5.17
  • v5.17-rc8
  • v5.17-rc7
  • v5.17-rc6
  • v5.17-rc5
41 results

fs-writeback.c

Blame
  • Forked from hardware-enablement / Rockchip upstream enablement efforts / linux
    Source project has a limited visibility.
    fs-writeback.c 38.96 KiB
    /*
     * fs/fs-writeback.c
     *
     * Copyright (C) 2002, Linus Torvalds.
     *
     * Contains all the functions related to writing back and waiting
     * upon dirty inodes against superblocks, and writing back dirty
     * pages against inodes.  ie: data writeback.  Writeout of the
     * inode itself is not handled here.
     *
     * 10Apr2002	Andrew Morton
     *		Split out of fs/inode.c
     *		Additions for address_space-based writeback
     */
    
    #include <linux/kernel.h>
    #include <linux/export.h>
    #include <linux/spinlock.h>
    #include <linux/slab.h>
    #include <linux/sched.h>
    #include <linux/fs.h>
    #include <linux/mm.h>
    #include <linux/pagemap.h>
    #include <linux/kthread.h>
    #include <linux/writeback.h>
    #include <linux/blkdev.h>
    #include <linux/backing-dev.h>
    #include <linux/tracepoint.h>
    #include "internal.h"
    
    /*
     * 4MB minimal write chunk size
     */
    #define MIN_WRITEBACK_PAGES	(4096UL >> (PAGE_CACHE_SHIFT - 10))
    
    /*
     * Passed into wb_writeback(), essentially a subset of writeback_control
     */
    struct wb_writeback_work {
    	long nr_pages;
    	struct super_block *sb;
    	unsigned long *older_than_this;
    	enum writeback_sync_modes sync_mode;
    	unsigned int tagged_writepages:1;
    	unsigned int for_kupdate:1;
    	unsigned int range_cyclic:1;
    	unsigned int for_background:1;
    	enum wb_reason reason;		/* why was writeback initiated? */
    
    	struct list_head list;		/* pending work list */
    	struct completion *done;	/* set if the caller waits */
    };
    
    /**
     * writeback_in_progress - determine whether there is writeback in progress
     * @bdi: the device's backing_dev_info structure.
     *
     * Determine whether there is writeback waiting to be handled against a
     * backing device.
     */
    int writeback_in_progress(struct backing_dev_info *bdi)
    {
    	return test_bit(BDI_writeback_running, &bdi->state);
    }
    EXPORT_SYMBOL(writeback_in_progress);
    
    static inline struct backing_dev_info *inode_to_bdi(struct inode *inode)
    {
    	struct super_block *sb = inode->i_sb;