mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
fs: fs-writeback: move sysctl to fs/fs-writeback.c
The dirtytime_expire_interval belongs to fs/fs-writeback.c, move it to fs/fs-writeback.c from /kernel/sysctl.c. And remove the useless extern variable declaration and the function declaration from include/linux/writeback.h Signed-off-by: Kaixiong Yu <yukaixiong@huawei.com> Reviewed-by: Kees Cook <kees@kernel.org> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Joel Granados <joel.granados@kernel.org>
This commit is contained in:
parent
97f5420ef1
commit
94eed61d58
|
@ -65,7 +65,7 @@ struct wb_writeback_work {
|
||||||
* timestamps written to disk after 12 hours, but in the worst case a
|
* timestamps written to disk after 12 hours, but in the worst case a
|
||||||
* few inodes might not their timestamps updated for 24 hours.
|
* few inodes might not their timestamps updated for 24 hours.
|
||||||
*/
|
*/
|
||||||
unsigned int dirtytime_expire_interval = 12 * 60 * 60;
|
static unsigned int dirtytime_expire_interval = 12 * 60 * 60;
|
||||||
|
|
||||||
static inline struct inode *wb_inode(struct list_head *head)
|
static inline struct inode *wb_inode(struct list_head *head)
|
||||||
{
|
{
|
||||||
|
@ -2435,14 +2435,7 @@ static void wakeup_dirtytime_writeback(struct work_struct *w)
|
||||||
schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
|
schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init start_dirtytime_writeback(void)
|
static int dirtytime_interval_handler(const struct ctl_table *table, int write,
|
||||||
{
|
|
||||||
schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
__initcall(start_dirtytime_writeback);
|
|
||||||
|
|
||||||
int dirtytime_interval_handler(const struct ctl_table *table, int write,
|
|
||||||
void *buffer, size_t *lenp, loff_t *ppos)
|
void *buffer, size_t *lenp, loff_t *ppos)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -2453,6 +2446,25 @@ int dirtytime_interval_handler(const struct ctl_table *table, int write,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct ctl_table vm_fs_writeback_table[] = {
|
||||||
|
{
|
||||||
|
.procname = "dirtytime_expire_seconds",
|
||||||
|
.data = &dirtytime_expire_interval,
|
||||||
|
.maxlen = sizeof(dirtytime_expire_interval),
|
||||||
|
.mode = 0644,
|
||||||
|
.proc_handler = dirtytime_interval_handler,
|
||||||
|
.extra1 = SYSCTL_ZERO,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static int __init start_dirtytime_writeback(void)
|
||||||
|
{
|
||||||
|
schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);
|
||||||
|
register_sysctl_init("vm", vm_fs_writeback_table);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
__initcall(start_dirtytime_writeback);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __mark_inode_dirty - internal function to mark an inode dirty
|
* __mark_inode_dirty - internal function to mark an inode dirty
|
||||||
*
|
*
|
||||||
|
|
|
@ -327,12 +327,8 @@ extern struct wb_domain global_wb_domain;
|
||||||
/* These are exported to sysctl. */
|
/* These are exported to sysctl. */
|
||||||
extern unsigned int dirty_writeback_interval;
|
extern unsigned int dirty_writeback_interval;
|
||||||
extern unsigned int dirty_expire_interval;
|
extern unsigned int dirty_expire_interval;
|
||||||
extern unsigned int dirtytime_expire_interval;
|
|
||||||
extern int laptop_mode;
|
extern int laptop_mode;
|
||||||
|
|
||||||
int dirtytime_interval_handler(const struct ctl_table *table, int write,
|
|
||||||
void *buffer, size_t *lenp, loff_t *ppos);
|
|
||||||
|
|
||||||
void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty);
|
void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty);
|
||||||
unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh);
|
unsigned long wb_calc_thresh(struct bdi_writeback *wb, unsigned long thresh);
|
||||||
unsigned long cgwb_calc_thresh(struct bdi_writeback *wb);
|
unsigned long cgwb_calc_thresh(struct bdi_writeback *wb);
|
||||||
|
|
|
@ -2014,14 +2014,6 @@ static const struct ctl_table kern_table[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct ctl_table vm_table[] = {
|
static const struct ctl_table vm_table[] = {
|
||||||
{
|
|
||||||
.procname = "dirtytime_expire_seconds",
|
|
||||||
.data = &dirtytime_expire_interval,
|
|
||||||
.maxlen = sizeof(dirtytime_expire_interval),
|
|
||||||
.mode = 0644,
|
|
||||||
.proc_handler = dirtytime_interval_handler,
|
|
||||||
.extra1 = SYSCTL_ZERO,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
.procname = "drop_caches",
|
.procname = "drop_caches",
|
||||||
.data = &sysctl_drop_caches,
|
.data = &sysctl_drop_caches,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user