// SPDX-License-Identifier: GPL-2.0-only/* * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. */#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt#include<linux/sched.h>#include<linux/slab.h>#include<linux/spinlock.h>#include<linux/completion.h>#include<linux/buffer_head.h>#include<linux/blkdev.h>#include<linux/kthread.h>#include<linux/export.h>#include<linux/namei.h>#include<linux/mount.h>#include<linux/gfs2_ondisk.h>#include<linux/quotaops.h>#include<linux/lockdep.h>#include<linux/module.h>#include<linux/backing-dev.h>#include"gfs2.h"#include"incore.h"#include"bmap.h"#include"glock.h"#include"glops.h"#include"inode.h"#include"recovery.h"#include"rgrp.h"#include"super.h"#include"sys.h"#include"util.h"#include"log.h"#include"quota.h"#include"dir.h"#include"meta_io.h"#include"trace_gfs2.h"#include"lops.h"#define DO 0#define UNDO 1/** * gfs2_tune_init - Fill a gfs2_tune structure with default values * @gt: tune * */staticvoidgfs2_tune_init(structgfs2_tune*gt){spin_lock_init(>->gt_spin);gt->gt_quota_warn_period=10;gt->gt_quota_scale_num=1;gt->gt_quota_scale_den=1;gt->gt_new_files_jdata=0;gt->gt_max_readahead=BIT(18);gt->gt_complain_secs=10;}voidfree_sbd(structgfs2_sbd*sdp){if(sdp->sd_lkstats)free_percpu(sdp->sd_lkstats);kfree(sdp);}staticstructgfs2_sbd*init_sbd(structsuper_block*sb){structgfs2_sbd*sdp;structaddress_space*mapping;sdp=kzalloc(sizeof(structgfs2_sbd),GFP_KERNEL);if(!sdp