android_kernel_xiaomi_sm8450/fs/f2fs/f2fs.h
Greg Kroah-Hartman 1419b69403 Merge tag 'android12-5.10.101_r00' into android12-5.10
This is the merge of the upstream LTS release of 5.10.101 into the
android12-5.10 branch.

This merge contains the following new commits:

c194212a03 Merge 5.10.101 into android12-5.10-lts
3969aba589 Linux 5.10.101
cb86e511e7 iommu: Fix potential use-after-free during probe
f6b5d51976 perf: Fix list corruption in perf_cgroup_switch()
ce3ca12c63 arm64: dts: imx8mq: fix lcdif port node
759aeacdfe scsi: lpfc: Reduce log messages seen after firmware download
57c5d7d420 scsi: lpfc: Remove NVMe support if kernel has NVME_FC disabled
199dab00f0 can: isotp: fix error path in isotp_sendmsg() to unlock wait queue
3b10ebeb95 Makefile.extrawarn: Move -Wunaligned-access to W=1
ad53060bdf hwmon: (dell-smm) Speed up setting of fan speed
3c75d1017c phy: ti: Fix missing sentinel for clk_div_table
6eabe53492 speakup-dectlk: Restore pitch setting
3836a5ff4b USB: serial: cp210x: add CPI Bulk Coin Recycler id
51b03a9bcd USB: serial: cp210x: add NCR Retail IO box id
a21e6b2e08 USB: serial: ch341: add support for GW Instek USB2.0-Serial devices
7113440a36 USB: serial: option: add ZTE MF286D modem
b7ed2f9619 USB: serial: ftdi_sio: add support for Brainboxes US-159/235/320
e07dde31ac usb: raw-gadget: fix handling of dual-direction-capable endpoints
e9f9b877eb usb: gadget: f_uac2: Define specific wTerminalType
fb4ff0f96d usb: gadget: rndis: check size of RNDIS_MSG_SET command
22ec100472 USB: gadget: validate interface OS descriptor requests
351159167c usb: gadget: udc: renesas_usb3: Fix host to USB_ROLE_NONE transition
3bfca38914 usb: dwc3: gadget: Prevent core from processing stale TRBs
2a17bd9f52 usb: ulpi: Call of_node_put correctly
8b89a69166 usb: ulpi: Move of_node_put to ulpi_dev_release
758290defe net: usb: ax88179_178a: Fix out-of-bounds accesses in RX fixup
a66a2b17b8 Revert "usb: dwc2: drd: fix soft connect when gadget is unconfigured"
73961057e9 usb: dwc2: drd: fix soft connect when gadget is unconfigured
a37960df7e eeprom: ee1004: limit i2c reads to I2C_SMBUS_BLOCK_MAX
1b99fe34e2 n_tty: wake up poll(POLLRDNORM) on receiving data
f1b2573715 vt_ioctl: add array_index_nospec to VT_ACTIVATE
778302ca09 vt_ioctl: fix array_index_nospec in vt_setactivate
22249886dc net: dsa: mv88e6xxx: fix use-after-free in mv88e6xxx_mdios_unregister
3a3c65c487 net: mscc: ocelot: fix mutex lock error during ethtool stats read
809f030745 ice: fix IPIP and SIT TSO offload
cf11949b91 ice: fix an error code in ice_cfg_phy_fec()
f8edc6feab dpaa2-eth: unregister the netdev before disconnecting from the PHY
ff6c9e0fce net: amd-xgbe: disable interrupts during pci removal
657aea7828 tipc: rate limit warning for received illegal binding update
ef5cdae8bc net: mdio: aspeed: Add missing MODULE_DEVICE_TABLE
bf99c14436 veth: fix races around rq->rx_notify_masked
00e6d6c3bc net: fix a memleak when uncloning an skb dst and its metadata
2e9fd2d0f6 net: do not keep the dst cache when uncloning an skb dst and its metadata
0bae953d7a nfp: flower: fix ida_idx not being released
09ac0fcb0a ipmr,ip6mr: acquire RTNL before calling ip[6]mr_free_table() on failure path
e177d2e85e net: dsa: lantiq_gswip: don't use devres for mdiobus
95e5402f94 net: dsa: felix: don't use devres for mdiobus
2770b79529 net: dsa: bcm_sf2: don't use devres for mdiobus
475ce5dcf2 net: dsa: ar9331: register the mdiobus under devres
8ccebe77df net: dsa: mv88e6xxx: don't use devres for mdiobus
4a384c1e40 bonding: pair enable_port with slave_arr_updates
1ba45dd326 gpio: sifive: use the correct register to read output values
48e413087d ACPI: PM: s2idle: Cancel wakeup before dispatching EC GPE
3b72d3f020 drm/panel: simple: Assign data from panel_dpi_probe() correctly
bf35639192 ixgbevf: Require large buffers for build_skb on 82599VF
e5a64f548a arm64: dts: meson-g12b-odroid-n2: fix typo 'dio2133'
04fe6569a7 netfilter: ctnetlink: disable helper autoassign
a5ce7ee5fc misc: fastrpc: avoid double fput() on failed usercopy
21c890ca8e drm/vc4: hdmi: Allow DBLCLK modes even if horz timing is odd.
70ea005626 gpio: aggregator: Fix calling into sleeping GPIO controllers
0042178a69 usb: f_fs: Fix use-after-free for epfile
5a37fd9fdc ARM: dts: imx7ulp: Fix 'assigned-clocks-parents' typo
39bf132a6e phy: xilinx: zynqmp: Fix bus width setting for SGMII
108868dae2 ARM: dts: imx6qdl-udoo: Properly describe the SD card detect
0a7b5e8d8c staging: fbtft: Fix error path in fbtft_driver_module_init()
74cd5cb219 ARM: dts: meson8b: Fix the UART device-tree schema validation
566b558e94 ARM: dts: meson8: Fix the UART device-tree schema validation
210d70f081 ARM: dts: meson: Fix the UART compatible strings
88f0e61354 ARM: dts: Fix timer regression for beagleboard revision c
c943a297ec drm/rockchip: vop: Correct RK3399 VOP register fields
a941384fba PM: s2idle: ACPI: Fix wakeup interrupts handling
fcbac51a64 ACPI/IORT: Check node revision for PMCG resources
57ede0ce65 nvme-tcp: fix bogus request completion when failing to send AER
3a669d77e5 ARM: socfpga: fix missing RESET_CONTROLLER
435e62d566 ARM: dts: Fix boot regression on Skomer
b217b89e60 ARM: dts: imx23-evk: Remove MX23_PAD_SSP1_DETECT from hog group
3f9843f2f6 riscv: fix build with binutils 2.38
3aa5c86572 KVM: VMX: Set vmcs.PENDING_DBG.BS on #DB in STI/MOVSS blocking shadow
bd39fe29bb KVM: SVM: Don't kill SEV guest if SMAP erratum triggers in usermode
9efad4cb03 KVM: nVMX: Also filter MSR_IA32_VMX_TRUE_PINBASED_CTLS when eVMCS
db58a3d978 KVM: nVMX: eVMCS: Filter out VM_EXIT_SAVE_VMX_PREEMPTION_TIMER
dc129275a7 KVM: eventfd: Fix false positive RCU usage warning
87bbd78a2c net: stmmac: dwmac-sun8i: use return val of readl_poll_timeout()
c9b8cc1046 nvme-pci: add the IGNORE_DEV_SUBNQN quirk for Intel P4500/P4600 SSDs
d0774cf730 perf: Always wake the parent event
a117e986e9 usb: dwc2: gadget: don't try to disable ep0 in dwc2_hsotg_suspend
4607218fde PM: hibernate: Remove register_nosave_region_late()
0e42c4a3d7 scsi: myrs: Fix crash in error case
3bc5b128b9 scsi: ufs: Treat link loss as fatal error
12cf120803 scsi: pm8001: Fix bogus FW crash for maxcpus=1
87f187e526 scsi: qedf: Fix refcount issue when LOGO is received during TMF
aa7352aa15 scsi: qedf: Add stag_work to all the vports
150d448c66 scsi: ufs: ufshcd-pltfrm: Check the return value of devm_kstrdup()
7dbda616fc scsi: target: iscsi: Make sure the np under each tpg is unique
67baac10dd powerpc/fixmap: Fix VM debug warning on unmap
3d0eafd459 net: sched: Clarify error message when qdisc kind is unknown
9b569faabd drm: panel-orientation-quirks: Add quirk for the 1Netbook OneXPlayer
0d6b9d15ec x86/perf: Avoid warning for Arch LBR without XSAVE
b37dd03f2f NFSv4 handle port presence in fs_location server string
6f2974b52b NFSv4 expose nfs_parse_server_name function
5a9c613a29 NFSv4 remove zero number of fs_locations entries error check
1c79aad118 NFSv4.1: Fix uninitialised variable in devicenotify
c5619c510f nfs: nfs4clinet: check the return value of kstrdup()
db053bdece NFSv4 only print the label when its queried
e2b4435fd3 NFS: change nfs_access_get_cached to only report the mask
b4e0c9bcf1 tracing: Propagate is_signed to expression
5234de6c79 drm/amdgpu: Set a suitable dev_info.gart_page_size
6215fb4558 NFSD: Fix offset type in I/O trace points
3a6a2d43e3 NFSD: Clamp WRITE offsets
c72f7c2ec3 NFS: Fix initialisation of nfs_client cl_flags field
f47ee3a35f net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs
6a33aa7113 net: phy: marvell: Fix RGMII Tx/Rx delays setting in 88e1121-compatible PHYs
7b53d2204c can: isotp: fix potential CAN frame reception race in isotp_rcv()
c9cc027c55 mmc: sdhci-of-esdhc: Check for error num after setting mask
8027ba480c ima: Do not print policy rule with inactive LSM labels
8171c8a99f ima: Allow template selection with ima_template[_fmt]= after ima_hash=
0795b7100d ima: Remove ima_policy file before directory
7fea2e5200 integrity: check the return value of audit_log_start()
86e6176a42 Merge 5.10.100 into android12-5.10-lts
d4f7d322a4 Linux 5.10.100
3c7e594355 tipc: improve size validations for received domain records
2951d21689 crypto: api - Move cryptomgr soft dependency into algapi
b62267b8b0 KVM: s390: Return error on SIDA memop on normal guest
be93028d30 moxart: fix potential use-after-free on remove path
ca562bf79c Merge branch 'android12-5.10' into `android12-5.10-lts`
c3b53fcd90 Merge 5.10.99 into android12-5.10-lts
fb063a6465 Linux 5.10.99
4889d6ee9e selftests: nft_concat_range: add test for reload with no element add/del
5577273135 cgroup/cpuset: Fix "suspicious RCU usage" lockdep warning
f1f7d1a22f net: dsa: mt7530: make NET_DSA_MT7530 select MEDIATEK_GE_PHY
84b76a509c ext4: fix incorrect type issue during replay_del_range
62e46e0ffc ext4: fix error handling in ext4_fc_record_modified_inode()
764793b4a5 ext4: fix error handling in ext4_restore_inline_data()
6c5bd55e36 ext4: modify the logic of ext4_mb_new_blocks_simple
8d71fc23fc ext4: prevent used blocks from being allocated during fast commit replay
ef2053afd7 EDAC/xgene: Fix deferred probing
2a12faf55b EDAC/altera: Fix deferred probing
dd274cf852 x86/perf: Default set FREEZE_ON_SMI for all
456f041e03 perf/x86/intel/pt: Fix crash with stop filters in single-range mode
8c0e6a8a63 perf stat: Fix display of grouped aliased events
57e8859acc fbcon: Add option to enable legacy hardware acceleration
460f6b1a23 Revert "fbcon: Disable accelerated scrolling"
460aa9d873 rtc: cmos: Evaluate century appropriate
2324f5fcdf tools/resolve_btfids: Do not print any commands when building silently
1536fafa23 selftests: futex: Use variable MAKE instead of make
8f0fff8b59 selftests/exec: Remove pipe from TEST_GEN_FILES
6304a613a9 bpf: Use VM_MAP instead of VM_ALLOC for ringbuf
f744a06404 gve: fix the wrong AdminQ buffer queue index check
51e88e8922 nfsd: nfsd4_setclientid_confirm mistakenly expires confirmed client.
ec4334152d scsi: bnx2fc: Make bnx2fc_recv_frame() mp safe
fd482f2d63 pinctrl: bcm2835: Fix a few error paths
752d9eafc6 pinctrl: intel: fix unexpected interrupt
14bc9978b4 pinctrl: intel: Fix a glitch when updating IRQ flags on a preconfigured line
5a45448ac9 ASoC: max9759: fix underflow in speaker_gain_control_put()
02f4597198 ASoC: cpcap: Check for NULL pointer after calling of_get_child_by_name
cb5f1fbd1f ASoC: xilinx: xlnx_formatter_pcm: Make buffer bytes multiple of period bytes
56e0747d59 ASoC: fsl: Add missing error handling in pcm030_fabric_probe
3e69837551 drm/i915/overlay: Prevent divide by zero bugs in scaling
9ea0185361 net: stmmac: ensure PTP time register reads are consistent
41df2da2c1 net: stmmac: dump gmac4 DMA registers correctly
114bf93504 net: macsec: Verify that send_sci is on when setting Tx sci explicitly
2e7f5b6ee1 net: macsec: Fix offload support for NETDEV_UNREGISTER event
87b1c9fab6 net: ieee802154: Return meaningful error codes from the netlink helpers
78b3f20c17 net: ieee802154: ca8210: Stop leaking skb's
0bfe50dc5d net: ieee802154: mcr20a: Fix lifs/sifs periods
75bbda3189 net: ieee802154: hwsim: Ensure proper channel selection at probe time
e895e067d7 spi: uniphier: fix reference count leak in uniphier_spi_probe()
ec942d08e0 spi: meson-spicc: add IRQ check in meson_spicc_probe
c2cf65e100 spi: mediatek: Avoid NULL pointer crash in interrupt
30e05c98b9 spi: bcm-qspi: check for valid cs before applying chip select
6d226e8afe iommu/amd: Fix loop timeout issue in iommu_ga_log_enable()
9d9995b037 iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping()
b3958d3151 RDMA/mlx4: Don't continue event handler after memory allocation failure
d3f8b927df RDMA/siw: Fix broken RDMA Read Fence/Resume logic.
c7db20f5be IB/rdmavt: Validate remote_addr during loopback atomic tests
75c610212b RDMA/ucma: Protect mc during concurrent multicast leaves
371979069a RDMA/cma: Use correct address when leaving multicast group
aa4ecd995f memcg: charge fs_context and legacy_fs_context
080f371d98 Revert "ASoC: mediatek: Check for error clk pointer"
4a9bd1e678 IB/hfi1: Fix AIP early init panic
5d40f1bdad dma-buf: heaps: Fix potential spectre v1 gadget
30de3bc099 block: bio-integrity: Advance seed correctly for larger interval sizes
352715593e mm/kmemleak: avoid scanning potential huge holes
7053188ddb mm/pgtable: define pte_index so that preprocessor could recognize it
bce7f5d74d mm/debug_vm_pgtable: remove pte entry from the page table
2d83a7463d nvme-fabrics: fix state check in nvmf_ctlr_matches_baseopts()
a0c73dbdd1 drm/amd/display: Force link_rate as LINK_RATE_RBR2 for 2018 15" Apple Retina panels
f071d9fa85 drm/nouveau: fix off by one in BIOS boundary checking
32747e0143 btrfs: fix deadlock between quota disable and qgroup rescan worker
aa5d406153 ALSA: hda/realtek: Fix silent output on Gigabyte X570 Aorus Xtreme after reboot from Windows
d4aa3a9859 ALSA: hda/realtek: Fix silent output on Gigabyte X570S Aorus Master (newer chipset)
3a8a8072e3 ALSA: hda/realtek: Add missing fixup-model entry for Gigabyte X570 ALC1220 quirks
532cde962f ALSA: hda/realtek: Add quirk for ASUS GU603
410f231fd7 ALSA: hda: realtek: Fix race at concurrent COEF updates
a7de100213 ALSA: hda: Fix UAF of leds class devs at unbinding
470bbb9cbd ALSA: usb-audio: Correct quirk for VF0770
6877f87579 ASoC: ops: Reject out of bounds values in snd_soc_put_xr_sx()
038f8b7caa ASoC: ops: Reject out of bounds values in snd_soc_put_volsw_sx()
a9394f21fb ASoC: ops: Reject out of bounds values in snd_soc_put_volsw()
0ff6b80506 audit: improve audit queue handling when "audit=1" on cmdline
f446089a26 selinux: fix double free of cond_list on error paths
08942dae64 Merge 5.10.98 into android-5.10
26d02dc8ef Merge 5.10.97 into android12-5.10-lts
e33a5b611c Revert "perf: Fix perf_event_read_local() time"
0b4470b56e Merge 5.10.96 into android12-5.10-lts
12a0a56cba Linux 5.10.98
97a47e2555 Revert "drm/vc4: hdmi: Make sure the device is powered with CEC" again
e27042060f Revert "drm/vc4: hdmi: Make sure the device is powered with CEC"
c8ed22bd97 Linux 5.10.97
176356550c tcp: add missing tcp_skb_can_collapse() test in tcp_shift_skb_data()
32e1799710 af_packet: fix data-race in packet_setsockopt / packet_setsockopt
aa9e96db31 cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask()
3bbe2019dd rtnetlink: make sure to refresh master_dev/m_ops in __rtnl_newlink()
e7be569263 net: sched: fix use-after-free in tc_new_tfilter()
7b4741644c fanotify: Fix stale file descriptor in copy_event_to_user()
4d3fcfe846 net: amd-xgbe: Fix skb data length underflow
cadfa7dce5 net: amd-xgbe: ensure to reset the tx_timer_active flag
77534b114f ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback
b4ced7a46d net/mlx5: E-Switch, Fix uninitialized variable modact
502c37b033 net/mlx5: Use del_timer_sync in fw reset flow of halting poll
a01ee1b816 net/mlx5e: Fix handling of wrong devices during bond netevent
1fc3444cda cgroup-v1: Require capabilities to set release_agent
ac4ba79bb0 drm/vc4: hdmi: Make sure the device is powered with CEC
46f919c6bd x86/cpu: Add Xeon Icelake-D to list of CPUs that support PPIN
fbdbf6743f x86/mce: Add Xeon Sapphire Rapids to list of CPUs that support PPIN
d4e4e61d4a psi: Fix uaf issue when psi trigger is destroyed while being polled
080dbe7e9b KVM: x86: Forcibly leave nested virt when SMM state is toggled
063029a882 Revert "drivers: bus: simple-pm-bus: Add support for probing simple bus only devices"
42fdbf8b7d net: ipa: prevent concurrent replenish
ad81380d3a net: ipa: use a bitmap for endpoint replenish_enabled
2ed912e3e0 net: ipa: fix atomic update in ipa_endpoint_replenish()
3b4c966fb1 PCI: pciehp: Fix infinite loop in IRQ handler upon power fault
a9839858b5 Merge 5.10.95 into android12-5.10-lts
f255ac9e87 Linux 5.10.96
b43e9d2f6f mtd: rawnand: mpc5121: Remove unused variable in ads5121_select_chip()
b63e120189 block: Fix wrong offset in bio_truncate()
0b4e82403c fsnotify: invalidate dcache before IN_DELETE event
8bae6db29c usr/include/Makefile: add linux/nfc.h to the compile-test coverage
f36554de78 dt-bindings: can: tcan4x5x: fix mram-cfg RX FIFO config
446ff1fc37 net: bridge: vlan: fix memory leak in __allowed_ingress
bc58a5bb9e ipv4: remove sparse error in ip_neigh_gw4()
ebc5b8e471 ipv4: tcp: send zero IPID in SYNACK messages
58f72918f9 ipv4: raw: lock the socket in raw_bind()
9ffc94a81b net: bridge: vlan: fix single net device option dumping
869f1704f1 Revert "ipv6: Honor all IPv6 PIO Valid Lifetime values"
699eef4ed9 net: hns3: handle empty unknown interrupt for VF
c9c81b393c net: cpsw: Properly initialise struct page_pool_params
729e54636b yam: fix a memory leak in yam_siocdevprivate()
93a6e920d8 drm/msm/dpu: invalid parameter check in dpu_setup_dspp_pcc
0b7d8db87d drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy
d1d4616d3e video: hyperv_fb: Fix validation of screen resolution
0a60d04abc ibmvnic: don't spin in tasklet
55258b5059 ibmvnic: init ->running_cap_crqs early
b469cf91fb ipv4: fix ip option filtering for locally generated fragments
9b44441972 net: ipv4: Fix the warning for dereference
2f56c4845d net: ipv4: Move ip_options_fragment() out of loop
55402a4618 powerpc/perf: Fix power_pmu_disable to call clear_pmi_irq_pending only if PMI is pending
0bdbf93ee2 hwmon: (lm90) Mark alert as broken for MAX6654
c534287a57 efi/libstub: arm64: Fix image check alignment at entry
3572205b19 rxrpc: Adjust retransmission backoff
5067f5699d octeontx2-pf: Forward error codes to VF
bd024e36f6 phylib: fix potential use-after-free
a839a79f4d net: phy: broadcom: hook up soft_reset for BCM54616S
57b2f3632b sched/pelt: Relax the sync of util_sum with util_avg
91b04e83c7 perf: Fix perf_event_read_local() time
cffed7e631 kernel: delete repeated words in comments
1af995c98b netfilter: conntrack: don't increment invalid counter on NF_REPEAT
129c71829d powerpc64/bpf: Limit 'ldbrx' to processors compliant with ISA v2.06
7a32824f7a NFS: Ensure the server has an up to date ctime before renaming
666f6ab882 NFS: Ensure the server has an up to date ctime before hardlinking
4cd0ef6215 ipv6: annotate accesses to fn->fn_sernum
79c0b5287d drm/msm/dsi: invalid parameter check in msm_dsi_phy_enable
3ab44a408b drm/msm/dsi: Fix missing put_device() call in dsi_get_phy
82c310d04b drm/msm: Fix wrong size calculation
f57a99c9a5 net-procfs: show net devices bound packet types
87880e3803 NFSv4: nfs_atomic_open() can race when looking up a non-regular file
ce8c552b88 NFSv4: Handle case where the lookup of a directory fails
b48a05cee2 hwmon: (lm90) Reduce maximum conversion rate for G781
b26fed25e6 ipv4: avoid using shared IP generator for connected sockets
283aa5a5af ping: fix the sk_bound_dev_if match in ping_lookup
7bcb0c19ab hwmon: (lm90) Mark alert as broken for MAX6680
925cbd596a hwmon: (lm90) Mark alert as broken for MAX6646/6647/6649
db044d9746 net: fix information leakage in /proc/net/ptype
feb770cc00 ipv6_tunnel: Rate limit warning messages
00849de10f scsi: bnx2fc: Flush destroy_work queue before calling bnx2fc_interface_put()
fcaf94c49a rpmsg: char: Fix race between the release of rpmsg_eptdev and cdev
1dbb206730 rpmsg: char: Fix race between the release of rpmsg_ctrldev and cdev
20f6675821 usb: roles: fix include/linux/usb/role.h compile issue
6aeff8a7c7 i40e: fix unsigned stat widths
d2ed5997a9 i40e: Fix for failed to init adminq while VF reset
768eb705e6 i40e: Fix queues reservation for XDP
39896710f7 i40e: Fix issue when maximum queues is exceeded
9068bcb219 i40e: Increase delay to 1 s after global EMP reset
b4c9b6afa3 powerpc/32: Fix boot failure with GCC latent entropy plugin
50f5d0a8bd powerpc/32s: Fix kasan_init_region() for KASAN
5d3af1dfdf powerpc/32s: Allocate one 256k IBAT instead of two consecutives 128k IBATs
08f090bb9b x86/MCE/AMD: Allow thresholding interface updates after init
791e5d5daa sched/membarrier: Fix membarrier-rseq fence command missing from query bitmask
afbde455eb ocfs2: fix a deadlock when commit trans
97f75e7d4c jbd2: export jbd2_journal_[grab|put]_journal_head
3921d081c9 ucsi_ccg: Check DEV_INT bit only when starting CCG4
598a884c77 usb: typec: tcpm: Do not disconnect while receiving VBUS off
e3b131e30e USB: core: Fix hang in usb_kill_urb by adding memory barriers
3ca928c824 usb: gadget: f_sourcesink: Fix isoc transfer for USB_SPEED_SUPER_PLUS
053274bc6b usb: common: ulpi: Fix crash in ulpi_match()
20c51a4c52 usb: xhci-plat: fix crash when suspend if remote wake enable
38d1bf67a3 usb-storage: Add unusual-devs entry for VL817 USB-SATA bridge
e0fcae7bd7 tty: Add support for Brainboxes UC cards.
7079283d32 tty: n_gsm: fix SW flow control encoding/handling
2683b0d5d7 serial: stm32: fix software flow control transfer
4628b26df5 serial: 8250: of: Fix mapped region size when using reg-offset property
94b23988c3 netfilter: nft_payload: do not update layer 4 checksum when mangling fragments
bf0d4ae5c6 arm64: errata: Fix exec handling in erratum 1418040 workaround
e92cac1dd8 KVM: x86: Update vCPU's runtime CPUID on write to MSR_IA32_XSS
6b55af102b drm/etnaviv: relax submit size limits
7a32d17fb7 perf/x86/intel/uncore: Fix CAS_COUNT_WRITE issue for ICX
a2c8e1d9e4 Revert "KVM: SVM: avoid infinite loop on NPF from bad address"
abae88fb37 fsnotify: fix fsnotify hooks in pseudo filesystems
6ceac38e9b ceph: set pool_ns in new inode layout for async creates
e7be12ca7d ceph: properly put ceph_string reference after async create attempt
39986696fe tracing: Don't inc err_log entry count if entry allocation fails
d71b06aa99 tracing/histogram: Fix a potential memory leak for kstrdup()
561a22d44a PM: wakeup: simplify the output logic of pm_show_wakelocks()
b0f1cc093b efi: runtime: avoid EFIv2 runtime services on Apple x86 machines
de7cc8bcca udf: Fix NULL ptr deref when converting from inline format
0a3cfd2589 udf: Restore i_lenAlloc when inode expansion fails
f08801252d scsi: zfcp: Fix failed recovery on gone remote port with non-NPIV FCP devices
ff6bdc205f bpf: Guard against accessing NULL pt_regs in bpf_get_task_stack()
6520fedfce s390/hypfs: include z/VM guests with access control group set
c10e0627c7 s390/module: fix loading modules with a lot of relocations
ba7c71a777 net: stmmac: skip only stmmac_ptp_register when resume from suspend
11191406f2 net: sfp: ignore disabled SFP node
e651772adc media: venus: core: Drop second v4l2 device unregister
83d5196b65 Bluetooth: refactor malicious adv data check
34fd8cb7e7 ANDROID: Fix CRC issue up with xfrm headers in 5.10.94
a50b069165 Revert "xfrm: rate limit SA mapping change message to user space"
67ea95e0e8 Revert "clocksource: Reduce clocksource-skew threshold"
fae0741a78 Revert "clocksource: Avoid accidental unstable marking of clocksources"
77656fde3c Linux 5.10.95
ae2b20f277 drm/vmwgfx: Fix stale file descriptors on failed usercopy
11ba2c6dfb select: Fix indefinitely sleeping task in poll_schedule_timeout()
a447d7f786 KVM: x86/mmu: Fix write-protection of PTs mapped by the TDP MMU
12d3389b7a rcu: Tighten rcu_advance_cbs_nowake() checks
4d63363c88 bnx2x: Invalidate fastpath HSI version for VFs
fdcfabd095 bnx2x: Utilize firmware 7.13.21.0
6a6acf9278 drm/i915: Flush TLBs before releasing backing store
4ec3c2eea5 Merge 5.10.94 into android12-5.10-lts
c525532e4f Linux 5.10.94
c76c132444 scripts: sphinx-pre-install: Fix ctex support on Debian
133cef0b61 scripts: sphinx-pre-install: add required ctex dependency
15ce9329a5 ath10k: Fix the MTU size on QCA9377 SDIO
25b1a6d330 mtd: nand: bbt: Fix corner case in bad block table handling
8104e589fa lib/test_meminit: destroy cache in kmem_cache_alloc_bulk() test
6292503700 mm/hmm.c: allow VM_MIXEDMAP to work with hmm_range_fault
33bb7f027b lib82596: Fix IRQ check in sni_82596_probe
078b5a4498 scripts/dtc: dtx_diff: remove broken example from help text
21513c4615 dt-bindings: watchdog: Require samsung,syscon-phandle for Exynos7
23bcf3615b dt-bindings: display: meson-vpu: Add missing amlogic,canvas property
66467cc87a dt-bindings: display: meson-dw-hdmi: add missing sound-name-prefix property
4496e4a427 net: mscc: ocelot: fix using match before it is set
ee64479c9c net: sfp: fix high power modules without diagnostic monitoring
819e76bc57 net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config()
4691c9f047 bcmgenet: add WOL IRQ check
6973b38b9d net_sched: restore "mpu xxx" handling
20949c3816 net: bonding: fix bond_xmit_broadcast return value error bug
799730d182 arm64: dts: qcom: msm8996: drop not documented adreno properties
f6d4c0e017 devlink: Remove misleading internal_flags from health reporter dump
2e51a761b7 perf probe: Fix ppc64 'perf probe add events failed' case
59b44f7760 dmaengine: at_xdmac: Fix at_xdmac_lld struct definition
0078f05371 dmaengine: at_xdmac: Fix lld view setting
7ab120636d dmaengine: at_xdmac: Fix concurrency over xfers_list
b5b27c5e33 dmaengine: at_xdmac: Print debug message after realeasing the lock
c536b351a7 dmaengine: at_xdmac: Start transfer for cyclic channels in issue_pending
cd22e22e8e dmaengine: at_xdmac: Don't start transactions at tx_submit level
68a83051c8 perf script: Fix hex dump character output
7b9d40e9f6 libcxgb: Don't accidentally set RTO_ONLINK in cxgb_find_route()
cd5c24d223 gre: Don't accidentally set RTO_ONLINK in gre_fill_metadata_dst()
7f2ca96bd2 xfrm: Don't accidentally set RTO_ONLINK in decode_session4()
2b1415c60b netns: add schedule point in ops_exit_list()
edc09548ff inet: frags: annotate races around fqdir->dead and fqdir->high_thresh
69e7e979ed taskstats: Cleanup the use of task->exit_code
56daa21414 virtio_ring: mark ring unused on error
0c4ebcb00d vdpa/mlx5: Fix wrong configuration of virtio_version_1_0
c736ec01a2 rtc: pxa: fix null pointer dereference
8b8ff4c793 HID: vivaldi: fix handling devices not using numbered reports
d7544cf693 net: axienet: increase default TX ring size to 128
557829d42d net: axienet: fix for TX busy handling
41831d4967 net: axienet: fix number of TX ring slots for available check
6301f3566a net: axienet: Fix TX ring slot available check
7a3d3d7f6d net: axienet: limit minimum TX ring size
2f548489d6 net: axienet: add missing memory barriers
bcc5d57e60 net: axienet: reset core on initialization prior to MDIO access
46c0ccaff2 net: axienet: Wait for PhyRstCmplt after core reset
34942a228a net: axienet: increase reset timeout
a66b9bccf7 net/smc: Fix hung_task when removing SMC-R devices
51b52cf354 clk: si5341: Fix clock HW provider cleanup
fe40f7aef3 clk: Emit a stern warning with writable debugfs enabled
38221afa03 af_unix: annote lockless accesses to unix_tot_inflight & gc_in_progress
a49e402f23 f2fs: fix to reserve space for IO align feature
39ad058117 f2fs: compress: fix potential deadlock of compress file
e1840365ed parisc: pdc_stable: Fix memory leak in pdcs_register_pathentries
d806eb5f4e net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module
38c798384b net/fsl: xgmac_mdio: Add workaround for erratum A-009885
734f4b0f83 ipv4: avoid quadratic behavior in netns dismantle
86f0587f74 ipv4: update fib_info_cnt under spinlock protection
10e99ae9b5 perf evsel: Override attr->sample_period for non-libpfm4 events
58fa3e9002 xdp: check prog type before updating BPF link
38ee417f59 bpftool: Remove inclusion of utilities.mak from Makefiles
2bcab471a2 block: Fix fsync always failed if once failed
5e59f88535 powerpc/fsl/dts: Enable WA for erratum A-009885 on fman3l MDIO buses
19aaef6519 powerpc/cell: Fix clang -Wimplicit-fallthrough warning
4cb7aba1e0 Revert "net/mlx5: Add retry mechanism to the command entry index allocation"
78cf5f63a3 dmaengine: stm32-mdma: fix STM32_MDMA_CTBR_TSEL_MASK
16ad0aa917 RDMA/rxe: Fix a typo in opcode name
885860717c RDMA/hns: Modify the mapping attribute of doorbell to device
57cd8597c3 dmaengine: uniphier-xdmac: Fix type of address variables
4fe77b7cd2 scsi: core: Show SCMD_LAST in text form
b30240911d Bluetooth: hci_sync: Fix not setting adv set duration
55698d11c8 Documentation: fix firewire.rst ABI file path error
5d38cbf66d Documentation: refer to config RANDOMIZE_BASE for kernel address-space randomization
abecf9d748 Documentation: ACPI: Fix data node reference documentation
d1e85fcd73 Documentation: dmaengine: Correctly describe dmatest with channel unset
f6736bd81d media: correct MEDIA_TEST_SUPPORT help text
55b10b88ac drm/vc4: hdmi: Make sure the device is powered with CEC
81ac08a800 media: rcar-csi2: Optimize the selection PHTW register
0baa3729d2 can: mcp251xfd: mcp251xfd_tef_obj_read(): fix typo in error message
f62bf6ee4f firmware: Update Kconfig help text for Google firmware
12224c0d19 of: base: Improve argument length mismatch error
7bb99c7e13 drm/radeon: fix error handling in radeon_driver_open_kms
0ca7ec6db2 ext4: don't use the orphan list when migrating an inode
679fb06532 ext4: fix null-ptr-deref in '__ext4_journal_ensure_credits'
d60e9daba2 ext4: destroy ext4_fc_dentry_cachep kmemcache on module removal
f26b24b4c1 ext4: fast commit may miss tracking unwritten range during ftruncate
04b5627306 ext4: use ext4_ext_remove_space() for fast commit replay delete range
53998b3f6d ext4: Fix BUG_ON in ext4_bread when write quota data
da364ab358 ext4: set csum seed in tmp inode while migrating to extents
e4221629d5 ext4: fix fast commit may miss tracking range for FALLOC_FL_ZERO_RANGE
720508dd11 ext4: initialize err_blk before calling __ext4_get_inode_loc
f9ed0ea0a9 ext4: fix a possible ABBA deadlock due to busy PA
115b762b48 ext4: make sure quota gets properly shutdown on error
762e4c33e9 ext4: make sure to reset inode lockdep class when quota enabling fails
f8c3ec2e21 btrfs: respect the max size in the header when activating swap file
e7764bccae btrfs: check the root node for uptodate before returning it
09e0ef287e btrfs: fix deadlock between quota enable and other quota operations
56f974d583 xfrm: fix policy lookup for ipv6 gre packets
84166c1177 PCI: pci-bridge-emul: Set PCI_STATUS_CAP_LIST for PCIe device
7aeeb9fe9c PCI: pci-bridge-emul: Correctly set PCIe capabilities
af1d0acdac PCI: pci-bridge-emul: Fix definitions of reserved bits
0f2ae6691e PCI: pci-bridge-emul: Properly mark reserved PCIe bits in PCI config space
2a0d437d8a PCI: pci-bridge-emul: Make expansion ROM Base Address register read-only
def2825b09 PCI: pciehp: Use down_read/write_nested(reset_lock) to fix lockdep errors
6cbe8f8deb PCI: xgene: Fix IB window setup
e09f47e77b powerpc/64s/radix: Fix huge vmap false positive
eb44b1386a parisc: Fix lpa and lpa_user defines
9b78ee2341 drm/bridge: analogix_dp: Make PSR-exit block less
8cbbf4a6f1 drm/nouveau/kms/nv04: use vzalloc for nv04_display
605583fccc drm/etnaviv: limit submit sizes
6c1e3d8b1b device property: Fix fwnode_graph_devcon_match() fwnode leak
ecb71f7bd5 s390/mm: fix 2KB pgtable release race
798754ba48 iwlwifi: mvm: Increase the scan timeout guard to 30 seconds
c524f4cfb3 tracing/kprobes: 'nmissed' not showed correctly for kretprobe
b72075e395 cputime, cpuacct: Include guest time in user time in cpuacct.stat
13518f058f serial: Fix incorrect rs485 polarity on uart open
9668cf9e4a fuse: Pass correct lend value to filemap_write_and_wait_range()
9fbaddd783 xen/gntdev: fix unmap notification order
67b078d996 spi: uniphier: Fix a bug that doesn't point to private data correctly
05026c4e94 tpm: fix NPE on probe for missing device
76006d33f1 ubifs: Error path in ubifs_remount_rw() seems to wrongly free write buffers
4f0762ac32 crypto: caam - replace this_cpu_ptr with raw_cpu_ptr
9e6ff2d572 crypto: stm32/crc32 - Fix kernel BUG triggered in probe()
2031e0246e crypto: omap-aes - Fix broken pm_runtime_and_get() usage
43e94431c3 rpmsg: core: Clean up resources on announce_create failure.
082ff9e12b phy: mediatek: Fix missing check in mtk_mipi_tx_probe
ff08cf1e34 ASoC: mediatek: mt8183: fix device_node leak
f28672eef4 ASoC: mediatek: mt8173: fix device_node leak
0df5104008 scsi: sr: Don't use GFP_DMA
de9a936b04 MIPS: Octeon: Fix build errors using clang
da7df943e2 i2c: designware-pci: Fix to change data types of hcnt and lcnt parameters
f09f7ccb28 irqchip/gic-v4: Disable redistributors' view of the VPE table at boot time
bc2d961d82 MIPS: OCTEON: add put_device() after of_find_device_by_node()
ce34b03a71 udf: Fix error handling in udf_new_inode()
15be042e7f powerpc/fadump: Fix inaccurate CPU state info in vmcore generated with panic
f2e658d9bd powerpc: handle kdump appropriately with crash_kexec_post_notifiers option
044164b419 selftests/powerpc/spectre_v2: Return skip code when miss_percent is high
21125e0116 powerpc/40x: Map 32Mbytes of memory at startup
c330442f46 MIPS: Loongson64: Use three arguments for slti
af8d077350 ALSA: seq: Set upper limit of processed events
297210783a scsi: lpfc: Trigger SLI4 firmware dump before doing driver cleanup
dfde7afed7 dm: fix alloc_dax error handling in alloc_dev
2e2086f49e nvmem: core: set size for sysfs bin file
4a273a94bd w1: Misuse of get_user()/put_user() reported by sparse
87e91d6c6a KVM: PPC: Book3S: Suppress failed alloc warning in H_COPY_TOFROM_GUEST
23bb3f01ce KVM: PPC: Book3S: Suppress warnings when allocating too big memory slots
03c1595a18 powerpc/powermac: Add missing lockdep_register_key()
df29c01b9f clk: meson: gxbb: Fix the SDM_EN bit for MPLL0 on GXBB
30d35a1abd i2c: mpc: Correct I2C reset procedure
4b25aad655 powerpc/smp: Move setup_profiling_timer() under CONFIG_PROFILING
25714ad6bf i2c: i801: Don't silently correct invalid transfer size
75e2cfa5fa powerpc/watchdog: Fix missed watchdog reset due to memory ordering race
a83639521a powerpc/btext: add missing of_node_put
fc10d8f00a powerpc/cell: add missing of_node_put
297ff7d5f1 powerpc/powernv: add missing of_node_put
c83ba875d7 powerpc/6xx: add missing of_node_put
d240b08d8a x86/kbuild: Enable CONFIG_KALLSYMS_ALL=y in the defconfigs
3681e9f3f0 parisc: Avoid calling faulthandler_disabled() twice
f2a27dd7a2 random: do not throw away excess input to crng_fast_load
f8fdebfb4b serial: core: Keep mctrl register state and cached copy in sync
a03fd1b198 serial: pl010: Drop CR register reset on set_termios
40ac338926 regulator: qcom_smd: Align probe function with rpmh-regulator
3dc751213f net: gemini: allow any RGMII interface mode
1063de8975 net: phy: marvell: configure RGMII delays for 88E1118
00580670b9 mlxsw: pci: Avoid flow control for EMAD packets
eaf8cffcf5 dm space map common: add bounds check to sm_ll_lookup_bitmap()
5850bef8e9 dm btree: add a defensive bounds check to insert_at()
754b663ea9 mac80211: allow non-standard VHT MCS-10/11
e8da60b3a6 net: mdio: Demote probed message to debug print
6b22c9824d btrfs: remove BUG_ON(!eie) in find_parent_nodes
623c65bc73 btrfs: remove BUG_ON() in find_parent_nodes()
44cbd2a16a ACPI: battery: Add the ThinkPad "Not Charging" quirk
7b6dc07c6e amdgpu/pm: Make sysfs pm attributes as read-only for VFs
516e332d6f drm/amdgpu: fixup bad vram size on gmc v8
ee88ff140d ACPICA: Hardware: Do not flush CPU cache when entering S4 and S5
8544074762 ACPICA: Fix wrong interpretation of PCC address
e70be17696 ACPICA: Executer: Fix the REFCLASS_REFOF case in acpi_ex_opcode_1A_0T_1R()
8ea9216d20 ACPICA: Utilities: Avoid deleting the same object twice in a row
fcfd8282c5 ACPICA: actypes.h: Expand the ACPI_ACCESS_ definitions
e3a51d6c90 jffs2: GC deadlock reading a page that is used in jffs2_write_begin()
e35cb5b122 drm/etnaviv: consider completed fence seqno in hang check
a0b13335a3 xfrm: rate limit SA mapping change message to user space
0b7beb2fea Bluetooth: vhci: Set HCI_QUIRK_VALID_LE_STATES
6ac117edac ath11k: Fix napi related hang
756a7188b2 um: registers: Rename function names to avoid conflicts and build problems
d817d10f7a iwlwifi: pcie: make sure prph_info is set when treating wakeup IRQ
f266e1c5bf iwlwifi: mvm: Fix calculation of frame length
6e44b60054 iwlwifi: remove module loading failure message
febab6b60d iwlwifi: fix leaks/bad data after failed firmware load
81d2e96aba PM: AVS: qcom-cpr: Use div64_ul instead of do_div
c0a1d844e3 rtw88: 8822c: update rx settings to prevent potential hw deadlock
3ef25f3122 ath9k: Fix out-of-bound memcpy in ath9k_hif_usb_rx_stream
e10de31055 usb: hub: Add delay for SuperSpeed hub resume to let links transit to U0
282286c632 cpufreq: Fix initialization of min and max frequency QoS requests
37b25de3af PM: runtime: Add safety net to supplier device release
5dfc6fa0b8 arm64: tegra: Adjust length of CCPLEX cluster MMIO region
b68c56a149 arm64: dts: ls1028a-qds: move rtc node to the correct i2c bus
b6f7f0ad5a audit: ensure userspace is penalized the same as the kernel when under pressure
5d54ed1550 mmc: core: Fixup storing of OCR for MMC_QUIRK_NONSTD_SDIO
51a5156bb7 media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach()
f6bc6b178c media: igorplugusb: receiver overflow should be reported
d698e024be HID: quirks: Allow inverting the absolute X/Y values
59f0363346 bpf: Do not WARN in bpf_warn_invalid_xdp_action()
0e8805f73b net: bonding: debug: avoid printing debug logs when bond is not notifying peers
8c72de32ff x86/mce: Mark mce_read_aux() noinstr
1ad3e60f1f x86/mce: Mark mce_end() noinstr
f21ca973b4 x86/mce: Mark mce_panic() noinstr
de360d9443 x86/mce: Allow instrumentation during task work queueing
af371e0abb ath11k: Avoid false DEADLOCK warning reported by lockdep
aec69e2f33 selftests/ftrace: make kprobe profile testcase description unique
07ecabf15a gpio: aspeed: Convert aspeed_gpio.lock to raw_spinlock
7e09f9d15e net: phy: prefer 1000baseT over 1000baseKX
443133330a net-sysfs: update the queue counts in the unregistration path
58b4c1ce83 ath10k: Fix tx hanging
fcba0bce33 ath11k: avoid deadlock by change ieee80211_queue_work for regd_update_work
93a108d466 iwlwifi: mvm: avoid clearing a just saved session protection id
ec01e0fe21 iwlwifi: mvm: synchronize with FW after multicast commands
c1976a4248 thunderbolt: Runtime PM activate both ends of the device link
830e5d1b43 media: m920x: don't use stack on USB reads
c33f0f22bf media: saa7146: hexium_orion: Fix a NULL pointer dereference in hexium_attach()
526b6c9b45 media: rcar-vin: Update format alignment constraints
74e60c1dce media: uvcvideo: Increase UVC_CTRL_CONTROL_TIMEOUT to 5 seconds.
d0e3ab637d drm: rcar-du: Fix CRTC timings when CMM is used
e61aa46d0f x86/mm: Flush global TLB when switching to trampoline page-table
0946fdd929 floppy: Add max size check for user space request
409d45bcd3 usb: uhci: add aspeed ast2600 uhci support
d0aec428c0 arm64: dts: ti: j7200-main: Fix 'dtbs_check' serdes_ln_ctrl node
fcb45ac39f ACPI / x86: Add not-present quirk for the PCI0.SDHB.BRC1 device on the GPD win
b8b2e74a87 ACPI / x86: Allow specifying acpi_device_override_status() quirks by path
cda755506d ACPI: Change acpi_device_always_present() into acpi_device_override_status()
b029625063 ACPI / x86: Drop PWM2 device on Lenovo Yoga Book from always present table
cf3b1a160d media: venus: avoid calling core_clk_setrate() concurrently during concurrent video sessions
adbe148672 ath11k: Avoid NULL ptr access during mgmt tx cleanup
ab523ea096 rsi: Fix out-of-bounds read in rsi_read_pkt()
7525876750 rsi: Fix use-after-free in rsi_rx_done_handler()
6036500fdf mwifiex: Fix skb_over_panic in mwifiex_usb_recv()
8a6371d84c crypto: jitter - consider 32 LSB for APT
240cf5d3cb HSI: core: Fix return freed object in hsi_new_client
f4295b7dca gpiolib: acpi: Do not set the IRQ type if the IRQ is already in use
f0653cd4da tty: serial: imx: disable UCR4_OREN in .stop_rx() instead of .shutdown()
b8d10f601f drm/bridge: megachips: Ensure both bridges are probed before registration
43fc9e267e mlxsw: pci: Add shutdown method in PCI driver
b2e921fa92 soc: ti: pruss: fix referenced node in error message
07fbbc4dc7 drm/amdgpu/display: set vblank_disable_immediate for DC
019fe9723a drm/amd/display: check top_pipe_to_program pointer
3c3c0b6c4a ARM: imx: rename DEBUG_IMX21_IMX27_UART to DEBUG_IMX27_UART
f54d8cd831 EDAC/synopsys: Use the quirk for version instead of ddr version
0b85d73fdb media: b2c2: Add missing check in flexcop_pci_isr:
c978d39a8b HID: apple: Do not reset quirks when the Fn key is not found
2df002e327 drm: panel-orientation-quirks: Add quirk for the Lenovo Yoga Book X91F/L
5aa57672c6 usb: gadget: f_fs: Use stream_open() for endpoint files
129e8faaee ath11k: Fix crash caused by uninitialized TX ring
e8b271f2aa media: atomisp: handle errors at sh_css_create_isp_params()
ebe9c978d9 batman-adv: allow netlink usage in unprivileged containers
ff452db961 ARM: shmobile: rcar-gen2: Add missing of_node_put()
ff2138d6c2 media: atomisp-ov2680: Fix ov2680_set_fmt() clobbering the exposure
51ef6582a2 media: atomisp: set per-device's default mode
ac08140677 media: atomisp: fix try_fmt logic
518e059789 drm/nouveau/pmu/gm200-: avoid touching PMU outside of DEVINIT/PREOS/ACR
e3ba02b043 drm/bridge: dw-hdmi: handle ELD when DRM_BRIDGE_ATTACH_NO_CONNECTOR
2f13f10fdd ar5523: Fix null-ptr-deref with unexpected WDCMSG_TARGET_START reply
a9d2ccfc7d selftests/bpf: Fix bpf_object leak in skb_ctx selftest
b207356933 drm/lima: fix warning when CONFIG_DEBUG_SG=y & CONFIG_DMA_API_DEBUG=y
db1e878373 fs: dlm: filter user dlm messages for kernel locks
f9c9a46efd Bluetooth: Fix debugfs entry leak in hci_register_dev()
852d7d436f ARM: dts: omap3-n900: Fix lp5523 for multi color
b5793aff11 of: base: Fix phandle argument length mismatch error message
e16e836d51 clk: bm1880: remove kfrees on static allocations
36d46e21c9 ASoC: fsl_asrc: refine the check of available clock divider
5a6864e2e6 RDMA/cxgb4: Set queue pair state when being queried
80524c8cdf ASoC: fsl_mqs: fix MODULE_ALIAS
74988d017d powerpc/xive: Add missing null check after calling kmalloc
588e0b81ce mips: bcm63xx: add support for clk_set_parent()
e3de89d010 mips: lantiq: add support for clk_set_parent()
8f8468a089 arm64: tegra: Remove non existent Tegra194 reset
702902fc7f arm64: tegra: Fix Tegra194 HDA {clock,reset}-names ordering
24b047d72c counter: stm32-lptimer-cnt: remove iio counter abi
a394606104 misc: lattice-ecp3-config: Fix task hung when firmware load failed
696a50abbc ASoC: samsung: idma: Check of ioremap return value
d491a2c2cf ASoC: mediatek: Check for error clk pointer
c73ccdd62d phy: uniphier-usb3ss: fix unintended writing zeros to PHY register
d781f4cd8c scsi: block: pm: Always set request queue runtime active in blk_post_runtime_resume()
6e2a169544 iommu/iova: Fix race between FQ timeout and teardown
57bc898575 ASoC: Intel: catpt: Test dmaengine_submit() result before moving on
676049a3d2 iommu/amd: Restore GA log/tail pointer on host resume
c2bd7c31de iommu/amd: Remove iommu_init_ga()
62ea255f2b dmaengine: pxa/mmp: stop referencing config->slave_id
0be9ae1e53 mips: fix Kconfig reference to PHYS_ADDR_T_64BIT
88d78b25db mips: add SYS_HAS_CPU_MIPS64_R5 config for MIPS Release 5 support
51b8e814bc clk: stm32: Fix ltdc's clock turn off by clk_disable_unused() after system enter shell
dff359e042 of: unittest: 64 bit dma address test requires arch support
918105df78 of: unittest: fix warning on PowerPC frame size warning
0e04518b1d ASoC: rt5663: Handle device_property_read_u32_array error codes
7c0d9c815c RDMA/cma: Let cma_resolve_ib_dev() continue search even after empty entry
2432d325f9 RDMA/core: Let ib_find_gid() continue search even after empty entry
d77916df16 powerpc/powermac: Add additional missing lockdep_register_key()
8b3783e517 PCI/MSI: Fix pci_irq_vector()/pci_irq_get_affinity()
7be2a0bcaf RDMA/qedr: Fix reporting max_{send/recv}_wr attrs
e19469468b scsi: ufs: Fix race conditions related to driver data
ed43b2e048 iommu/io-pgtable-arm: Fix table descriptor paddr formatting
e9e4d1fb45 openrisc: Add clone3 ABI wrapper
551a785c26 binder: fix handling of error during copy
88ddf033a5 char/mwave: Adjust io port register size
8937aee4c0 ALSA: usb-audio: Drop superfluous '0' in Presonus Studio 1810c's ID
bcd533417f ALSA: oss: fix compile error when OSS_DEBUG is enabled
fd99aeb978 clocksource: Avoid accidental unstable marking of clocksources
cacc6c30e3 clocksource: Reduce clocksource-skew threshold
86ad478c99 powerpc/32s: Fix shift-out-of-bounds in KASAN init
ef798cd035 powerpc/perf: Fix PMU callbacks to clear pending PMI before resetting an overflown PMC
58014442a9 powerpc/irq: Add helper to set regs->softe
c9ffa84a3b powerpc/perf: move perf irq/nmi handling details into traps.c
a0758b3be4 powerpc/perf: MMCR0 control for PMU registers under PMCC=00
f4df6db5b0 powerpc/64s: Convert some cpu_setup() and cpu_restore() functions to C
a9c9d2ff64 dt-bindings: thermal: Fix definition of cooling-maps contribution property
2bd8d93795 ASoC: uniphier: drop selecting non-existing SND_SOC_UNIPHIER_AIO_DMA
5a821af769 powerpc/prom_init: Fix improper check of prom_getprop()
9ca761ef94 clk: imx8mn: Fix imx8mn_clko1_sels
999528d8a7 scsi: pm80xx: Update WARN_ON check in pm8001_mpi_build_cmd()
c5f414d69a RDMA/hns: Validate the pkey index
04a032ea24 RDMA/bnxt_re: Scan the whole bitmap when checking if "disabling RCFW with pending cmd-bit"
84cd5c029d ALSA: hda: Add missing rwsem around snd_ctl_remove() calls
180e9d7384 ALSA: PCM: Add missing rwsem around snd_ctl_remove() calls
49d76154ba ALSA: jack: Add missing rwsem around snd_ctl_remove() calls
f871cd8ee0 ext4: avoid trim error on fs with small groups
99590e820f net: mcs7830: handle usb read errors properly
2b948524ae iwlwifi: mvm: Use div_s64 instead of do_div in iwl_mvm_ftm_rtt_smoothing()
04ce9e2aed pcmcia: fix setting of kthread task states
5064bfe046 can: xilinx_can: xcan_probe(): check for error irq
b6dd1577bc can: softing: softing_startstop(): fix set but not used variable warning
b9ac866c23 tpm_tis: Fix an error handling path in 'tpm_tis_core_init()'
fb46223c9f tpm: add request_locality before write TPM_INT_ENABLE
20edf903a3 can: mcp251xfd: add missing newline to printed strings
d71fca5d01 regmap: Call regmap_debugfs_exit() prior to _init()
838acddcdf netrom: fix api breakage in nr_setsockopt()
0d04479857 ax25: uninitialized variable in ax25_setsockopt()
27e9910c45 spi: spi-meson-spifc: Add missing pm_runtime_disable() in meson_spifc_probe
9d6350cf8e Bluetooth: L2CAP: uninitialized variables in l2cap_sock_setsockopt()
9defd7d4c0 lib/mpi: Add the return value check of kcalloc()
e801f81cee net/mlx5: Set command entry semaphore up once got index free
d2b9ce705d Revert "net/mlx5e: Block offload of outer header csum for UDP tunnels"
67e1a449a1 net/mlx5e: Don't block routes with nexthop objects in SW
cc40fa05c0 net/mlx5e: Fix page DMA map/unmap attributes
b3dda01d1d debugfs: lockdown: Allow reading debugfs files that are not world readable
b9b5da3e18 HID: hid-uclogic-params: Invalid parameter check in uclogic_params_frame_init_v1_buttonpad
541c3a044b HID: hid-uclogic-params: Invalid parameter check in uclogic_params_huion_init
c47f842e0c HID: hid-uclogic-params: Invalid parameter check in uclogic_params_get_str_desc
cf5ad827ee HID: hid-uclogic-params: Invalid parameter check in uclogic_params_init
94177fcecc usb: dwc3: qcom: Fix NULL vs IS_ERR checking in dwc3_qcom_probe
4579954bf4 Bluetooth: hci_qca: Fix NULL vs IS_ERR_OR_NULL check in qca_serdev_probe
f6bf3d6639 Bluetooth: hci_bcm: Check for error irq
f5e4f68d57 fsl/fman: Check for null pointer after calling devm_ioremap
60aca6fdc1 staging: greybus: audio: Check null pointer
a1068bfee4 rocker: fix a sleeping in atomic bug
2db344725e ppp: ensure minimum packet size in ppp_write()
45643b1b6c netfilter: nft_set_pipapo: allocate pcpu scratch maps on clone
8772700a9f bpf: Fix SO_RCVBUF/SO_SNDBUF handling in _bpf_setsockopt().
342332fb0b bpf: Don't promote bogus looking registers after null check.
0036c78c49 netfilter: ipt_CLUSTERIP: fix refcount leak in clusterip_tg_check()
2e718389b9 power: reset: mt6397: Check for null res pointer
4210c35fe8 pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in nonstatic_find_mem_region()
2dee347f35 pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in __nonstatic_find_io_region()
0f03132191 ACPI: scan: Create platform device for BCM4752 and LNV4752 ACPI nodes
595e1ec55b x86/mce/inject: Avoid out-of-bounds write when setting flags
df12681819 hwmon: (mr75203) fix wrong power-up delay value
aea5302d9d x86/boot/compressed: Move CLANG_FLAGS to beginning of KBUILD_CFLAGS
70eec71f32 Bluetooth: hci_qca: Stop IBS timer during BT OFF
1d4e722b62 software node: fix wrong node passed to find nargs_prop
f8f3c1720d backlight: qcom-wled: Respect enabled-strings in set_brightness
de79bcbfaf backlight: qcom-wled: Use cpu_to_le16 macro to perform conversion
c79f9b8d8e backlight: qcom-wled: Override default length with qcom,enabled-strings
bf4daf6153 backlight: qcom-wled: Fix off-by-one maximum with default num_strings
09aed85e8c backlight: qcom-wled: Pass number of elements to read to read_u32_array
f4ed4fc504 backlight: qcom-wled: Validate enabled string indices in DT
e668ac6506 bpftool: Enable line buffering for stdout
009bb7ee15 Bluetooth: L2CAP: Fix using wrong mode
1a2241ad40 um: virtio_uml: Fix time-travel external time propagation
8411722e56 um: fix ndelay/udelay defines
b2b1b490bd selinux: fix potential memleak in selinux_add_opt()
3253cf0914 mmc: meson-mx-sdio: add IRQ check
decb209954 mmc: meson-mx-sdhc: add IRQ check
bdc6c9fc5f iwlwifi: mvm: test roc running status bits before removing the sta
a750fcd604 iwlwifi: mvm: fix 32-bit build in FTM
86b0122d26 ARM: dts: armada-38x: Add generic compatible to UART nodes
1f5428e438 arm64: dts: marvell: cn9130: enable CP0 GPIO controllers
874b97e862 arm64: dts: marvell: cn9130: add GPIO and SPI aliases
407ef1db40 usb: ftdi-elan: fix memory leak on device disconnect
2a65da5a1e ARM: 9159/1: decompressor: Avoid UNPREDICTABLE NOP encoding
47dd693c94 xfrm: state and policy should fail if XFRMA_IF_ID 0
db369047e3 xfrm: interface with if_id 0 should return error
37441ddadc media: hantro: Fix probe func error path
3849ec830b drm/tegra: vic: Fix DMA API misuse
b230114bc5 drm/bridge: ti-sn65dsi86: Set max register for regmap
db97fc2c44 drm/msm/dpu: fix safe status debugfs file
3580055d1f arm64: dts: qcom: ipq6018: Fix gpio-ranges property
6f20a5a98a arm64: dts: qcom: c630: Fix soundcard setup
394ee480aa ath11k: Fix a NULL pointer dereference in ath11k_mac_op_hw_scan()
f6e4a6cbdb media: coda/imx-vdoa: Handle dma_set_coherent_mask error codes
1a8869de32 media: msi001: fix possible null-ptr-deref in msi001_probe()
a79327bb01 media: dw2102: Fix use after free
958a8819d4 ARM: dts: gemini: NAS4220-B: fis-index-block with 128 KiB sectors
3e51460638 ath11k: Fix deleting uninitialized kernel timer during fragment cache flush
b35263f000 crypto: stm32 - Revert broken pm_runtime_resume_and_get changes
1f5b81874f crypto: stm32/cryp - fix bugs and crash in tests
1f6151b077 crypto: stm32/cryp - fix lrw chaining mode
2bd40e3a3a crypto: stm32/cryp - fix double pm exit
533af1621d crypto: stm32/cryp - check early input data
5deb24e503 crypto: stm32/cryp - fix xts and race condition in crypto_engine requests
e9e0dd5da8 crypto: stm32/cryp - fix CTR counter carry
c40b1bc851 crypto: stm32 - Fix last sparse warning in stm32_cryp_check_ctr_counter
93033bbbdc selftests: harness: avoid false negatives if test has no ASSERTs
f568fd97d7 selftests: clone3: clone3: add case CLONE3_ARGS_NO_TEST
d21b47c607 x86/uaccess: Move variable into switch case statement
3e801ea43c xfrm: fix a small bug in xfrm_sa_len()
b87034d7a2 mwifiex: Fix possible ABBA deadlock
0836f94040 rcu/exp: Mark current CPU as exp-QS in IPI loop second pass
027165c491 drm/msm/dp: displayPort driver need algorithm rational
268f352456 sched/rt: Try to restart rt period timer when rt runtime exceeded
bb0579ab50 wireless: iwlwifi: Fix a double free in iwl_txq_dyn_alloc_dma
b4b911b164 media: si2157: Fix "warm" tuner state detection
7009a5fbc5 media: saa7146: mxb: Fix a NULL pointer dereference in mxb_attach()
df79d2bf95 media: dib8000: Fix a memleak in dib8000_init()
f0cb43a2c6 arm64: clear_page() shouldn't use DC ZVA when DCZID_EL0.DZP == 1
88ed31aab4 arm64: lib: Annotate {clear, copy}_page() as position-independent
69e402a985 bpf: Remove config check to enable bpf support for branch records
924886fa22 bpf: Disallow BPF_LOG_KERNEL log level for bpf(BPF_BTF_LOAD)
218d952160 bpf: Adjust BTF log size limit.
b77ef5b4ea sched/fair: Fix per-CPU kthread and wakee stacking for asym CPU capacity
d7d5b3bc52 sched/fair: Fix detection of per-CPU kthreads waking a task
ec121517ac Bluetooth: btmtksdio: fix resume failure
2a7edcb3ef staging: rtl8192e: rtllib_module: fix error handle case in alloc_rtllib()
49f5cd2b7c staging: rtl8192e: return error code from rtllib_softmac_init()
04fdd426ce floppy: Fix hang in watchdog when disk is ejected
45bbe00801 serial: amba-pl011: do not request memory region twice
8409d2394c tty: serial: uartlite: allow 64 bit address
a001a15ab3 arm64: dts: ti: k3-j7200: Correct the d-cache-sets info
75919207c1 arm64: dts: ti: k3-j721e: Fix the L2 cache sets
2dcfa3c765 arm64: dts: ti: k3-j7200: Fix the L2 cache sets
f277978d6c drm/radeon/radeon_kms: Fix a NULL pointer dereference in radeon_driver_open_kms()
3ca1b3b82f drm/amdgpu: Fix a NULL pointer dereference in amdgpu_connector_lcd_native_mode()
96e05d2d93 thermal/drivers/imx8mm: Enable ADC when enabling monitor
ef72449e2d ACPI: EC: Rework flushing of EC work while suspended to idle
c0acd5a097 cgroup: Trace event cgroup id fields should be u64
e7e178e264 arm64: dts: qcom: msm8916: fix MMC controller aliases
894d91c633 netfilter: bridge: add support for pppoe filtering
13f64bbe42 thermal/drivers/imx: Implement runtime PM support
c3a59f34e8 media: venus: core: Fix a resource leak in the error handling path of 'venus_probe()'
50c4244906 media: venus: core: Fix a potential NULL pointer dereference in an error handling path
eeefa2eae8 media: venus: core, venc, vdec: Fix probe dependency error
53f65afc26 media: venus: pm_helpers: Control core power domain manually
89f518b153 media: coda: fix CODA960 JPEG encoder buffer overflow
1da628d351 media: mtk-vcodec: call v4l2_m2m_ctx_release first when file is released
2028fb832d media: si470x-i2c: fix possible memory leak in si470x_i2c_probe()
e8d78f924f media: imx-pxp: Initialize the spinlock prior to using it
621e8ce75d media: rcar-csi2: Correct the selection of hsfreqrange
ad52b9890b mfd: atmel-flexcom: Use .resume_noirq
46d6a23114 mfd: atmel-flexcom: Remove #ifdef CONFIG_PM_SLEEP
f93c9aa1d3 tty: serial: atmel: Call dma_async_issue_pending()
755a6c873b tty: serial: atmel: Check return code of dmaengine_submit()
bd85b2e77a arm64: dts: ti: k3-j721e: correct cache-sets info
32e9947e66 ath11k: Use host CE parameters for CE interrupts configuration
6a49acfaca crypto: qat - fix undetected PFVF timeout in ACK loop
475ac5c565 crypto: qat - make pfvf send message direction agnostic
ee1c74c3c9 crypto: qat - remove unnecessary collision prevention step in PFVF
472f768352 crypto: qat - fix spelling mistake: "messge" -> "message"
ae766527e6 ARM: dts: stm32: fix dtbs_check warning on ili9341 dts binding on stm32f429 disco
eab4204588 mtd: hyperbus: rpc-if: fix bug in rpcif_hb_remove
867d4ace48 crypto: qce - fix uaf on qce_skcipher_register_one
e19b3c1b57 crypto: qce - fix uaf on qce_ahash_register_one
5de640f59f media: dmxdev: fix UAF when dvb_register_device() fails
1d64e2bd22 arm64: dts: renesas: cat875: Add rx/tx delays
a33eef23a6 drm/vboxvideo: fix a NULL vs IS_ERR() check
43220a61e7 fs: dlm: fix build with CONFIG_IPV6 disabled
0d7c5d10e7 tee: fix put order in teedev_close_context()
097e601eb8 ath11k: reset RSN/WPA present state for open BSS
fa51addd39 ath11k: clear the keys properly via DISABLE_KEY
df94b37e90 ath11k: Fix ETSI regd with weather radar overlap
ffc9019bd9 Bluetooth: stop proccessing malicious adv data
3273541fed memory: renesas-rpc-if: Return error in case devm_ioremap_resource() fails
55917db359 fs: dlm: don't call kernel_getpeername() in error_report()
98923ebb03 fs: dlm: use sk->sk_socket instead of con->sock
6edd1bd8e3 arm64: dts: meson-gxbb-wetek: fix missing GPIO binding
eb1f75fa24 arm64: dts: meson-gxbb-wetek: fix HDMI in early boot
6f012f2c44 arm64: dts: amlogic: Fix SPI NOR flash node name for ODROID N2/N2+
96d710b1c6 arm64: dts: amlogic: meson-g12: Fix GPU operating point table node name
0b57480ed5 media: aspeed: Update signal status immediately to ensure sane hw state
0ff0ae69d2 media: em28xx: fix memory leak in em28xx_init_dev
b441d94287 media: aspeed: fix mode-detect always time out at 2nd run
8d132d9dd8 media: atomisp: fix uninitialized bug in gmin_get_pmic_id_and_addr()
fc2b95e7ae media: atomisp: fix enum formats logic
6e5353238c media: atomisp: add NULL check for asd obtained from atomisp_video_pipe
6cbabad304 media: staging: media: atomisp: pci: Balance braces around conditional statements in file atomisp_cmd.c
22b0b68f7d media: atomisp: fix ifdefs in sh_css.c
0bf5e8af6e media: atomisp: fix inverted error check for ia_css_mipi_is_source_port_valid()
3cb3e66f58 media: atomisp: do not use err var when checking port validity for ISP2400
08e43223fb media: atomisp: fix inverted logic in buffers_needed()
fb370f6dc7 media: atomisp: fix punit_ddr_dvfs_enable() argument for mrfld_power up case
1daacf9bb6 media: atomisp: add missing media_device_cleanup() in atomisp_unregister_entities()
e1da9301cf media: videobuf2: Fix the size printk format
90807ab437 mtd: hyperbus: rpc-if: Check return value of rpcif_sw_init()
9bfed11dcf ath11k: Send PPDU_STATS_CFG with proper pdev mask to firmware
2fe056d979 wcn36xx: fix RX BD rate mapping for 5GHz legacy rates
22406ed4e3 wcn36xx: populate band before determining rate on RX
92fea7bd5a wcn36xx: Put DXE block into reset before freeing memory
0d53c47f6a wcn36xx: Release DMA channel descriptor allocations
1850195a85 wcn36xx: Fix DMA channel enable/disable cycle
38a7842889 wcn36xx: Indicate beacon not connection loss on MISSED_BEACON_IND
fcb267bb95 wcn36xx: ensure pairing of init_scan/finish_scan and start_scan/end_scan
e53ff4dd70 drm/vc4: hdmi: Set a default HSM rate
b9c2343373 clk: bcm-2835: Remove rounding up the dividers
836dd37fe2 clk: bcm-2835: Pick the closest clock rate
88f1b613c3 Bluetooth: cmtp: fix possible panic when cmtp_init_sockets() fails
9ddfa1c191 drm/rockchip: dsi: Reconfigure hardware on resume()
58904ed186 drm/rockchip: dsi: Disable PLL clock on bind error
6215cde020 drm/rockchip: dsi: Hold pm-runtime across bind/unbind
8ccaafa1ca drm/rockchip: dsi: Fix unbalanced clock on probe error
9bc19022aa drm/panel: innolux-p079zca: Delete panel on attach() failure
b01b7b8684 drm/panel: kingdisplay-kd097d04: Delete panel on attach() failure
0499c863a8 drm: fix null-ptr-deref in drm_dev_init_release()
7798757013 drm/bridge: display-connector: fix an uninitialized pointer in probe()
cb5813b0e5 Bluetooth: L2CAP: Fix not initializing sk_peer_pid
ed0b1fd3ec drm/ttm: Put BO in its memory manager's lru list
7b9fa915a5 shmem: fix a race between shmem_unused_huge_shrink and shmem_evict_inode
6c6f86bb61 mm/page_alloc.c: do not warn allocation failure on zone DMA if no managed pages
e04b1dfe15 dma/pool: create dma atomic pool only if dma zone has managed pages
d2e5724117 mm_zone: add function to check if managed dma zone exists
2142a7e9bd PCI: Add function 1 DMA alias quirk for Marvell 88SE9125 SATA controller
45c74f4f54 dma_fence_array: Fix PENDING_ERROR leak in dma_fence_array_signaled()
191a24ceae gpu: host1x: Add back arm_iommu_detach_device()
0680674536 iommu/io-pgtable-arm-v7s: Add error handle for page table allocation failure
3dae11f8e3 lkdtm: Fix content of section containing lkdtm_rodata_do_nothing()
e4a2c924a1 iio: adc: ti-adc081c: Partial revert of removal of ACPI IDs
256302cb2f can: softing_cs: softingcs_probe(): fix memleak on registration failure
aa57725e2d media: cec-pin: fix interrupt en/disable handling
2e566cacc3 media: stk1160: fix control-message timeouts
1a0ca711df media: pvrusb2: fix control-message timeouts
2dbf430ead media: redrat3: fix control-message timeouts
6e9c120bf9 media: dib0700: fix undefined behavior in tuner shutdown
5e98ac260d media: s2255: fix control-message timeouts
09b0b918a6 media: cpia2: fix control-message timeouts
d90833106c media: em28xx: fix control-message timeouts
2182575c83 media: mceusb: fix control-message timeouts
460525acc9 media: flexcop-usb: fix control-message timeouts
7cac8a5624 media: v4l2-ioctl.c: readbuffers depends on V4L2_CAP_READWRITE
1da0b1cd42 rtc: cmos: take rtc_lock while reading from CMOS
14f6cfe0d7 tools/nolibc: fix incorrect truncation of exit code
5e258640ba tools/nolibc: i386: fix initial stack alignment
06f7528d64 tools/nolibc: x86-64: Fix startup code bug
98259dd54e x86/gpu: Reserve stolen memory for first integrated Intel GPU
e2a17dcad5 mtd: rawnand: davinci: Rewrite function description
8933138a66 mtd: rawnand: davinci: Avoid duplicated page read
677764634b mtd: rawnand: davinci: Don't calculate ECC when reading page
a8a607b004 mtd: Fixed breaking list in __mtd_del_partition.
ff10cd7bb2 mtd: rawnand: gpmi: Remove explicit default gpmi clock setting for i.MX6
538a5e208e mtd: rawnand: gpmi: Add ERR007117 protection for nfc_apply_timings
777a700ccf nfc: llcp: fix NULL error pointer dereference on sendmsg() after failed bind()
08283b076f f2fs: fix to do sanity check in is_alive()
57cfc965e3 HID: wacom: Avoid using stale array indicies to read contact count
7fd22c99bb HID: wacom: Ignore the confidence flag when a touch is removed
9a4800e0f6 HID: wacom: Reset expected and received contact counts at the same time
c2e39d5df0 HID: uhid: Fix worker destroying device without any protection
aa1346113c KVM: VMX: switch blocked_vcpu_on_cpu_lock to raw spinlock
0347b16583 Merge 5.10.93 into android12-5.10-lts
fd187a4925 Linux 5.10.93
bed97c9036 mtd: fixup CFI on ixp4xx
f50803b519 powerpc/pseries: Get entry and uaccess flush required bits from H_GET_CPU_CHARACTERISTICS
68c1aa82be ALSA: hda/realtek: Re-order quirk entries for Lenovo
4d15a17d06 ALSA: hda/realtek: Add quirk for Legion Y9000X 2020
d7b41464f1 ALSA: hda: ALC287: Add Lenovo IdeaPad Slim 9i 14ITL5 speaker quirk
87246ae94b ALSA: hda/realtek - Fix silent output on Gigabyte X570 Aorus Master after reboot from Windows
9c27e513fb ALSA: hda/realtek: Add speaker fixup for some Yoga 15ITL5 devices
4c7fb4d519 KVM: x86: remove PMU FIXED_CTR3 from msrs_to_save_all
6b8c3a1853 firmware: qemu_fw_cfg: fix kobject leak in probe error path
889c73305b firmware: qemu_fw_cfg: fix NULL-pointer deref on duplicate entries
ff9588cf15 firmware: qemu_fw_cfg: fix sysfs information leak
358a4b054a rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts enabled
93c4506f9f media: uvcvideo: fix division by zero at stream start
4c3f70be6f video: vga16fb: Only probe for EGA and VGA 16 color graphic cards
161e43ab8c 9p: only copy valid iattrs in 9P2000.L setattr implementation
0e6c0f3f40 KVM: s390: Clarify SIGP orders versus STOP/RESTART
413b427f5f KVM: x86: Register Processor Trace interrupt hook iff PT enabled in guest
723acd75a0 perf: Protect perf_guest_cbs with RCU
eadde287a6 vfs: fs_context: fix up param length parsing in legacy_parse_param
c5f3827716 remoteproc: qcom: pil_info: Don't memcpy_toio more than is provided
5d88e24b23 orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc()
0084fefe29 devtmpfs regression fix: reconfigure on each mount
ee40594c95 kbuild: Add $(KBUILD_HOSTLDFLAGS) to 'has_libelf' test
f45f895af5 Merge branch 'android12-5.10' into `android12-5.10-lts`
7dd0d263fe Merge 5.10.92 into android12-5.10-lts
c982c1a839 Linux 5.10.92
c0091233f3 staging: greybus: fix stack size warning with UBSAN
66d21c005d drm/i915: Avoid bitwise vs logical OR warning in snb_wm_latency_quirk()
2d4fda471d staging: wlan-ng: Avoid bitwise vs logical OR warning in hfa384x_usb_throttlefn()
3609fed7ac media: Revert "media: uvcvideo: Set unique vdev name based in type"
9b3c761e78 random: fix crash on multiple early calls to add_bootloader_randomness()
61cca7d191 random: fix data race on crng init time
3de9478230 random: fix data race on crng_node_pool
43c494294f can: gs_usb: gs_can_start_xmit(): zero-initialize hf->{flags,reserved}
45221a57b6 can: isotp: convert struct tpcon::{idx,len} to unsigned int
bd61ae808b can: gs_usb: fix use of uninitialized variable, detach device on reception of invalid USB data
f68e600017 mfd: intel-lpss: Fix too early PM enablement in the ACPI ->probe()
5f76445a31 veth: Do not record rx queue hint in veth_xmit
ddfa53825f mmc: sdhci-pci: Add PCI ID for Intel ADL
2e691f9894 ath11k: Fix buffer overflow when scanning with extraie
a87cecf943 USB: Fix "slab-out-of-bounds Write" bug in usb_hcd_poll_rh_status
15982330b6 USB: core: Fix bug in resuming hub's handling of wakeup requests
413108ce3b ARM: dts: exynos: Fix BCM4330 Bluetooth reset polarity in I9100
b6dd070236 Bluetooth: bfusb: fix division by zero in send path
869e1677a0 Bluetooth: btusb: Add support for Foxconn QCA 0xe0d0
c20021ce94 Bluetooth: btusb: Add support for Foxconn MT7922A
8349391838 Bluetooth: btusb: Add two more Bluetooth parts for WCN6855
294c0dd80d Bluetooth: btusb: fix memory leak in btusb_mtk_submit_wmt_recv_urb()
35ab8c9085 bpf: Fix out of bounds access from invalid *_or_null type verification
c84fbba8a9 workqueue: Fix unbind_workers() VS wq_worker_running() race
c39d68ab38 md: revert io stats accounting
d605f2f30d Merge 5.10.91 into android12-5.10-lts
df395c763b Linux 5.10.91
674071c9eb Input: zinitix - make sure the IRQ is allocated before it gets enabled
ef81f7d406 ARM: dts: gpio-ranges property is now required
f63fa1a0d4 ipv6: raw: check passed optlen before reading
cf07884e6b drm/amd/display: Added power down for DCN10
10b9ccd067 mISDN: change function names to avoid conflicts
dd8a09cfbb atlantic: Fix buff_ring OOB in aq_ring_rx_clean
c2f4bb251e net: udp: fix alignment problem in udp4_seq_show()
f82b48d1d8 ip6_vti: initialize __ip6_tnl_parm struct in vti6_siocdevprivate
8c87a83ef8 scsi: libiscsi: Fix UAF in iscsi_conn_get_param()/iscsi_conn_teardown()
b798b677f9 usb: mtu3: fix interval value for intr and isoc
498d77fc5e ipv6: Do cleanup if attribute validation fails in multipath route
72b0d14a0a ipv6: Continue processing multipath route even if gateway attribute is invalid
5a7d650bb1 power: bq25890: Enable continuous conversion for ADC at charging
4f260ea553 phonet: refcount leak in pep_sock_accep
6195293460 rndis_host: support Hytera digital radios
62cbde77d9 power: reset: ltc2952: Fix use of floating point literals
998d157e3b power: supply: core: Break capacity loop
16d8568378 xfs: map unwritten blocks in XFS_IOC_{ALLOC,FREE}SP just like fallocate
aa606b82cd net: ena: Fix error handling when calculating max IO queues number
e7f5480978 net: ena: Fix undefined state when tx request id is out of bounds
2de3d961f8 sch_qfq: prevent shift-out-of-bounds in qfq_init_qdisc
4c34d5fd8c batman-adv: mcast: don't send link-local multicast to mcast routers
f403b5f96e lwtunnel: Validate RTA_ENCAP_TYPE attribute length
48d5adb08d ipv6: Check attribute length for RTA_GATEWAY when deleting multipath route
173bfa2782 ipv6: Check attribute length for RTA_GATEWAY in multipath route
914420a2a6 ipv4: Check attribute length for RTA_FLOW in multipath route
a8fe915be6 ipv4: Check attribute length for RTA_GATEWAY in multipath route
786a335fef ftrace/samples: Add missing prototypes direct functions
c859c4de0b i40e: Fix incorrect netdev's real number of RX/TX queues
d0ad64438f i40e: Fix for displaying message regarding NVM version
32845aa602 i40e: fix use-after-free in i40e_sync_filters_subtask()
f7edb6b943 sfc: The RX page_ring is optional
2b3f34da0d mac80211: initialize variable have_higher_than_11mbit
16e5cad6ec RDMA/uverbs: Check for null return of kmalloc_array
a7c2cae997 netrom: fix copying in user data in nr_setsockopt
beeb0fdeda RDMA/core: Don't infoleak GRH fields
3ca132e6b0 iavf: Fix limit of total number of queues to active queues of VF
396e301690 i40e: Fix to not show opcode msg on unsuccessful VF MAC change
7f13d14e56 ieee802154: atusb: fix uninit value in atusb_set_extended_addr
7db1e245cb tracing: Tag trace_percpu_buffer as a percpu pointer
760c6a6255 tracing: Fix check for trace_percpu_buffer validity in get_trace_buf()
c1e2da4b3f selftests: x86: fix [-Wstringop-overread] warn in test_process_vm_readv()
384111e123 f2fs: quota: fix potential deadlock
a1bb21475e Merge 5.10.90 into android12-5.10-lts
d3e491a20d Linux 5.10.90
8c15bfb36a bpf: Add kconfig knob for disabling unpriv bpf by default
d8a5b1377b perf script: Fix CPU filtering of a script's switch events
2386e81a1d net: fix use-after-free in tw_timer_handler
34087cf960 Input: spaceball - fix parsing of movement data packets
9f329d0d6c Input: appletouch - initialize work before device registration
2a4f551dec scsi: vmw_pvscsi: Set residual data length conditionally
1cb8444f31 binder: fix async_free_space accounting for empty parcels
a6e26251dd usb: mtu3: set interval of FS intr and isoc endpoint
3b6efe0b7b usb: mtu3: fix list_head check warning
f10b01c48f usb: mtu3: add memory barrier before set GPD's HWO
1c4ace3e6b usb: gadget: f_fs: Clear ffs_eventfd in ffs_data_clear.
1933fe8ce7 xhci: Fresco FL1100 controller should not have BROKEN_MSI quirk set.
b8553330a0 drm/amdgpu: add support for IP discovery gc_info table v2
28863ffe21 drm/amdgpu: When the VCN(1.0) block is suspended, powergating is explicitly enabled
a0f3ac399e uapi: fix linux/nfc.h userspace compilation errors
818c9e0a04 nfc: uapi: use kernel size_t to fix user-space builds
8d31cbab4c i2c: validate user data in compat ioctl
51c94d8fbd fsl/fman: Fix missing put_device() call in fman_port_probe
920932b20e net/ncsi: check for error return from call to nla_put_u32
610af55f9f selftests/net: udpgso_bench_tx: fix dst ip argument
78503589b1 net/mlx5e: Fix wrong features assignment in case of error
6114600808 ionic: Initialize the 'lif->dbid_inuse' bitmap
b7c9a1427b igc: Fix TX timestamp support for non-MSI-X platforms
e8a5988a85 net/smc: fix kernel panic caused by race of smc_sock
97c87c1db9 net/smc: don't send CDC/LLC message if link not ready
99f19566b1 net/smc: improved fix wait on already cleared link
e553265ea5 NFC: st21nfca: Fix memory leak in device probe and remove
8d70dc0eec net: lantiq_xrx200: fix statistics of received bytes
7ef89bd1e8 net: ag71xx: Fix a potential double free in error handling paths
40d3618691 net: usb: pegasus: Do not drop long Ethernet frames
a67becdaa8 net/smc: fix using of uninitialized completions
769d14abd3 sctp: use call_rcu to free endpoint
13c1bf43b6 selftests: Calculate udpgso segment count without header adjustment
abe74fb433 udp: using datalen to cap ipv6 udp max gso segments
5e6ad649e9 net/mlx5e: Fix ICOSQ recovery flow for XSK
73665165b6 net/mlx5e: Wrap the tx reporter dump callback to extract the sq
4cd1da02f0 net/mlx5: DR, Fix NULL vs IS_ERR checking in dr_domain_init_resources
fcb32eb3d0 scsi: lpfc: Terminate string in lpfc_debugfs_nvmeio_trc_write()
4833ad4908 selinux: initialize proto variable in selinux_ip_postroute_compat()
ec941a2277 recordmcount.pl: fix typo in s390 mcount regex
a0e82d5ef9 memblock: fix memblock_phys_alloc() section mismatch error
7da855e939 platform/x86: apple-gmux: use resource_size() with res
d01e9ce1af parisc: Clear stale IIR value on instruction access rights trap
0643d9175d tomoyo: use hwight16() in tomoyo_domain_quota_is_ok()
e2048a1f91 tomoyo: Check exceeded quota early in tomoyo_domain_quota_is_ok().
210c7c6908 Input: i8042 - enable deferred probe quirk for ASUS UM325UA
bb672eff74 Input: i8042 - add deferred probe support
9b28b48fb3 Merge 5.10.89 into android12-5.10-lts
eb967e323f Linux 5.10.89
52ad5da8e3 phonet/pep: refuse to enable an unbound pipe
7dd52af1eb hamradio: improve the incomplete fix to avoid NPD
450121075a hamradio: defer ax25 kfree after unregister_netdev
8e34d07dd4 ax25: NPD bug when detaching AX25 device
50f78486f9 hwmon: (lm90) Do not report 'busy' status bit as alarm
ec1d222d37 hwmom: (lm90) Fix citical alarm status for MAX6680/MAX6681
441d387366 pinctrl: mediatek: fix global-out-of-bounds issue
9c75a9657b ASoC: rt5682: fix the wrong jack type detected
94caab5af1 ASoC: tas2770: Fix setting of high sample rates
c7282790c7 Input: goodix - add id->model mapping for the "9111" model
3bb3bf50d6 Input: elants_i2c - do not check Remark ID on eKTH3900/eKTH5312
ee6f34215c mm: mempolicy: fix THP allocations escaping mempolicy restrictions
8008fc1d0b KVM: VMX: Fix stale docs for kvm-intel.emulate_invalid_guest_state
d91ed251fd usb: gadget: u_ether: fix race in setting MAC address in setup phase
6697f29bf5 ceph: fix up non-directory creation in SGID directories
fffb6581a2 f2fs: fix to do sanity check on last xattr entry in __f2fs_setxattr()
ad338d825e tee: optee: Fix incorrect page free bug
1f20707674 mm/hwpoison: clear MF_COUNT_INCREASED before retrying get_any_page()
ac61b9c6c0 mac80211: fix locking in ieee80211_start_ap error path
89876d1083 ARM: 9169/1: entry: fix Thumb2 bug in iWMMXt exception handling
c3253d3a38 mmc: mmci: stm32: clear DLYB_CR after sending tuning command
0d66b39521 mmc: core: Disable card detect during shutdown
c8e366a01c mmc: meson-mx-sdhc: Set MANUAL_STOP for multi-block SDIO commands
4af7915361 mmc: sdhci-tegra: Fix switch to HS400ES mode
9a7ec79797 gpio: dln2: Fix interrupts when replugging the device
f5b02912e2 pinctrl: stm32: consider the GPIO offset to expose all the GPIO lines
28626e76ba KVM: VMX: Wake vCPU when delivering posted IRQ even if vCPU == this vCPU
7a37f2e370 platform/x86: intel_pmc_core: fix memleak on registration failure
b57afd1240 x86/pkey: Fix undefined behaviour with PKRU_WD_BIT
c05d8f66ec tee: handle lookup of shm with reference count 0
0ffb9f83e4 parisc: Fix mask used to select futex spinlock
5deeb9ad59 parisc: Correct completer in lws start
8b745616ba ipmi: fix initialization when workqueue allocation fails
1f6ab84746 ipmi: ssif: initialize ssif_info->client early
a5192f3116 ipmi: bail out if init_srcu_struct fails
bc674f1b21 Input: atmel_mxt_ts - fix double free in mxt_read_info_block
30140e252f ASoC: meson: aiu: Move AIU_I2S_MISC hold setting to aiu-fifo-i2s
2b4c020b70 ALSA: hda/realtek: Fix quirk for Clevo NJ51CU
7470780f3b ALSA: hda/realtek: Add new alc285-hp-amp-init model
4cb7dc2e30 ALSA: hda/realtek: Amp init fixup for HP ZBook 15 G6
69e492161c ALSA: drivers: opl3: Fix incorrect use of vp->state
a96c08e0b4 ALSA: jack: Check the return value of kstrdup()
51c7b2a7b8 hwmon: (lm90) Drop critical attribute support for MAX6654
2464738d0e hwmon: (lm90) Introduce flag indicating extended temperature support
196df56c3d hwmon: (lm90) Add basic support for TI TMP461
fa2e149260 hwmon: (lm90) Fix usage of CONFIG2 register in detect function
ba696b4708 pinctrl: bcm2835: Change init order for gpio hogs
676c572439 Input: elantech - fix stack out of bound access in elantech_change_report_id()
2792fde84c sfc: falcon: Check null pointer of rx_queue->page_ring
d70b4001ef sfc: Check null pointer of rx_queue->page_ring
75c962f02a net: ks8851: Check for error irq
9db0f8d395 drivers: net: smc911x: Check for error irq
ca2a15053b fjes: Check for error irq
c6d2754006 bonding: fix ad_actor_system option setting to default
6809da5185 ipmi: Fix UAF when uninstall ipmi_si and ipmi_msghandler module
61e6b82e7b igb: fix deadlock caused by taking RTNL in RPM resume path
e00eace232 net: skip virtio_net_hdr_set_proto if protocol already set
ed05e4dcfb net: accept UFOv6 packages in virtio_net_hdr_to_skb
56b0bbba78 qlcnic: potential dereference null pointer of rx_queue->page_ring
78e49d77e5 net: marvell: prestera: fix incorrect return of port_find
861b4413e4 ARM: dts: imx6qdl-wandboard: Fix Ethernet support
d79f5e0d45 netfilter: fix regression in looped (broad|multi)cast's MAC handling
579cefef7c RDMA/hns: Replace kfree() with kvfree()
7cf6466e00 IB/qib: Fix memory leak in qib_user_sdma_queue_pkts()
cd9c90682b ASoC: meson: aiu: fifo: Add missing dma_coerce_mask_and_coherent()
580ecf86e7 spi: change clk_disable_unprepare to clk_unprepare
93a957bbf4 arm64: dts: allwinner: orangepi-zero-plus: fix PHY mode
ef2dce4325 HID: potential dereference of null pointer
3110bc5862 HID: holtek: fix mouse probing
0875873b2a ext4: check for inconsistent extents between index and leaf block
76366c024f ext4: check for out-of-order index extents in ext4_valid_extent_entries()
1d4b1c4e8b ext4: prevent partial update of the extent blocks
f69a47fcbb net: usb: lan78xx: add Allied Telesis AT29M2-AF
8c0059a25c arm64: vdso32: require CROSS_COMPILE_COMPAT for gcc+bfd
b16b124a42 arm64: vdso32: drop -no-integrated-as flag
ba13eb1927 Merge 5.10.88 into android12-5.10-lts
856f88f27b Linux 5.10.88
88f20cccbe xen/netback: don't queue unlimited number of packages
525875c410 xen/netback: fix rx queue stall detection
8fa3a370cc xen/console: harden hvc_xen against event channel storms
d31b337917 xen/netfront: harden netfront against event channel storms
8ac3b6ee7c xen/blkfront: harden blkfront against event channel storms
76ec7fe2d8 Revert "xsk: Do not sleep in poll() when need_wakeup set"
e24fc89830 bus: ti-sysc: Fix variable set but not used warning for reinit_modules
70692b0620 rcu: Mark accesses to rcu_state.n_force_qs
a9078e7914 scsi: scsi_debug: Sanity check block descriptor length in resp_mode_select()
bdb854f134 scsi: scsi_debug: Fix type in min_t to avoid stack OOB
aa1f912712 scsi: scsi_debug: Don't call kcalloc() if size arg is zero
6859985a2f ovl: fix warning in ovl_create_real()
5fd7d62daa fuse: annotate lock in fuse_reverse_inval_entry()
b99bdf127a media: mxl111sf: change mutex_init() location
0413f7a1a5 xsk: Do not sleep in poll() when need_wakeup set
6b8d8ecdd9 ARM: dts: imx6ull-pinfunc: Fix CSI_DATA07__ESAI_TX0 pad name
8affa1b68d Input: touchscreen - avoid bitwise vs logical OR warning
aec5897b27 drm/amdgpu: correct register access for RLC_JUMP_TABLE_RESTORE
c1d519263d libata: if T_LENGTH is zero, dma direction should be DMA_NONE
a9f2c6af5a timekeeping: Really make sure wall_to_monotonic isn't positive
6471ebcd6f serial: 8250_fintek: Fix garbled text for console
a7c8067453 iocost: Fix divide-by-zero on donation from low hweight cgroup
bcebb8eb19 zonefs: add MODULE_ALIAS_FS
1c414ff63b btrfs: fix double free of anon_dev after failure to create subvolume
005d9292b5 btrfs: fix memory leak in __add_inode_ref()
cd98cb5216 USB: serial: option: add Telit FN990 compositions
5c93584d9a USB: serial: cp210x: fix CP2105 GPIO registration
8f207f1263 usb: xhci: Extend support for runtime power management for AMD's Yellow carp.
e5949933f3 PCI/MSI: Mask MSI-X vectors only on success
f8aa09186c PCI/MSI: Clear PCI_MSIX_FLAGS_MASKALL on error
d17c5a3897 usb: dwc2: fix STM ID/VBUS detection startup delay in dwc2_driver_probe
2b2edc8fc5 USB: NO_LPM quirk Lenovo USB-C to Ethernet Adapher(RTL8153-04)
fd623e16b2 tty: n_hdlc: make n_hdlc_tty_wakeup() asynchronous
9439fabfc3 KVM: x86: Drop guest CPUID check for host initiated writes to MSR_IA32_PERF_CAPABILITIES
5fe305c6d4 Revert "usb: early: convert to readl_poll_timeout_atomic()"
2b54f485f2 USB: gadget: bRequestType is a bitfield, not a enum
151ffac3ac powerpc/85xx: Fix oops when CONFIG_FSL_PMC=n
fcf9194d36 bpf, selftests: Fix racing issue in btf_skc_cls_ingress test
6f46c59e60 sit: do not call ipip6_dev_free() from sit_init_net()
6e1011cd18 net: systemport: Add global locking for descriptor lifecycle
d1765f984c net/smc: Prevent smc_release() from long blocking
337bb7bf7c net: Fix double 0x prefix print in SKB dump
734a3f3106 sfc_ef100: potential dereference of null pointer
7da349f07e net/packet: rx_owner_map depends on pg_vec
1a34fb9e2b netdevsim: Zero-initialize memory for new map's value in function nsim_bpf_map_alloc
d3e1f54508 ixgbe: set X550 MDIO speed before talking to PHY
48e01e3881 ixgbe: Document how to enable NBASE-T support
776ed8b366 igc: Fix typo in i225 LTR functions
74a16e062b igbvf: fix double free in `igbvf_probe`
ddac50d04f igb: Fix removal of unicast MAC filters of VFs
12c1938870 soc/tegra: fuse: Fix bitwise vs. logical OR warning
451f1eded7 mptcp: clear 'kern' flag from fallback sockets
222cebd995 drm/amd/pm: fix a potential gpu_metrics_table memory leak
74dc97dfb2 rds: memory leak in __rds_conn_create()
67f4362ae2 flow_offload: return EOPNOTSUPP for the unsupported mpls action type
03fd6ca056 mac80211: fix lookup when adding AddBA extension element
bef59d6a83 mac80211: agg-tx: don't schedule_and_wake_txq() under sta->lock
96bc86cac0 drm/ast: potential dereference of null pointer
cac0fd4b9b selftest/net/forwarding: declare NETIFS p9 p10
81fbdd4565 net/sched: sch_ets: don't remove idle classes from the round-robin list
be32c8a788 dmaengine: st_fdma: fix MODULE_ALIAS
dfff1d5e85 selftests: Fix IPv6 address bind tests
08896ecfff selftests: Fix raw socket bind tests with VRF
5ba4dfb8b8 selftests: Add duplicate config only for MD5 VRF tests
12512bc8f2 net: hns3: fix use-after-free bug in hclgevf_send_mbx_msg
3a4f6dba1e inet_diag: fix kernel-infoleak for UDP sockets
20ad1ef02f sch_cake: do not call cake_destroy() from cake_init()
1208b445a4 s390/kexec_file: fix error handling when applying relocations
c058c544e7 selftests: net: Correct ping6 expected rc from 2 to 1
9983425c20 virtio/vsock: fix the transport to work with VMADDR_CID_ANY
94a01e6fb2 soc: imx: Register SoC device only on i.MX boards
cc426a91d3 clk: Don't parent clks until the parent is fully registered
429bb01e4d ARM: socfpga: dts: fix qspi node compatible
7b4cc168d9 ceph: initialize pathlen variable in reconnect_caps_cb
e0f06c32af ceph: fix duplicate increment of opened_inodes metric
640e28d618 tee: amdtee: fix an IS_ERR() vs NULL bug
eed897a222 mac80211: track only QoS data frames for admission control
24983f7508 arm64: dts: rockchip: fix audio-supply for Rock Pi 4
49bd597719 arm64: dts: rockchip: fix rk3399-leez-p710 vcc3v3-lan supply
9fcdbbf396 arm64: dts: rockchip: fix rk3308-roc-cc vcc-sd supply
ba866840b2 arm64: dts: rockchip: remove mmc-hs400-enhanced-strobe from rk3399-khadas-edge
3516bc1492 arm64: dts: imx8mp-evk: Improve the Ethernet PHY description
06294e7e34 arm64: dts: imx8m: correct assigned clocks for FEC
4cc6badff9 audit: improve robustness of the audit queue handling
0e21e6cd5e dm btree remove: fix use after free in rebalance_children()
f5187a9d52 recordmcount.pl: look for jgnop instruction as well as bcrl on s390
51f6302f81 vdpa: check that offsets are within bounds
e3a1ab5aea virtio_ring: Fix querying of maximum DMA mapping size for virtio device
0612679e48 bpf, selftests: Add test case trying to taint map value pointer
279e0bf80d bpf: Make 32->64 bounds propagation slightly more robust
e2aad0b5f2 bpf: Fix signed bounds propagation after mov32
f0f484714f firmware: arm_scpi: Fix string overflow in SCPI genpd driver
7fd214fc7f mac80211: validate extended element ID is present
0bb50470f1 mac80211: send ADDBA requests using the tid/queue of the aggregation session
29bb131dbb mac80211: mark TX-during-stop for TX in in_reconfig
15640e40e3 mac80211: fix regression in SSN handling of addba tx
49b7e49692 KVM: downgrade two BUG_ONs to WARN_ON_ONCE
8d0f56c2ed KVM: selftests: Make sure kvm_create_max_vcpus test won't hit RLIMIT_NOFILE
c4d08791d9 Merge 5.10.87 into android12-5.10-lts
272aedd4a3 Linux 5.10.87
8dd559d53b arm: ioremap: don't abuse pfn_valid() to check if pfn is in RAM
65c578935b arm: extend pfn_valid to take into account freed memory map alignment
6e634c0e71 memblock: ensure there is no overflow in memblock_overlaps_region()
74551f13c6 memblock: align freed memory map on pageblock boundaries with SPARSEMEM
b4b54c7ba1 memblock: free_unused_memmap: use pageblock units instead of MAX_ORDER
b6a1cbd187 perf intel-pt: Fix error timestamp setting on the decoder error path
0612aa02c2 perf intel-pt: Fix missing 'instruction' events with 'q' option
71c795028b perf intel-pt: Fix next 'err' value, walking trace
02681dd178 perf intel-pt: Fix state setting when receiving overflow (OVF) packet
cbed09b44c perf intel-pt: Fix intel_pt_fup_event() assumptions about setting state type
3bb7fd4be8 perf intel-pt: Fix sync state when a PSB (synchronization) packet is found
731ff78841 perf intel-pt: Fix some PGE (packet generation enable/control flow packets) usage
b23f9252a4 perf inject: Fix itrace space allowed for new attributes
7c26da3be1 ethtool: do not perform operations on net devices being unregistered
6992d8c215 hwmon: (dell-smm) Fix warning on /proc/i8k creation error
c31470a30c fuse: make sure reclaim doesn't write the inode
613725436e bpf: Fix integer overflow in argument calculation for bpf_map_area_alloc
9099f35126 staging: most: dim2: use device release method
ac76adc87a KVM: x86: Ignore sparse banks size for an "all CPUs", non-sparse IPI req
6f0d9d3e74 tracing: Fix a kmemleak false positive in tracing_map
f35f7f04aa drm/amd/display: add connector type check for CRC source set
dd3cea3425 drm/amd/display: Fix for the no Audio bug with Tiled Displays
dadce61247 net: netlink: af_netlink: Prevent empty skb by adding a check on len.
bca6af4325 i2c: rk3x: Handle a spurious start completion interrupt flag
d6edec8a7b parisc/agp: Annotate parisc agp init functions with __init
cf520ccffd ALSA: hda/hdmi: fix HDA codec entry table order for ADL-P
701a07fd02 ALSA: hda: Add Intel DG2 PCI ID and HDMI codec vid
6d22a96d12 net/mlx4_en: Update reported link modes for 1/10G
999069d8b0 Revert "tty: serial: fsl_lpuart: drop earlycon entry for i.MX8QXP"
27f4ce02b3 s390/test_unwind: use raw opcode instead of invalid instruction
9eab949e2b KVM: arm64: Save PSTATE early on exit
990fd815ec drm/msm/dsi: set default num_data_lanes
c602863ad2 nfc: fix segfault in nfc_genl_dump_devices_done
4f0b8b90b8 Merge 5.10.86 into android12-5.10-lts
37050f17f2 Linux 5.10.86
3241449183 netfilter: selftest: conntrack_vrf.sh: fix file permission
afc997898e Merge 5.10.85 into android12-5.10-lts
e4f2aee661 Linux 5.10.85
47301c06f6 Documentation/Kbuild: Remove references to gcc-plugin.sh
af5ba49cf7 MAINTAINERS: adjust GCC PLUGINS after gcc-plugin.sh removal
ad13421fd2 doc: gcc-plugins: update gcc-plugins.rst
9fc17c3af5 kbuild: simplify GCC_PLUGINS enablement in dummy-tools/gcc
d428e54774 bpf: Add selftests to cover packet access corner cases
0ec0eda3f3 misc: fastrpc: fix improper packet size calculation
261d45a4c2 irqchip: nvic: Fix offset for Interrupt Priority Offsets
cd946f0ebe irqchip/irq-gic-v3-its.c: Force synchronisation when issuing INVALL
e1c6611f82 irqchip/armada-370-xp: Fix support for Multi-MSI interrupts
8f3ed9deaa irqchip/armada-370-xp: Fix return value of armada_370_xp_msi_alloc()
d530e9943d irqchip/aspeed-scu: Replace update_bits with write_bits.
014c2fa5dc csky: fix typo of fpu config macro
ee86d0bad8 iio: accel: kxcjk-1013: Fix possible memory leak in probe and remove
c10c53419d iio: ad7768-1: Call iio_trigger_notify_done() on error
0f86c9e818 iio: adc: axp20x_adc: fix charging current reporting on AXP22x
af7fbb8c0b iio: adc: stm32: fix a current leak by resetting pcsel before disabling vdda
fff92f3712 iio: at91-sama5d2: Fix incorrect sign extension
a2545b147d iio: dln2: Check return value of devm_iio_trigger_register()
69ae78c1ab iio: dln2-adc: Fix lockdep complaint
416383999c iio: itg3200: Call iio_trigger_notify_done() on error
bc4d8367ed iio: kxsd9: Don't return error code in trigger handler
28ea539a31 iio: ltr501: Don't return error code in trigger handler
db12d95085 iio: mma8452: Fix trigger reference couting
4e78529110 iio: stk3310: Don't return error code in interrupt handler
5c4a0f307f iio: trigger: stm32-timer: fix MODULE_ALIAS
5de9c5b130 iio: trigger: Fix reference counting
cbc04c0c9a iio: gyro: adxrs290: fix data signedness
fee8be5bde xhci: avoid race between disable slot command and host runtime suspend
1b43c9b65f usb: core: config: using bit mask instead of individual bits
74b6a6a239 xhci: Remove CONFIG_USB_DEFAULT_PERSIST to prevent xHCI from runtime suspending
ef284f086d usb: core: config: fix validation of wMaxPacketValue entries
e4de8ca013 USB: gadget: zero allocate endpoint 0 buffers
7193ad3e50 USB: gadget: detect too-big endpoint 0 requests
63fc70bffa selftests/fib_tests: Rework fib_rp_filter_test()
126d1897cb net/qla3xxx: fix an error code in ql_adapter_up()
5e663bcd9a net, neigh: clear whole pneigh_entry at alloc time
ae67383208 net: fec: only clear interrupt of handling queue in fec_enet_rx_queue()
83b16b9c44 net: altera: set a couple error code in probe()
385ffd31eb net: cdc_ncm: Allow for dwNtbOutMaxSize to be unset or zero
47322fddb4 tools build: Remove needless libpython-version feature check that breaks test-all fast path
42bea3a1b7 dt-bindings: net: Reintroduce PHY no lane swap binding
3f57215f74 Documentation/locking/locktypes: Update migrate_disable() bits.
77d255d28b perf tools: Fix SMT detection fast read path
391ca20ea1 Revert "PCI: aardvark: Fix support for PCI_ROM_ADDRESS1 on emulated bridge"
e5b7fb2198 i40e: Fix NULL pointer dereference in i40e_dbg_dump_desc
347cc9b4d9 mtd: rawnand: fsmc: Fix timing computation
0b2e1fccdf mtd: rawnand: fsmc: Take instruction delay into account
57f290572f i40e: Fix pre-set max number of queues for VF
eb87117c27 i40e: Fix failed opcode appearing if handling messages from VF
82ed3829c9 clk: imx: use module_platform_driver
4d12546cf9 RDMA/hns: Do not destroy QP resources in the hw resetting phase
33f320c35d RDMA/hns: Do not halt commands during reset until later
4458938b29 ASoC: codecs: wcd934x: return correct value from mixer put
1089dac26c ASoC: codecs: wcd934x: handle channel mappping list correctly
83dae68fc0 ASoC: codecs: wsa881x: fix return values from kcontrol put
62e4dc5e13 ASoC: qdsp6: q6routing: Fix return value from msm_routing_put_audio_mixer
2f4764fe36 ASoC: rt5682: Fix crash due to out of scope stack vars
bdd8129c66 PM: runtime: Fix pm_runtime_active() kerneldoc comment
661c4412c5 qede: validate non LSO skb length
c4d2d7c935 scsi: scsi_debug: Fix buffer size of REPORT ZONES command
1e434d2687 scsi: pm80xx: Do not call scsi_remove_host() in pm8001_alloc()
5dfe611474 block: fix ioprio_get(IOPRIO_WHO_PGRP) vs setuid(2)
5f1f94c26b tracefs: Set all files to the same group ownership as the mount option
2ba0738f71 net: mvpp2: fix XDP rx queues registering
47ffefd88a aio: fix use-after-free due to missing POLLFREE handling
e4d19740bc aio: keep poll requests on waitqueue until completed
fc2f636ffc signalfd: use wake_up_pollfree()
9f3acee7ea binder: use wake_up_pollfree()
8e04c8397b wait: add wake_up_pollfree()
2f8eb4c4c8 libata: add horkage for ASMedia 1092
f76580d82c can: m_can: Disable and ignore ELO interrupt
703dde1120 can: pch_can: pch_can_rx_normal: fix use after free
2737d0bc21 drm/syncobj: Deal with signalled fences in drm_syncobj_find_fence.
17edb38e76 clk: qcom: regmap-mux: fix parent clock lookup
172a982244 mmc: renesas_sdhi: initialize variable properly when tuning
33204825cc tracefs: Have new files inherit the ownership of their parent
c520943a00 nfsd: Fix nsfd startup race (again)
eeb0711801 nfsd: fix use-after-free due to delegation race
8b4264c27b md: fix update super 1.0 on rdev size change
caf9b352dc btrfs: replace the BUG_ON in btrfs_del_root_ref with proper error handling
41b3cc57d6 btrfs: clear extent buffer uptodate when we fail to write it
75490bcbd0 scsi: qla2xxx: Format log strings only if needed
07977a3f3d ALSA: pcm: oss: Handle missing errors in snd_pcm_oss_change_params*()
ad45babf78 ALSA: pcm: oss: Limit the period size to 16MB
02b2b691b7 ALSA: pcm: oss: Fix negative period/buffer sizes
6760e6ddeb ALSA: hda/realtek: Fix quirk for TongFang PHxTxX1
7fe903d354 ALSA: hda/realtek - Add headset Mic support for Lenovo ALC897 platform
3063ee5164 ALSA: ctl: Fix copy of updated id with element read/write
c581090228 mm: bdi: initialize bdi_min_ratio when bdi is unregistered
06368922f3 KVM: x86: Wait for IPIs to be delivered when handling Hyper-V TLB flush hypercall
2a51edaf5c net/sched: fq_pie: prevent dismantle issue
4b7e90672a devlink: fix netns refcount leak in devlink_nl_cmd_reload()
9d683d14f6 IB/hfi1: Correct guard on eager buffer deallocation
2e2edebb5d iavf: Fix reporting when setting descriptor count
aada0b3f33 iavf: restore MSI state on reset
32a329b731 netfilter: conntrack: annotate data-races around ct->timeout
5e39de85b7 udp: using datalen to cap max gso segments
666521b385 seg6: fix the iif in the IPv6 socket control block
484069b5de nfp: Fix memory leak in nfp_cpp_area_cache_add()
b1830ede16 bonding: make tx_rebalance_counter an atomic
a59df4ea71 ice: ignore dropped packets during init
349e83c0cf bpf: Fix the off-by-two error in range markings
f26951db84 bpf, x86: Fix "no previous prototype" warning
74685aaece vrf: don't run conntrack on vrf with !dflt qdisc
d5cf399a6d selftests: netfilter: add a vrf+conntrack testcase
83ea620a1b nfc: fix potential NULL pointer deref in nfc_genl_dump_ses_done
f3d9114ac9 drm/amdkfd: fix boot failure when iommu is disabled in Picasso.
7508a9aa65 drm/amdgpu: init iommu after amdkfd device init
ac9db04ee3 drm/amdgpu: move iommu_resume before ip init/resume
fe9dca7dda drm/amdgpu: add amdgpu_amdkfd_resume_iommu
5d191b0976 drm/amdkfd: separate kfd_iommu_resume from kfd_resume
46dcf66d6e drm/amd/amdkfd: adjust dummy functions' placement
dded8d76a7 x86/sme: Explicitly map new EFI memmap table as encrypted
923f4dc5df can: sja1000: fix use after free in ems_pcmcia_add_card()
819251da71 can: kvaser_pciefd: kvaser_pciefd_rx_error_frame(): increase correct stats->{rx,tx}_errors counter
854a2bede1 can: kvaser_usb: get CAN clock frequency from device
2c08271f4e IB/hfi1: Fix leak of rcvhdrtail_dummy_kvaddr
d87c10607b IB/hfi1: Fix early init panic
d60dd3685d IB/hfi1: Insure use of smp_processor_id() is preempt disabled
05eb0e4a12 nft_set_pipapo: Fix bucket load in AVX2 lookup routine for six 8-bit groups
89f3edc98f HID: check for valid USB device for many HID drivers
889c39113f HID: wacom: fix problems when device is not a valid USB device
6272b17001 HID: bigbenff: prevent null pointer dereference
d877651afd HID: add USB_HID dependancy on some USB HID drivers
a7e9c5ddf5 HID: add USB_HID dependancy to hid-chicony
28989ed4d7 HID: add USB_HID dependancy to hid-prodikeys
6114432960 HID: add hid_is_usb() function to make it simpler for USB detection
2298d5edd8 HID: google: add eel USB id
12362cd3a4 HID: quirks: Add quirk for the Microsoft Surface 3 type-cover
cc97d73215 gcc-plugins: fix gcc 11 indigestion with plugins...
1eee36a552 gcc-plugins: simplify GCC plugin-dev capability test
518c3f98e5 usb: gadget: uvc: fix multiple opens
e2aed161fc ANDROID: GKI: fix up abi breakage in fib_rules.h
1b71a028a2 Merge 5.10.84 into android12-5.10-lts
a0582e24d3 Linux 5.10.84
e6edaf2677 ipmi: msghandler: Make symbol 'remove_work_wq' static
a8d18fb4d1 net/tls: Fix authentication failure in CCM mode
dbe73dace9 parisc: Mark cr16 CPU clocksource unstable on all SMP machines
01300d2150 iwlwifi: mvm: retry init flow if failed
a5d0a72b80 serial: 8250: Fix RTS modem control while in rs485 mode
f9802d7049 serial: 8250_pci: rewrite pericom_do_set_divisor()
50b06889c8 serial: 8250_pci: Fix ACCES entries in pci_serial_quirks array
e1722acf4f serial: core: fix transmit-buffer reset and memleak
bda142bbeb serial: tegra: Change lower tolerance baud rate limit for tegra20 and tegra30
901f7e0aa4 serial: pl011: Add ACPI SBSA UART match id
946ded2287 tty: serial: msm_serial: Deactivate RX DMA for polling support
67d08450a0 x86/64/mm: Map all kernel memory into trampoline_pgd
b3a519b5a5 x86/tsc: Disable clocksource watchdog for TSC on qualified platorms
1ed4a8fd36 x86/tsc: Add a timer to make sure TSC_adjust is always checked
a92f044a9f usb: typec: tcpm: Wait in SNK_DEBOUNCED until disconnect
6d8c191bf4 USB: NO_LPM quirk Lenovo Powered USB-C Travel Hub
90c915051c xhci: Fix commad ring abort, write all 64 bits to CRCR register.
1235485c63 vgacon: Propagate console boot parameters before calling `vc_resize'
92b9113c6d parisc: Fix "make install" on newer debian releases
c27a548d3f parisc: Fix KBUILD_IMAGE for self-extracting kernel
92f309c838 x86/entry: Add a fence for kernel entry SWAPGS in paranoid_entry()
4bbbc9c4f3 x86/pv: Switch SWAPGS to ALTERNATIVE
4d42b7bcf0 sched/uclamp: Fix rq->uclamp_max not set on first enqueue
2015ffa3a4 x86/xen: Add xenpv_restore_regs_and_return_to_usermode()
8b9279cad2 x86/entry: Use the correct fence macro after swapgs in kernel CR3
c8e3411918 x86/sev: Fix SEV-ES INS/OUTS instructions for word, dword, and qword
64ca109bf8 KVM: VMX: Set failure code in prepare_vmcs02()
60ce9a7540 KVM: x86/pmu: Fix reserved bits for AMD PerfEvtSeln register
cfebd5a277 atlantic: Remove warn trace message.
95f6fae9a0 atlantic: Fix statistics logic for production hardware
695d9c6bc6 Remove Half duplex mode speed capabilities.
0c67e7b98f atlantic: Add missing DIDs and fix 115c.
ca350298bc atlantic: Fix to display FW bundle version instead of FW mac version.
93a4f3f4fd atlatnic: enable Nbase-t speeds with base-t
44812111a3 atlantic: Increase delay for fw transactions
13f290d5aa drm/msm: Do hw_init() before capturing GPU state
d646856a60 drm/msm/a6xx: Allocate enough space for GMU registers
a792b3d564 net/smc: Keep smc_close_final rc during active close
e226180acc net/rds: correct socket tunable error in rds_tcp_tune()
77731fede2 net/smc: fix wrong list_del in smc_lgr_cleanup_early
9a40a1e0eb ipv4: convert fib_num_tclassid_users to atomic_t
fa973bf5fd net: annotate data-races on txq->xmit_lock_owner
e26dab79e1 dpaa2-eth: destroy workqueue at the end of remove function
dde240695d net: marvell: mvpp2: Fix the computation of shared CPUs
3260b8d120 net: usb: lan78xx: lan78xx_phy_init(): use PHY_POLL instead of "0" if no IRQ is available
acef1c2b15 ALSA: intel-dsp-config: add quirk for CML devices based on ES8336 codec
60f0b9c42c rxrpc: Fix rxrpc_local leak in rxrpc_lookup_peer()
35b40f724c rxrpc: Fix rxrpc_peer leak in rxrpc_look_up_bundle()
4afb32090a ASoC: tegra: Fix kcontrol put callback in AHUB
fe4eb5297a ASoC: tegra: Fix kcontrol put callback in DSPK
256aa15aac ASoC: tegra: Fix kcontrol put callback in DMIC
1cf1f9a1f3 ASoC: tegra: Fix kcontrol put callback in I2S
0ee53a1d88 ASoC: tegra: Fix kcontrol put callback in ADMAIF
e6fb4c3fd3 ASoC: tegra: Fix wrong value type in DSPK
0265ef0dff ASoC: tegra: Fix wrong value type in DMIC
e66e75fb22 ASoC: tegra: Fix wrong value type in I2S
6b54c0d845 ASoC: tegra: Fix wrong value type in ADMAIF
932b338f4e mt76: mt7915: fix NULL pointer dereference in mt7915_get_phy_mode
a0335cda6d selftests: net: Correct case name
f1d43efa59 net/mlx4_en: Fix an use-after-free bug in mlx4_en_try_alloc_resources()
59d2dc7710 arm64: ftrace: add missing BTIs
ef55f0f8af siphash: use _unaligned version by default
fd52e1f8c0 net: mpls: Fix notifications when deleting a device
15fa12c119 net: qlogic: qlcnic: Fix a NULL pointer dereference in qlcnic_83xx_add_rings()
c6f340a331 tcp: fix page frag corruption on page fault
aa6c393a3c natsemi: xtensa: fix section mismatch warnings
289ee320b5 i2c: cbus-gpio: set atomic transfer callback
58d5c53f25 i2c: stm32f7: stop dma transfer in case of NACK
c221244917 i2c: stm32f7: recover the bus on access timeout
8de6ea757c i2c: stm32f7: flush TX FIFO upon transfer errors
1c75779dd9 wireguard: ratelimiter: use kvcalloc() instead of kvzalloc()
cb2d7c1992 wireguard: receive: drop handshakes if queue lock is contended
8a29a50dbd wireguard: receive: use ring buffer for incoming handshakes
e3be118327 wireguard: device: reset peer src endpoint when netns exits
f7b6672fab wireguard: selftests: rename DEBUG_PI_LIST to DEBUG_PLIST
0584bf51c3 wireguard: selftests: actually test for routing loops
3d1dc3c677 wireguard: allowedips: add missing __rcu annotation to satisfy sparse
4caf965f6c wireguard: selftests: increase default dmesg log size
3d73021f8d tracing/histograms: String compares should not care about signed values
d4af6d9749 KVM: X86: Use vcpu->arch.walk_mmu for kvm_mmu_invlpg()
c71b5f37b5 KVM: arm64: Avoid setting the upper 32 bits of TCR_EL2 and CPTR_EL2 to 1
5f33887a36 KVM: x86: Use a stable condition around all VT-d PI paths
7722e88505 KVM: nVMX: Flush current VPID (L1 vs. L2) for KVM_REQ_TLB_FLUSH_GUEST
6a44f200f1 KVM: Disallow user memslot with size that exceeds "unsigned long"
775191dd4c drm/amd/display: Allow DSC on supported MST branch devices
209d35ee34 ipv6: fix memory leak in fib6_rule_suppress
16c242b091 sata_fsl: fix warning in remove_proc_entry when rmmod sata_fsl
4a46b2f5dc sata_fsl: fix UAF in sata_fsl_port_stop when rmmod sata_fsl
4baba6ba56 fget: check that the fd still exists after getting a ref to it
80bfed369b s390/pci: move pseudo-MMIO to prevent MIO overlap
92283c2728 cpufreq: Fix get_cpu_device() failure in add_cpu_dev_symlink()
f717f29e84 ipmi: Move remove_work to dedicated workqueue
de4f5eb02c rt2x00: do not mark device gone on EPROTO errors during start
c200721f8e kprobes: Limit max data_size of the kretprobe instances
2a74c13dfe vrf: Reset IPCB/IP6CB when processing outbound pkts in vrf dev xmit
136cabf157 ACPI: Add stubs for wakeup handler functions
cc443ac5bb net/smc: Avoid warning of possible recursive locking
ff061b5bda perf report: Fix memory leaks around perf_tip()
a4c17ebdd6 perf hist: Fix memory leak of a perf_hpp_fmt
d9b72274f3 perf inject: Fix ARM SPE handling
2c15d2a6ba net: ethernet: dec: tulip: de4x5: fix possible array overflows in type3_infoblock()
f059fa40f0 net: tulip: de4x5: fix the problem that the array 'lp->phy[8]' may be out of bound
4d5968ea06 ipv6: check return value of ipv6_skip_exthdr
22519eff7d ethernet: hisilicon: hns: hns_dsaf_misc: fix a possible array overflow in hns_dsaf_ge_srst_by_port()
9a32d3c08d ata: ahci: Add Green Sardine vendor ID as board_ahci_mobile
c746945fb6 drm/amd/amdgpu: fix potential memleak
74aafe99ef drm/amd/amdkfd: Fix kernel panic when reset failed and been triggered again
f0c9f49b0c scsi: iscsi: Unblock session then wake up error handler
bc8c423a28 thermal: core: Reset previous low and high trip during thermal zone init
8e4d2ac434 btrfs: check-integrity: fix a warning on write caching disabled disk
0395722905 s390/setup: avoid using memblock_enforce_memory_limit
fd1e70ef65 platform/x86: thinkpad_acpi: Fix WWAN device disabled issue after S3 deep
226b21ad01 platform/x86: thinkpad_acpi: Add support for dual fan control
3fc88660ed net: return correct error code
2c514d2500 atlantic: Fix OOB read and write in hw_atl_utils_fw_rpc_wait
ff6eeb6278 net/smc: Transfer remaining wait queue entries during fallback
e1a165599a mac80211: do not access the IV when it was stripped
c386d7aa59 drm/sun4i: fix unmet dependency on RESET_CONTROLLER for PHY_SUN6I_MIPI_DPHY
57e36973fa powerpc/pseries/ddw: Revert "Extend upper limit for huge DMA window for persistent memory"
7b2b7e03e8 gfs2: Fix length of holes reported at end-of-file
664cceab6f gfs2: release iopen glock early in evict
bcce010f92 ovl: fix deadlock in splice write
dca4f9a581 ovl: simplify file splice
7774dd934a can: j1939: j1939_tp_cmd_recv(): check the dst address of TP.CM_BAM
60ae63ef19 NFSv42: Fix pagecache invalidation after COPY/CLONE
6e6898e23c ANDROID: GKI: update abi_gki_aarch64.xml due to bpf changes in 5.10.83
cd1062d64e Revert "net: ipv6: add fib6_nh_release_dsts stub"
0bf59ac0b2 Revert "net: nexthop: release IPv6 per-cpu dsts when replacing a nexthop group"
65836a68d9 Revert "mmc: sdhci: Fix ADMA for PAGE_SIZE >= 64KiB"
249dae115a Merge 5.10.83 into android-5.10
bc8ae0e2af Merge branch 'android12-5.10' into `android12-5.10-lts`
a324ad7945 Linux 5.10.83
45b42cd053 drm/amdgpu/gfx9: switch to golden tsc registers for renoir+
98b02755d5 net: stmmac: platform: fix build warning when with !CONFIG_PM_SLEEP
a15261d2a1 shm: extend forced shm destroy to support objects from several IPC nses
aa20e966d8 s390/mm: validate VMA in PGSTE manipulation functions
a94e4a7b77 tty: hvc: replace BUG_ON() with negative return value
1c5f722a8f xen/netfront: don't trust the backend response data blindly
334b0f2787 xen/netfront: disentangle tx_skb_freelist
e17ee047ee xen/netfront: don't read data from request on the ring page
f5e4937098 xen/netfront: read response from backend only once
1ffb20f052 xen/blkfront: don't trust the backend response data blindly
8e147855fc xen/blkfront: don't take local copy of a request from the ring page
273f04d5d1 xen/blkfront: read response from backend only once
b98284aa3f xen: sync include/xen/interface/io/ring.h with Xen's newest version
406f2d5fe3 tracing: Check pid filtering when creating events
4fd0ad08ee vhost/vsock: fix incorrect used length reported to the guest
fbc0514e1a iommu/amd: Clarify AMD IOMMUv2 initialization messages
5655b8bccb smb3: do not error on fsync when readonly
c380062d08 ceph: properly handle statfs on multifs setups
22423c966e f2fs: set SBI_NEED_FSCK flag when inconsistent node block found
e6ee7abd6b sched/scs: Reset task stack state in bringup_cpu()
71e38a0c7c tcp: correctly handle increased zerocopy args struct size
72f2117e45 net: mscc: ocelot: correctly report the timestamping RX filters in ethtool
73115a2b38 net: mscc: ocelot: don't downgrade timestamping RX filters in SIOCSHWTSTAMP
62343dadbb net: hns3: fix VF RSS failed problem after PF enable multi-TCs
215167df45 net/smc: Don't call clcsock shutdown twice when smc shutdown
6e800ee432 net: vlan: fix underflow for the real_dev refcnt
ae2659d2c6 net/sched: sch_ets: don't peek at classes beyond 'nbands'
e3509feb46 tls: fix replacing proto_ops
22156242b1 tls: splice_read: fix record type check
3b6c71c097 MIPS: use 3-level pgtable for 64KB page size on MIPS_VA_BITS_48
a6a5d853f1 MIPS: loongson64: fix FTLB configuration
5e823dbee2 igb: fix netpoll exit with traffic
f2a58ff3e3 nvmet: use IOCB_NOWAIT only if the filesystem supports it
12ceb52f2c net/smc: Fix loop in smc_listen
c94cbd262b net/smc: Fix NULL pointer dereferencing in smc_vlan_by_tcpsk()
3d4937c6a3 net: phylink: Force retrigger in case of latched link-fail indicator
50162ff3c8 net: phylink: Force link down and retrigger resolve on interface change
95ba8f0d57 lan743x: fix deadlock in lan743x_phy_link_status_change()
c5e4316d9c tcp_cubic: fix spurious Hystart ACK train detections for not-cwnd-limited flows
3187623096 drm/amd/display: Set plane update flags for all planes in reset
f634c755a0 PM: hibernate: use correct mode for swsusp_close()
440bd9faad net/ncsi : Add payload to be 32-bit aligned to fix dropped packets
ac88cb3c44 nvmet-tcp: fix incomplete data digest send
8889ff80fd net: marvell: mvpp2: increase MTU limit when XDP enabled
90d0736876 mlxsw: spectrum: Protect driver from buggy firmware
33d89128a9 mlxsw: Verify the accessed index doesn't exceed the array length
29e1b57347 net/smc: Ensure the active closing peer first closes clcsock
77d9c2efa8 erofs: fix deadlock when shrink erofs slab
9f540c7ffb scsi: scsi_debug: Zero clear zones at reset write pointer
725ba12895 scsi: core: sysfs: Fix setting device state to SDEV_RUNNING
e65a8707b4 ice: avoid bpf_prog refcount underflow
1eb5395add ice: fix vsi->txq_map sizing
26ed13d064 net: nexthop: release IPv6 per-cpu dsts when replacing a nexthop group
3c40584595 net: ipv6: add fib6_nh_release_dsts stub
dc2f7e9d8d net: stmmac: retain PTP clock time during SIOCSHWTSTAMP ioctls
79068e6b1c net: stmmac: fix system hang caused by eee_ctrl_timer during suspend/resume
cc301ad312 nfp: checking parameter process for rx-usecs/tx-usecs is invalid
9b44cb67d3 ipv6: fix typos in __ip6_finish_output()
6d9e8dabd4 firmware: smccc: Fix check for ARCH_SOC_ID not implemented
bbd1683e79 mptcp: fix delack timer
061542815a ALSA: intel-dsp-config: add quirk for JSL devices based on ES8336 codec
f5af2def7e iavf: Prevent changing static ITR values if adaptive moderation is on
5dca8eff46 net: marvell: prestera: fix double free issue on err path
b33c5c8281 drm/vc4: fix error code in vc4_create_object()
2bf9c5a503 scsi: mpt3sas: Fix kernel panic during drive powercycle test
29ecb4c0f0 drm/nouveau/acr: fix a couple NULL vs IS_ERR() checks
0effb7f51b ARM: socfpga: Fix crash with CONFIG_FORTIRY_SOURCE
86c5adc780 NFSv42: Don't fail clone() unless the OP_CLONE operation failed
c9ba7864d3 firmware: arm_scmi: pm: Propagate return value to caller
8730a679c3 net: ieee802154: handle iftypes as u32
2925aadd1f ASoC: codecs: wcd934x: return error code correctly from hw_params
3a25def06d ASoC: topology: Add missing rwsem around snd_ctl_remove() calls
4a4f900e04 ASoC: qdsp6: q6asm: fix q6asm_dai_prepare error handling
9196a68581 ASoC: qdsp6: q6routing: Conditionally reset FrontEnd Mixer
2be17eca48 ARM: dts: bcm2711: Fix PCIe interrupts
9db1d4a3c2 ARM: dts: BCM5301X: Add interrupt properties to GPIO node
b2cd6fdcbe ARM: dts: BCM5301X: Fix I2C controller interrupt
b7ef25e8c2 netfilter: flowtable: fix IPv6 tunnel addr match
d689176e0e netfilter: ipvs: Fix reuse connection if RS weight is 0
994065f6ef netfilter: ctnetlink: do not erase error code with EINVAL
a3d829e5f3 netfilter: ctnetlink: fix filtering with CTA_TUPLE_REPLY
a8a917058f proc/vmcore: fix clearing user buffer by properly using clear_user()
1f520a0d78 PCI: aardvark: Fix link training
aec0751f61 PCI: aardvark: Simplify initialization of rootcap on virtual bridge
df57480988 PCI: aardvark: Implement re-issuing config requests on CRS response
e7f2e2c758 PCI: aardvark: Update comment about disabling link training
2b7bc1c4b2 PCI: aardvark: Deduplicate code in advk_pcie_rd_conf()
dfe906da9a powerpc/32: Fix hardlockup on vmap stack overflow
bf00edd9e6 mdio: aspeed: Fix "Link is Down" issue
14c3ce30dd mmc: sdhci: Fix ADMA for PAGE_SIZE >= 64KiB
63195705b3 mmc: sdhci-esdhc-imx: disable CMDQ support
092a58f0d9 tracing: Fix pid filtering when triggers are attached
68fa6bf7f1 tracing/uprobe: Fix uprobe_perf_open probes iteration
b777c866aa KVM: PPC: Book3S HV: Prevent POWER7/8 TLB flush flushing SLB
bfed9c2f2f xen: detect uninitialized xenbus in xenbus_init
e1d492c275 xen: don't continue xenstore initialization in case of errors
8f4d0719f3 fuse: release pipe buf after last use
8d0163cec7 staging: rtl8192e: Fix use after free in _rtl92e_pci_disconnect()
0bfed81b2c staging: greybus: Add missing rwsem around snd_ctl_remove() calls
146283f16b staging/fbtft: Fix backlight
8fc5e3c7ca HID: wacom: Use "Confidence" flag to prevent reporting invalid contacts
6ca32e2e77 Revert "parisc: Fix backtrace to always include init funtion names"
3a4aeb37a7 media: cec: copy sequence field for the reply
3798218a1a ALSA: hda/realtek: Fix LED on HP ProBook 435 G7
60274e248e ALSA: hda/realtek: Add quirk for ASRock NUC Box 1100
172167bc8d ALSA: ctxfi: Fix out-of-range access
4402cf0402 binder: fix test regression due to sender_euid change
aea184ae64 usb: hub: Fix locking issues with address0_mutex
5bf3a0c778 usb: hub: Fix usb enumeration issue due to address0 race
00f1038c72 usb: typec: fusb302: Fix masking of comparator and bc_lvl interrupts
56fbab4937 usb: chipidea: ci_hdrc_imx: fix potential error pointer dereference in probe
b70ff391de net: nexthop: fix null pointer dereference when IPv6 is not enabled
0755f3f322 usb: dwc3: gadget: Fix null pointer exception
140e2df472 usb: dwc3: gadget: Check for L1/L2/U3 for Start Transfer
3abf746e80 usb: dwc3: gadget: Ignore NoStream after End Transfer
2b7ab82f51 usb: dwc2: hcd_queue: Fix use of floating point literal
4b18ccad96 usb: dwc2: gadget: Fix ISOC flow for elapsed frames
16f1cac8f7 USB: serial: option: add Fibocom FM101-GL variants
ff72128636 USB: serial: option: add Telit LE910S1 0x9200 composition
854c14b2a1 ACPI: Get acpi_device's parent from the parent field
33fe044f6a bpf: Fix toctou on read-only map's constant scalar tracking
8d21bcc704 Merge 5.10.82 into android12-5.10-lts
d5259a9ba6 Linux 5.10.82
d35250ec5a Revert "perf: Rework perf_event_exit_event()"
6718f79c40 ALSA: hda: hdac_stream: fix potential locking issue in snd_hdac_stream_assign()
f751fb54f2 ALSA: hda: hdac_ext_stream: fix potential locking issues
b3ef5051a7 x86/Kconfig: Fix an unused variable error in dell-smm-hwmon
2ec78af152 btrfs: update device path inode time instead of bd_inode
9febc9d8d2 fs: export an inode_update_time helper
cade5d7a28 ice: Delete always true check of PF pointer
fe65cecd27 usb: max-3421: Use driver data instead of maintaining a list of bound devices
6186c7b9bd ASoC: DAPM: Cover regression by kctl change notification fix
b17dd53cac selinux: fix NULL-pointer dereference when hashtab allocation fails
1ae0d59c4f RDMA/netlink: Add __maybe_unused to static inline in C file
40bc831ab5 hugetlbfs: flush TLBs correctly after huge_pmd_unshare
86ab0f8ff0 scsi: ufs: core: Fix task management completion timeout race
ddd4e46cff scsi: ufs: core: Fix task management completion
04c586a601 drm/amdgpu: fix set scaling mode Full/Full aspect/Center not works on vga and dvi connectors
47901b77bf drm/i915/dp: Ensure sink rate values are always valid
82de15ca6b drm/nouveau: clean up all clients on device removal
c81c90fbf5 drm/nouveau: use drm_dev_unplug() during device removal
9221aff33e drm/nouveau: Add a dedicated mutex for the clients list
65517975cb drm/udl: fix control-message timeout
3d68d6ee83 drm/amd/display: Update swizzle mode enums
7b97b5776d cfg80211: call cfg80211_stop_ap when switch from P2P_GO type
1ab297809d parisc/sticon: fix reverse colors
6adbc07ebc btrfs: fix memory ordering between normal and ordered work functions
6289b494b3 net: stmmac: socfpga: add runtime suspend/resume callback for stratix10 platform
5875f87e2f udf: Fix crash after seekdir
6b43cf113a KVM: nVMX: don't use vcpu->arch.efer when checking host state on nested state load
cc73242889 block: Check ADMIN before NICE for IOPRIO_CLASS_RT
63e2f34abc s390/kexec: fix memory leak of ipl report buffer
b1cf0d2fc4 scsi: qla2xxx: Fix mailbox direction flags in qla2xxx_get_adapter_id()
08fd6df8ea powerpc/8xx: Fix pinned TLBs with CONFIG_STRICT_KERNEL_RWX
9c177eee11 x86/hyperv: Fix NULL deref in set_hv_tscchange_cb() if Hyper-V setup fails
b2e2fb6407 mm: kmemleak: slob: respect SLAB_NOLEAKTRACE flag
99032adf7d ipc: WARN if trying to remove ipc object which is absent
a7d9162586 tipc: check for null after calling kmemdup
f5995fcb75 hexagon: clean up timer-regs.h
0854c9ff21 hexagon: export raw I/O routines for modules
528971af64 tun: fix bonding active backup with arp monitoring
af1d3c437e arm64: vdso32: suppress error message for 'make mrproper'
97653ba562 net: stmmac: dwmac-rk: Fix ethernet on rk3399 based devices
4cebe23c03 s390/kexec: fix return code handling
d4fb80ae98 perf/x86/intel/uncore: Fix IIO event constraints for Skylake Server
175135a5ea perf/x86/intel/uncore: Fix filter_tid mask for CHA events on Skylake Server
84f64c7c52 pinctrl: qcom: sdm845: Enable dual edge errata
a8230fb74b KVM: PPC: Book3S HV: Use GLOBAL_TOC for kvmppc_h_set_dabr/xdabr()
4e6cce20fb e100: fix device suspend/resume
34e54703fb NFC: add NCI_UNREG flag to eliminate the race
b2a60b4a01 net: nfc: nci: Change the NCI close sequence
73a0d12114 NFC: reorder the logic in nfc_{un,}register_device
cb14b196d9 NFC: reorganize the functions in nci_request
41dc8dcb49 i40e: Fix display error code in dmesg
028ea7b090 i40e: Fix creation of first queue by omitting it if is not power of two
69868d7a88 i40e: Fix warning message and call stack during rmmod i40e driver
20645482d1 i40e: Fix ping is lost after configuring ADq on VF
6d64743045 i40e: Fix changing previously set num_queue_pairs for PFs
f866513ead i40e: Fix NULL ptr dereference on VSI filter sync
0719488565 i40e: Fix correct max_pkt_size on VF RX queue
8e6bae950d net: virtio_net_hdr_to_skb: count transport header in UFO
1c4099dc0d net: dpaa2-eth: fix use-after-free in dpaa2_eth_remove
381a30f7e3 net: sched: act_mirred: drop dst for the direction from egress to ingress
a792e0128d scsi: core: sysfs: Fix hang when device state is set via sysfs
4b4302a02b net/mlx5: E-Switch, return error if encap isn't supported
68748ea4d1 net/mlx5: E-Switch, Change mode lock from mutex to rw semaphore
6190e1a2d4 net/mlx5: Lag, update tracker when state change event received
471c492890 net/mlx5e: nullify cq->dbg pointer in mlx5_debug_cq_remove()
d1f8f1e04a platform/x86: hp_accel: Fix an error handling path in 'lis3lv02d_probe()'
da16f907cb mips: lantiq: add support for clk_get_parent()
17dfbe1b2f mips: bcm63xx: add support for clk_get_parent()
34284b3a2f MIPS: generic/yamon-dt: fix uninitialized variable error
a61f90b216 iavf: Fix for setting queues to 0
a8a1e601c2 iavf: Fix for the false positive ASQ/ARQ errors while issuing VF reset
77f5ae5441 iavf: validate pointers
ddcc185baa iavf: prevent accidental free of filter structure
a420b26128 iavf: Fix failure to exit out from last all-multicast mode
78638b4713 iavf: free q_vectors before queues in iavf_disable_vf
84a13bfe27 iavf: check for null in iavf_fix_features
1555d83ddb iavf: Fix return of set the new channel count
09decd0a10 net/smc: Make sure the link_id is unique
437e21e2c9 sock: fix /proc/net/sockstat underflow in sk_clone_lock()
4da14ddad1 net: reduce indentation level in sk_clone_lock()
9c3c2ef6ca tipc: only accept encrypted MSG_CRYPTO msgs
3d59416647 bnxt_en: reject indirect blk offload when hw-tc-offload is off
4fc060abaa net: bnx2x: fix variable dereferenced before check
3ae75cc38a net: ipa: disable HOLB drop when updating timer
3984876f91 tracing: Add length protection to histogram string copies
900ea2f628 tcp: Fix uninitialized access in skb frags array for Rx 0cp.
d1a6150ca6 net-zerocopy: Refactor skb frag fast-forward op.
5f7aadf03f net-zerocopy: Copy straggler unaligned data for TCP Rx. zerocopy.
8da80ec6d4 drm/nouveau: hdmigv100.c: fix corrupted HDMI Vendor InfoFrame
aa31e3fda6 perf tests: Remove bash construct from record+zstd_comp_decomp.sh
2ada5c0877 perf bench futex: Fix memory leak of perf_cpu_map__new()
11589d3144 perf bpf: Avoid memory leak from perf_env__insert_btf()
5b2f2cbbc9 tracing/histogram: Do not copy the fixed-size char array field over the field size
1d61255327 blkcg: Remove extra blkcg_bio_issue_init
dadcc935f4 perf/x86/vlbr: Add c->flags to vlbr event constraints
68fcb52b61 sched/core: Mitigate race cpus_share_cache()/update_top_cache_domain()
91191d47af mips: BCM63XX: ensure that CPU_SUPPORTS_32BIT_KERNEL is set
fbe27d0e1d clk: qcom: gcc-msm8996: Drop (again) gcc_aggre1_pnoc_ahb_clk
9b3d3b72be clk/ast2600: Fix soc revision for AHB
03bc8ea0ae clk: ingenic: Fix bugs with divided dividers
7a5439474e f2fs: fix incorrect return value in f2fs_sanity_check_ckpt()
0a17fff6f0 f2fs: compress: disallow disabling compress on non-empty compressed file
4ce685cc9a sh: define __BIG_ENDIAN for math-emu
73383f670d sh: math-emu: drop unused functions
f44defd569 sh: fix kconfig unmet dependency warning for FRAME_POINTER
3d7c5d08a4 f2fs: fix to use WHINT_MODE
e8bd5e3305 f2fs: fix up f2fs_lookup tracepoints
5d5bf899e5 maple: fix wrong return value of maple_bus_init().
8748f08a2f sh: check return code of request_irq
29b742690a powerpc/8xx: Fix Oops with STRICT_KERNEL_RWX without DEBUG_RODATA_TEST
bc4bc07fb4 powerpc/dcr: Use cmplwi instead of 3-argument cmpli
1ac6cd87d8 ALSA: gus: fix null pointer dereference on pointer block
850416bead ARM: dts: qcom: fix memory and mdio nodes naming for RB3011
8c4d9764e7 powerpc/5200: dts: fix memory node unit name
833ad27927 iio: imu: st_lsm6dsx: Avoid potential array overflow in st_lsm6dsx_set_odr()
e0fef1c8cd scsi: target: Fix alua_tg_pt_gps_count tracking
8176441373 scsi: target: Fix ordered tag handling
8440377e1a scsi: scsi_debug: Fix out-of-bound read in resp_report_tgtpgs()
3e20cb0726 scsi: scsi_debug: Fix out-of-bound read in resp_readcap16()
9635581aa9 MIPS: sni: Fix the build
77e9fed330 tty: tty_buffer: Fix the softlockup issue in flush_to_ldisc
da82a207c4 ALSA: ISA: not for M68K
c788ac4750 ARM: dts: ls1021a-tsn: use generic "jedec,spi-nor" compatible for flash
cbba09f869 ARM: dts: ls1021a: move thermal-zones node out of soc/
2474eb7fc3 usb: host: ohci-tmio: check return value after calling platform_get_resource()
02d9ebe0cc ARM: dts: omap: fix gpmc,mux-add-data type
c6c9bbe7fa firmware_loader: fix pre-allocated buf built-in firmware use
02a22911ed ALSA: intel-dsp-config: add quirk for APL/GLK/TGL devices based on ES8336 codec
055eced3ed scsi: advansys: Fix kernel pointer leak
97f3cbb57b ASoC: nau8824: Add DMI quirk mechanism for active-high jack-detect
ae2207a078 clk: imx: imx6ul: Move csi_sel mux to correct base register
0c6daf4799 ASoC: SOF: Intel: hda-dai: fix potential locking issue
19d193c576 arm64: dts: freescale: fix arm,sp805 compatible string
36446a094a arm64: dts: qcom: ipq6018: Fix qcom,controlled-remotely property
e52fecdd0c arm64: dts: qcom: msm8998: Fix CPU/L2 idle state latency and residency
568d94c5c9 ARM: BCM53016: Specify switch ports for Meraki MR32
3a53d9ad9b staging: rtl8723bs: remove possible deadlock when disconnect (v2)
3544c33879 ARM: dts: ux500: Skomer regulator fixes
eff8b76284 usb: typec: tipd: Remove WARN_ON in tps6598x_block_read
679eee466d usb: musb: tusb6010: check return value after calling platform_get_resource()
2492de6f5e bus: ti-sysc: Use context lost quirk for otg
5eca1c8412 bus: ti-sysc: Add quirk handling for reinit on context lost
dcd6eefcee RDMA/bnxt_re: Check if the vlan is valid before reporting
4e5bc9fb23 arm64: dts: hisilicon: fix arm,sp805 compatible string
109a63bb07 arm64: dts: rockchip: Disable CDN DP on Pinebook Pro
c097bd5a59 scsi: lpfc: Fix list_add() corruption in lpfc_drain_txq()
db90c50783 ARM: dts: NSP: Fix mpcore, mmc node names
5010df76ab staging: wfx: ensure IRQ is ready before enabling it
2651d06e46 arm64: dts: allwinner: a100: Fix thermal zone node name
fa98ac472e arm64: dts: allwinner: h5: Fix GPU thermal zone node name
aed195558f ARM: dts: sunxi: Fix OPPs node name
e2e1056312 arm64: zynqmp: Fix serial compatible string
48f154e8b9 arm64: zynqmp: Do not duplicate flash partition label property

Some minor ABI signatures have changed due to internal structures
changing.  All of these have been pre-approved already:

Leaf changes summary: 3 artifacts changed
Changed leaf types summary: 3 leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

'struct bpf_map at bpf.h:146:1' changed:
  type size hasn't changed
  there are data member changes:
    type 'typedef u64' of 'bpf_map::writecnt' changed:
      typedef name changed from u64 to atomic64_t at types.h:175:1
      underlying type 'typedef __u64' at int-ll64.h:31:1 changed:
        entity changed from 'typedef __u64' to 'struct {s64 counter;}' at types.h:173:1
        type size hasn't changed
  4790 impacted interfaces

'struct bpf_offloaded_map at bpf.h:229:1' changed (indirectly):
  type size hasn't changed
  there are data member changes:
    type 'struct bpf_map' of 'bpf_offloaded_map::map' changed, as reported earlier
  4790 impacted interfaces

'struct fib_rules_ops at fib_rules.h:60:1' changed:
  type size hasn't changed
  there are data member changes:
    type 'typedef bool (fib_rule*, fib_lookup_arg*)*' of 'fib_rules_ops::suppress' changed:
      pointer type changed from: 'typedef bool (fib_rule*, fib_lookup_arg*)*' to: 'typedef bool (fib_rule*, int, fib_lookup_arg*)*'
  4790 impacted interfaces

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id7f25c9e0edb30698178b138cc1b15a82ca5ef48
2022-03-21 14:29:02 +01:00

4465 lines
143 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* fs/f2fs/f2fs.h
*
* Copyright (c) 2012 Samsung Electronics Co., Ltd.
* http://www.samsung.com/
*/
#ifndef _LINUX_F2FS_H
#define _LINUX_F2FS_H
#include <linux/uio.h>
#include <linux/types.h>
#include <linux/page-flags.h>
#include <linux/buffer_head.h>
#include <linux/slab.h>
#include <linux/crc32.h>
#include <linux/magic.h>
#include <linux/kobject.h>
#include <linux/sched.h>
#include <linux/cred.h>
#include <linux/vmalloc.h>
#include <linux/bio.h>
#include <linux/blkdev.h>
#include <linux/quotaops.h>
#include <linux/part_stat.h>
#include <crypto/hash.h>
#include <linux/fscrypt.h>
#include <linux/fsverity.h>
#ifdef CONFIG_F2FS_CHECK_FS
#define f2fs_bug_on(sbi, condition) BUG_ON(condition)
#else
#define f2fs_bug_on(sbi, condition) \
do { \
if (WARN_ON(condition)) \
set_sbi_flag(sbi, SBI_NEED_FSCK); \
} while (0)
#endif
enum {
FAULT_KMALLOC,
FAULT_KVMALLOC,
FAULT_PAGE_ALLOC,
FAULT_PAGE_GET,
FAULT_ALLOC_NID,
FAULT_ORPHAN,
FAULT_BLOCK,
FAULT_DIR_DEPTH,
FAULT_EVICT_INODE,
FAULT_TRUNCATE,
FAULT_READ_IO,
FAULT_CHECKPOINT,
FAULT_DISCARD,
FAULT_WRITE_IO,
FAULT_MAX,
};
#ifdef CONFIG_F2FS_FAULT_INJECTION
#define F2FS_ALL_FAULT_TYPE ((1 << FAULT_MAX) - 1)
struct f2fs_fault_info {
atomic_t inject_ops;
unsigned int inject_rate;
unsigned int inject_type;
};
extern const char *f2fs_fault_name[FAULT_MAX];
#define IS_FAULT_SET(fi, type) ((fi)->inject_type & (1 << (type)))
#endif
/*
* For mount options
*/
#define F2FS_MOUNT_DISABLE_ROLL_FORWARD 0x00000002
#define F2FS_MOUNT_DISCARD 0x00000004
#define F2FS_MOUNT_NOHEAP 0x00000008
#define F2FS_MOUNT_XATTR_USER 0x00000010
#define F2FS_MOUNT_POSIX_ACL 0x00000020
#define F2FS_MOUNT_DISABLE_EXT_IDENTIFY 0x00000040
#define F2FS_MOUNT_INLINE_XATTR 0x00000080
#define F2FS_MOUNT_INLINE_DATA 0x00000100
#define F2FS_MOUNT_INLINE_DENTRY 0x00000200
#define F2FS_MOUNT_FLUSH_MERGE 0x00000400
#define F2FS_MOUNT_NOBARRIER 0x00000800
#define F2FS_MOUNT_FASTBOOT 0x00001000
#define F2FS_MOUNT_EXTENT_CACHE 0x00002000
#define F2FS_MOUNT_DATA_FLUSH 0x00008000
#define F2FS_MOUNT_FAULT_INJECTION 0x00010000
#define F2FS_MOUNT_USRQUOTA 0x00080000
#define F2FS_MOUNT_GRPQUOTA 0x00100000
#define F2FS_MOUNT_PRJQUOTA 0x00200000
#define F2FS_MOUNT_QUOTA 0x00400000
#define F2FS_MOUNT_INLINE_XATTR_SIZE 0x00800000
#define F2FS_MOUNT_RESERVE_ROOT 0x01000000
#define F2FS_MOUNT_DISABLE_CHECKPOINT 0x02000000
#define F2FS_MOUNT_NORECOVERY 0x04000000
#define F2FS_MOUNT_ATGC 0x08000000
#define F2FS_MOUNT_MERGE_CHECKPOINT 0x10000000
#define F2FS_MOUNT_GC_MERGE 0x20000000
#define F2FS_MOUNT_COMPRESS_CACHE 0x40000000
#define F2FS_OPTION(sbi) ((sbi)->mount_opt)
#define clear_opt(sbi, option) (F2FS_OPTION(sbi).opt &= ~F2FS_MOUNT_##option)
#define set_opt(sbi, option) (F2FS_OPTION(sbi).opt |= F2FS_MOUNT_##option)
#define test_opt(sbi, option) (F2FS_OPTION(sbi).opt & F2FS_MOUNT_##option)
#define ver_after(a, b) (typecheck(unsigned long long, a) && \
typecheck(unsigned long long, b) && \
((long long)((a) - (b)) > 0))
typedef u32 block_t; /*
* should not change u32, since it is the on-disk block
* address format, __le32.
*/
typedef u32 nid_t;
#define COMPRESS_EXT_NUM 16
/*
* An implementation of an rwsem that is explicitly unfair to readers. This
* prevents priority inversion when a low-priority reader acquires the read lock
* while sleeping on the write lock but the write lock is needed by
* higher-priority clients.
*/
struct f2fs_rwsem {
struct rw_semaphore internal_rwsem;
wait_queue_head_t read_waiters;
};
struct f2fs_mount_info {
unsigned int opt;
int write_io_size_bits; /* Write IO size bits */
block_t root_reserved_blocks; /* root reserved blocks */
kuid_t s_resuid; /* reserved blocks for uid */
kgid_t s_resgid; /* reserved blocks for gid */
int active_logs; /* # of active logs */
int inline_xattr_size; /* inline xattr size */
#ifdef CONFIG_F2FS_FAULT_INJECTION
struct f2fs_fault_info fault_info; /* For fault injection */
#endif
#ifdef CONFIG_QUOTA
/* Names of quota files with journalled quota */
char *s_qf_names[MAXQUOTAS];
int s_jquota_fmt; /* Format of quota to use */
#endif
/* For which write hints are passed down to block layer */
int whint_mode;
int alloc_mode; /* segment allocation policy */
int fsync_mode; /* fsync policy */
int fs_mode; /* fs mode: LFS or ADAPTIVE */
int bggc_mode; /* bggc mode: off, on or sync */
struct fscrypt_dummy_policy dummy_enc_policy; /* test dummy encryption */
block_t unusable_cap_perc; /* percentage for cap */
block_t unusable_cap; /* Amount of space allowed to be
* unusable when disabling checkpoint
*/
/* For compression */
unsigned char compress_algorithm; /* algorithm type */
unsigned char compress_log_size; /* cluster log size */
unsigned char compress_level; /* compress level */
bool compress_chksum; /* compressed data chksum */
unsigned char compress_ext_cnt; /* extension count */
int compress_mode; /* compression mode */
unsigned char extensions[COMPRESS_EXT_NUM][F2FS_EXTENSION_LEN]; /* extensions */
};
#define F2FS_FEATURE_ENCRYPT 0x0001
#define F2FS_FEATURE_BLKZONED 0x0002
#define F2FS_FEATURE_ATOMIC_WRITE 0x0004
#define F2FS_FEATURE_EXTRA_ATTR 0x0008
#define F2FS_FEATURE_PRJQUOTA 0x0010
#define F2FS_FEATURE_INODE_CHKSUM 0x0020
#define F2FS_FEATURE_FLEXIBLE_INLINE_XATTR 0x0040
#define F2FS_FEATURE_QUOTA_INO 0x0080
#define F2FS_FEATURE_INODE_CRTIME 0x0100
#define F2FS_FEATURE_LOST_FOUND 0x0200
#define F2FS_FEATURE_VERITY 0x0400
#define F2FS_FEATURE_SB_CHKSUM 0x0800
#define F2FS_FEATURE_CASEFOLD 0x1000
#define F2FS_FEATURE_COMPRESSION 0x2000
#define F2FS_FEATURE_RO 0x4000
#define __F2FS_HAS_FEATURE(raw_super, mask) \
((raw_super->feature & cpu_to_le32(mask)) != 0)
#define F2FS_HAS_FEATURE(sbi, mask) __F2FS_HAS_FEATURE(sbi->raw_super, mask)
#define F2FS_SET_FEATURE(sbi, mask) \
(sbi->raw_super->feature |= cpu_to_le32(mask))
#define F2FS_CLEAR_FEATURE(sbi, mask) \
(sbi->raw_super->feature &= ~cpu_to_le32(mask))
/*
* Default values for user and/or group using reserved blocks
*/
#define F2FS_DEF_RESUID 0
#define F2FS_DEF_RESGID 0
/*
* For checkpoint manager
*/
enum {
NAT_BITMAP,
SIT_BITMAP
};
#define CP_UMOUNT 0x00000001
#define CP_FASTBOOT 0x00000002
#define CP_SYNC 0x00000004
#define CP_RECOVERY 0x00000008
#define CP_DISCARD 0x00000010
#define CP_TRIMMED 0x00000020
#define CP_PAUSE 0x00000040
#define CP_RESIZE 0x00000080
#define MAX_DISCARD_BLOCKS(sbi) BLKS_PER_SEC(sbi)
#define DEF_MAX_DISCARD_REQUEST 8 /* issue 8 discards per round */
#define DEF_MIN_DISCARD_ISSUE_TIME 50 /* 50 ms, if exists */
#define DEF_MID_DISCARD_ISSUE_TIME 500 /* 500 ms, if device busy */
#define DEF_MAX_DISCARD_ISSUE_TIME 60000 /* 60 s, if no candidates */
#define DEF_DISCARD_URGENT_UTIL 80 /* do more discard over 80% */
#define DEF_CP_INTERVAL 60 /* 60 secs */
#define DEF_IDLE_INTERVAL 5 /* 5 secs */
#define DEF_DISABLE_INTERVAL 5 /* 5 secs */
#define DEF_DISABLE_QUICK_INTERVAL 1 /* 1 secs */
#define DEF_UMOUNT_DISCARD_TIMEOUT 5 /* 5 secs */
struct cp_control {
int reason;
__u64 trim_start;
__u64 trim_end;
__u64 trim_minlen;
};
/*
* indicate meta/data type
*/
enum {
META_CP,
META_NAT,
META_SIT,
META_SSA,
META_MAX,
META_POR,
DATA_GENERIC, /* check range only */
DATA_GENERIC_ENHANCE, /* strong check on range and segment bitmap */
DATA_GENERIC_ENHANCE_READ, /*
* strong check on range and segment
* bitmap but no warning due to race
* condition of read on truncated area
* by extent_cache
*/
META_GENERIC,
};
/* for the list of ino */
enum {
ORPHAN_INO, /* for orphan ino list */
APPEND_INO, /* for append ino list */
UPDATE_INO, /* for update ino list */
TRANS_DIR_INO, /* for trasactions dir ino list */
FLUSH_INO, /* for multiple device flushing */
MAX_INO_ENTRY, /* max. list */
};
struct ino_entry {
struct list_head list; /* list head */
nid_t ino; /* inode number */
unsigned int dirty_device; /* dirty device bitmap */
};
/* for the list of inodes to be GCed */
struct inode_entry {
struct list_head list; /* list head */
struct inode *inode; /* vfs inode pointer */
};
struct fsync_node_entry {
struct list_head list; /* list head */
struct page *page; /* warm node page pointer */
unsigned int seq_id; /* sequence id */
};
struct ckpt_req {
struct completion wait; /* completion for checkpoint done */
struct llist_node llnode; /* llist_node to be linked in wait queue */
int ret; /* return code of checkpoint */
ktime_t queue_time; /* request queued time */
};
struct ckpt_req_control {
struct task_struct *f2fs_issue_ckpt; /* checkpoint task */
int ckpt_thread_ioprio; /* checkpoint merge thread ioprio */
wait_queue_head_t ckpt_wait_queue; /* waiting queue for wake-up */
atomic_t issued_ckpt; /* # of actually issued ckpts */
atomic_t total_ckpt; /* # of total ckpts */
atomic_t queued_ckpt; /* # of queued ckpts */
struct llist_head issue_list; /* list for command issue */
spinlock_t stat_lock; /* lock for below checkpoint time stats */
unsigned int cur_time; /* cur wait time in msec for currently issued checkpoint */
unsigned int peak_time; /* peak wait time in msec until now */
};
/* for the bitmap indicate blocks to be discarded */
struct discard_entry {
struct list_head list; /* list head */
block_t start_blkaddr; /* start blockaddr of current segment */
unsigned char discard_map[SIT_VBLOCK_MAP_SIZE]; /* segment discard bitmap */
};
/* default discard granularity of inner discard thread, unit: block count */
#define DEFAULT_DISCARD_GRANULARITY 16
/* max discard pend list number */
#define MAX_PLIST_NUM 512
#define plist_idx(blk_num) ((blk_num) >= MAX_PLIST_NUM ? \
(MAX_PLIST_NUM - 1) : ((blk_num) - 1))
enum {
D_PREP, /* initial */
D_PARTIAL, /* partially submitted */
D_SUBMIT, /* all submitted */
D_DONE, /* finished */
};
struct discard_info {
block_t lstart; /* logical start address */
block_t len; /* length */
block_t start; /* actual start address in dev */
};
struct discard_cmd {
struct rb_node rb_node; /* rb node located in rb-tree */
union {
struct {
block_t lstart; /* logical start address */
block_t len; /* length */
block_t start; /* actual start address in dev */
};
struct discard_info di; /* discard info */
};
struct list_head list; /* command list */
struct completion wait; /* compleation */
struct block_device *bdev; /* bdev */
unsigned short ref; /* reference count */
unsigned char state; /* state */
unsigned char queued; /* queued discard */
int error; /* bio error */
spinlock_t lock; /* for state/bio_ref updating */
unsigned short bio_ref; /* bio reference count */
};
enum {
DPOLICY_BG,
DPOLICY_FORCE,
DPOLICY_FSTRIM,
DPOLICY_UMOUNT,
MAX_DPOLICY,
};
struct discard_policy {
int type; /* type of discard */
unsigned int min_interval; /* used for candidates exist */
unsigned int mid_interval; /* used for device busy */
unsigned int max_interval; /* used for candidates not exist */
unsigned int max_requests; /* # of discards issued per round */
unsigned int io_aware_gran; /* minimum granularity discard not be aware of I/O */
bool io_aware; /* issue discard in idle time */
bool sync; /* submit discard with REQ_SYNC flag */
bool ordered; /* issue discard by lba order */
bool timeout; /* discard timeout for put_super */
unsigned int granularity; /* discard granularity */
};
struct discard_cmd_control {
struct task_struct *f2fs_issue_discard; /* discard thread */
struct list_head entry_list; /* 4KB discard entry list */
struct list_head pend_list[MAX_PLIST_NUM];/* store pending entries */
struct list_head wait_list; /* store on-flushing entries */
struct list_head fstrim_list; /* in-flight discard from fstrim */
wait_queue_head_t discard_wait_queue; /* waiting queue for wake-up */
unsigned int discard_wake; /* to wake up discard thread */
struct mutex cmd_lock;
unsigned int nr_discards; /* # of discards in the list */
unsigned int max_discards; /* max. discards to be issued */
unsigned int discard_granularity; /* discard granularity */
unsigned int undiscard_blks; /* # of undiscard blocks */
unsigned int next_pos; /* next discard position */
atomic_t issued_discard; /* # of issued discard */
atomic_t queued_discard; /* # of queued discard */
atomic_t discard_cmd_cnt; /* # of cached cmd count */
struct rb_root_cached root; /* root of discard rb-tree */
bool rbtree_check; /* config for consistence check */
};
/* for the list of fsync inodes, used only during recovery */
struct fsync_inode_entry {
struct list_head list; /* list head */
struct inode *inode; /* vfs inode pointer */
block_t blkaddr; /* block address locating the last fsync */
block_t last_dentry; /* block address locating the last dentry */
};
#define nats_in_cursum(jnl) (le16_to_cpu((jnl)->n_nats))
#define sits_in_cursum(jnl) (le16_to_cpu((jnl)->n_sits))
#define nat_in_journal(jnl, i) ((jnl)->nat_j.entries[i].ne)
#define nid_in_journal(jnl, i) ((jnl)->nat_j.entries[i].nid)
#define sit_in_journal(jnl, i) ((jnl)->sit_j.entries[i].se)
#define segno_in_journal(jnl, i) ((jnl)->sit_j.entries[i].segno)
#define MAX_NAT_JENTRIES(jnl) (NAT_JOURNAL_ENTRIES - nats_in_cursum(jnl))
#define MAX_SIT_JENTRIES(jnl) (SIT_JOURNAL_ENTRIES - sits_in_cursum(jnl))
static inline int update_nats_in_cursum(struct f2fs_journal *journal, int i)
{
int before = nats_in_cursum(journal);
journal->n_nats = cpu_to_le16(before + i);
return before;
}
static inline int update_sits_in_cursum(struct f2fs_journal *journal, int i)
{
int before = sits_in_cursum(journal);
journal->n_sits = cpu_to_le16(before + i);
return before;
}
static inline bool __has_cursum_space(struct f2fs_journal *journal,
int size, int type)
{
if (type == NAT_JOURNAL)
return size <= MAX_NAT_JENTRIES(journal);
return size <= MAX_SIT_JENTRIES(journal);
}
/* for inline stuff */
#define DEF_INLINE_RESERVED_SIZE 1
static inline int get_extra_isize(struct inode *inode);
static inline int get_inline_xattr_addrs(struct inode *inode);
#define MAX_INLINE_DATA(inode) (sizeof(__le32) * \
(CUR_ADDRS_PER_INODE(inode) - \
get_inline_xattr_addrs(inode) - \
DEF_INLINE_RESERVED_SIZE))
/* for inline dir */
#define NR_INLINE_DENTRY(inode) (MAX_INLINE_DATA(inode) * BITS_PER_BYTE / \
((SIZE_OF_DIR_ENTRY + F2FS_SLOT_LEN) * \
BITS_PER_BYTE + 1))
#define INLINE_DENTRY_BITMAP_SIZE(inode) \
DIV_ROUND_UP(NR_INLINE_DENTRY(inode), BITS_PER_BYTE)
#define INLINE_RESERVED_SIZE(inode) (MAX_INLINE_DATA(inode) - \
((SIZE_OF_DIR_ENTRY + F2FS_SLOT_LEN) * \
NR_INLINE_DENTRY(inode) + \
INLINE_DENTRY_BITMAP_SIZE(inode)))
/*
* For INODE and NODE manager
*/
/* for directory operations */
struct f2fs_filename {
/*
* The filename the user specified. This is NULL for some
* filesystem-internal operations, e.g. converting an inline directory
* to a non-inline one, or roll-forward recovering an encrypted dentry.
*/
const struct qstr *usr_fname;
/*
* The on-disk filename. For encrypted directories, this is encrypted.
* This may be NULL for lookups in an encrypted dir without the key.
*/
struct fscrypt_str disk_name;
/* The dirhash of this filename */
f2fs_hash_t hash;
#ifdef CONFIG_FS_ENCRYPTION
/*
* For lookups in encrypted directories: either the buffer backing
* disk_name, or a buffer that holds the decoded no-key name.
*/
struct fscrypt_str crypto_buf;
#endif
#ifdef CONFIG_UNICODE
/*
* For casefolded directories: the casefolded name, but it's left NULL
* if the original name is not valid Unicode, if the directory is both
* casefolded and encrypted and its encryption key is unavailable, or if
* the filesystem is doing an internal operation where usr_fname is also
* NULL. In all these cases we fall back to treating the name as an
* opaque byte sequence.
*/
struct fscrypt_str cf_name;
#endif
};
struct f2fs_dentry_ptr {
struct inode *inode;
void *bitmap;
struct f2fs_dir_entry *dentry;
__u8 (*filename)[F2FS_SLOT_LEN];
int max;
int nr_bitmap;
};
static inline void make_dentry_ptr_block(struct inode *inode,
struct f2fs_dentry_ptr *d, struct f2fs_dentry_block *t)
{
d->inode = inode;
d->max = NR_DENTRY_IN_BLOCK;
d->nr_bitmap = SIZE_OF_DENTRY_BITMAP;
d->bitmap = t->dentry_bitmap;
d->dentry = t->dentry;
d->filename = t->filename;
}
static inline void make_dentry_ptr_inline(struct inode *inode,
struct f2fs_dentry_ptr *d, void *t)
{
int entry_cnt = NR_INLINE_DENTRY(inode);
int bitmap_size = INLINE_DENTRY_BITMAP_SIZE(inode);
int reserved_size = INLINE_RESERVED_SIZE(inode);
d->inode = inode;
d->max = entry_cnt;
d->nr_bitmap = bitmap_size;
d->bitmap = t;
d->dentry = t + bitmap_size + reserved_size;
d->filename = t + bitmap_size + reserved_size +
SIZE_OF_DIR_ENTRY * entry_cnt;
}
/*
* XATTR_NODE_OFFSET stores xattrs to one node block per file keeping -1
* as its node offset to distinguish from index node blocks.
* But some bits are used to mark the node block.
*/
#define XATTR_NODE_OFFSET ((((unsigned int)-1) << OFFSET_BIT_SHIFT) \
>> OFFSET_BIT_SHIFT)
enum {
ALLOC_NODE, /* allocate a new node page if needed */
LOOKUP_NODE, /* look up a node without readahead */
LOOKUP_NODE_RA, /*
* look up a node with readahead called
* by get_data_block.
*/
};
#define DEFAULT_RETRY_IO_COUNT 8 /* maximum retry read IO count */
/* congestion wait timeout value, default: 20ms */
#define DEFAULT_IO_TIMEOUT (msecs_to_jiffies(20))
/* maximum retry quota flush count */
#define DEFAULT_RETRY_QUOTA_FLUSH_COUNT 8
#define F2FS_LINK_MAX 0xffffffff /* maximum link count per file */
#define MAX_DIR_RA_PAGES 4 /* maximum ra pages of dir */
/* for in-memory extent cache entry */
#define F2FS_MIN_EXTENT_LEN 64 /* minimum extent length */
/* number of extent info in extent cache we try to shrink */
#define EXTENT_CACHE_SHRINK_NUMBER 128
struct rb_entry {
struct rb_node rb_node; /* rb node located in rb-tree */
union {
struct {
unsigned int ofs; /* start offset of the entry */
unsigned int len; /* length of the entry */
};
unsigned long long key; /* 64-bits key */
} __packed;
};
struct extent_info {
unsigned int fofs; /* start offset in a file */
unsigned int len; /* length of the extent */
u32 blk; /* start block address of the extent */
};
struct extent_node {
struct rb_node rb_node; /* rb node located in rb-tree */
struct extent_info ei; /* extent info */
struct list_head list; /* node in global extent list of sbi */
struct extent_tree *et; /* extent tree pointer */
};
struct extent_tree {
nid_t ino; /* inode number */
struct rb_root_cached root; /* root of extent info rb-tree */
struct extent_node *cached_en; /* recently accessed extent node */
struct extent_info largest; /* largested extent info */
struct list_head list; /* to be used by sbi->zombie_list */
rwlock_t lock; /* protect extent info rb-tree */
atomic_t node_cnt; /* # of extent node in rb-tree*/
bool largest_updated; /* largest extent updated */
};
/*
* This structure is taken from ext4_map_blocks.
*
* Note that, however, f2fs uses NEW and MAPPED flags for f2fs_map_blocks().
*/
#define F2FS_MAP_NEW (1 << BH_New)
#define F2FS_MAP_MAPPED (1 << BH_Mapped)
#define F2FS_MAP_UNWRITTEN (1 << BH_Unwritten)
#define F2FS_MAP_FLAGS (F2FS_MAP_NEW | F2FS_MAP_MAPPED |\
F2FS_MAP_UNWRITTEN)
struct f2fs_map_blocks {
block_t m_pblk;
block_t m_lblk;
unsigned int m_len;
unsigned int m_flags;
pgoff_t *m_next_pgofs; /* point next possible non-hole pgofs */
pgoff_t *m_next_extent; /* point to next possible extent */
int m_seg_type;
bool m_may_create; /* indicate it is from write path */
};
/* for flag in get_data_block */
enum {
F2FS_GET_BLOCK_DEFAULT,
F2FS_GET_BLOCK_FIEMAP,
F2FS_GET_BLOCK_BMAP,
F2FS_GET_BLOCK_DIO,
F2FS_GET_BLOCK_PRE_DIO,
F2FS_GET_BLOCK_PRE_AIO,
F2FS_GET_BLOCK_PRECACHE,
};
/*
* i_advise uses FADVISE_XXX_BIT. We can add additional hints later.
*/
#define FADVISE_COLD_BIT 0x01
#define FADVISE_LOST_PINO_BIT 0x02
#define FADVISE_ENCRYPT_BIT 0x04
#define FADVISE_ENC_NAME_BIT 0x08
#define FADVISE_KEEP_SIZE_BIT 0x10
#define FADVISE_HOT_BIT 0x20
#define FADVISE_VERITY_BIT 0x40
#define FADVISE_MODIFIABLE_BITS (FADVISE_COLD_BIT | FADVISE_HOT_BIT)
#define file_is_cold(inode) is_file(inode, FADVISE_COLD_BIT)
#define file_set_cold(inode) set_file(inode, FADVISE_COLD_BIT)
#define file_clear_cold(inode) clear_file(inode, FADVISE_COLD_BIT)
#define file_wrong_pino(inode) is_file(inode, FADVISE_LOST_PINO_BIT)
#define file_lost_pino(inode) set_file(inode, FADVISE_LOST_PINO_BIT)
#define file_got_pino(inode) clear_file(inode, FADVISE_LOST_PINO_BIT)
#define file_is_encrypt(inode) is_file(inode, FADVISE_ENCRYPT_BIT)
#define file_set_encrypt(inode) set_file(inode, FADVISE_ENCRYPT_BIT)
#define file_enc_name(inode) is_file(inode, FADVISE_ENC_NAME_BIT)
#define file_set_enc_name(inode) set_file(inode, FADVISE_ENC_NAME_BIT)
#define file_keep_isize(inode) is_file(inode, FADVISE_KEEP_SIZE_BIT)
#define file_set_keep_isize(inode) set_file(inode, FADVISE_KEEP_SIZE_BIT)
#define file_is_hot(inode) is_file(inode, FADVISE_HOT_BIT)
#define file_set_hot(inode) set_file(inode, FADVISE_HOT_BIT)
#define file_clear_hot(inode) clear_file(inode, FADVISE_HOT_BIT)
#define file_is_verity(inode) is_file(inode, FADVISE_VERITY_BIT)
#define file_set_verity(inode) set_file(inode, FADVISE_VERITY_BIT)
#define DEF_DIR_LEVEL 0
enum {
GC_FAILURE_PIN,
GC_FAILURE_ATOMIC,
MAX_GC_FAILURE
};
/* used for f2fs_inode_info->flags */
enum {
FI_NEW_INODE, /* indicate newly allocated inode */
FI_DIRTY_INODE, /* indicate inode is dirty or not */
FI_AUTO_RECOVER, /* indicate inode is recoverable */
FI_DIRTY_DIR, /* indicate directory has dirty pages */
FI_INC_LINK, /* need to increment i_nlink */
FI_ACL_MODE, /* indicate acl mode */
FI_NO_ALLOC, /* should not allocate any blocks */
FI_FREE_NID, /* free allocated nide */
FI_NO_EXTENT, /* not to use the extent cache */
FI_INLINE_XATTR, /* used for inline xattr */
FI_INLINE_DATA, /* used for inline data*/
FI_INLINE_DENTRY, /* used for inline dentry */
FI_APPEND_WRITE, /* inode has appended data */
FI_UPDATE_WRITE, /* inode has in-place-update data */
FI_NEED_IPU, /* used for ipu per file */
FI_ATOMIC_FILE, /* indicate atomic file */
FI_ATOMIC_COMMIT, /* indicate the state of atomical committing */
FI_VOLATILE_FILE, /* indicate volatile file */
FI_FIRST_BLOCK_WRITTEN, /* indicate #0 data block was written */
FI_DROP_CACHE, /* drop dirty page cache */
FI_DATA_EXIST, /* indicate data exists */
FI_INLINE_DOTS, /* indicate inline dot dentries */
FI_DO_DEFRAG, /* indicate defragment is running */
FI_DIRTY_FILE, /* indicate regular/symlink has dirty pages */
FI_NO_PREALLOC, /* indicate skipped preallocated blocks */
FI_HOT_DATA, /* indicate file is hot */
FI_EXTRA_ATTR, /* indicate file has extra attribute */
FI_PROJ_INHERIT, /* indicate file inherits projectid */
FI_PIN_FILE, /* indicate file should not be gced */
FI_ATOMIC_REVOKE_REQUEST, /* request to drop atomic data */
FI_VERITY_IN_PROGRESS, /* building fs-verity Merkle tree */
FI_COMPRESSED_FILE, /* indicate file's data can be compressed */
FI_COMPRESS_CORRUPT, /* indicate compressed cluster is corrupted */
FI_MMAP_FILE, /* indicate file was mmapped */
FI_ENABLE_COMPRESS, /* enable compression in "user" compression mode */
FI_COMPRESS_RELEASED, /* compressed blocks were released */
FI_ALIGNED_WRITE, /* enable aligned write */
FI_MAX, /* max flag, never be used */
};
struct f2fs_inode_info {
struct inode vfs_inode; /* serve a vfs inode */
unsigned long i_flags; /* keep an inode flags for ioctl */
unsigned char i_advise; /* use to give file attribute hints */
unsigned char i_dir_level; /* use for dentry level for large dir */
unsigned int i_current_depth; /* only for directory depth */
/* for gc failure statistic */
unsigned int i_gc_failures[MAX_GC_FAILURE];
unsigned int i_pino; /* parent inode number */
umode_t i_acl_mode; /* keep file acl mode temporarily */
/* Use below internally in f2fs*/
unsigned long flags[BITS_TO_LONGS(FI_MAX)]; /* use to pass per-file flags */
struct f2fs_rwsem i_sem; /* protect fi info */
atomic_t dirty_pages; /* # of dirty pages */
f2fs_hash_t chash; /* hash value of given file name */
unsigned int clevel; /* maximum level of given file name */
struct task_struct *task; /* lookup and create consistency */
struct task_struct *cp_task; /* separate cp/wb IO stats*/
nid_t i_xattr_nid; /* node id that contains xattrs */
loff_t last_disk_size; /* lastly written file size */
spinlock_t i_size_lock; /* protect last_disk_size */
#ifdef CONFIG_QUOTA
struct dquot *i_dquot[MAXQUOTAS];
/* quota space reservation, managed internally by quota code */
qsize_t i_reserved_quota;
#endif
struct list_head dirty_list; /* dirty list for dirs and files */
struct list_head gdirty_list; /* linked in global dirty list */
struct list_head inmem_ilist; /* list for inmem inodes */
struct list_head inmem_pages; /* inmemory pages managed by f2fs */
struct task_struct *inmem_task; /* store inmemory task */
struct mutex inmem_lock; /* lock for inmemory pages */
struct extent_tree *extent_tree; /* cached extent_tree entry */
/* avoid racing between foreground op and gc */
struct f2fs_rwsem i_gc_rwsem[2];
struct f2fs_rwsem i_mmap_sem;
struct f2fs_rwsem i_xattr_sem; /* avoid racing between reading and changing EAs */
int i_extra_isize; /* size of extra space located in i_addr */
kprojid_t i_projid; /* id for project quota */
int i_inline_xattr_size; /* inline xattr size */
struct timespec64 i_crtime; /* inode creation time */
struct timespec64 i_disk_time[4];/* inode disk times */
/* for file compress */
atomic_t i_compr_blocks; /* # of compressed blocks */
unsigned char i_compress_algorithm; /* algorithm type */
unsigned char i_log_cluster_size; /* log of cluster size */
unsigned char i_compress_level; /* compress level (lz4hc,zstd) */
unsigned short i_compress_flag; /* compress flag */
unsigned int i_cluster_size; /* cluster size */
};
static inline void get_extent_info(struct extent_info *ext,
struct f2fs_extent *i_ext)
{
ext->fofs = le32_to_cpu(i_ext->fofs);
ext->blk = le32_to_cpu(i_ext->blk);
ext->len = le32_to_cpu(i_ext->len);
}
static inline void set_raw_extent(struct extent_info *ext,
struct f2fs_extent *i_ext)
{
i_ext->fofs = cpu_to_le32(ext->fofs);
i_ext->blk = cpu_to_le32(ext->blk);
i_ext->len = cpu_to_le32(ext->len);
}
static inline void set_extent_info(struct extent_info *ei, unsigned int fofs,
u32 blk, unsigned int len)
{
ei->fofs = fofs;
ei->blk = blk;
ei->len = len;
}
static inline bool __is_discard_mergeable(struct discard_info *back,
struct discard_info *front, unsigned int max_len)
{
return (back->lstart + back->len == front->lstart) &&
(back->len + front->len <= max_len);
}
static inline bool __is_discard_back_mergeable(struct discard_info *cur,
struct discard_info *back, unsigned int max_len)
{
return __is_discard_mergeable(back, cur, max_len);
}
static inline bool __is_discard_front_mergeable(struct discard_info *cur,
struct discard_info *front, unsigned int max_len)
{
return __is_discard_mergeable(cur, front, max_len);
}
static inline bool __is_extent_mergeable(struct extent_info *back,
struct extent_info *front)
{
return (back->fofs + back->len == front->fofs &&
back->blk + back->len == front->blk);
}
static inline bool __is_back_mergeable(struct extent_info *cur,
struct extent_info *back)
{
return __is_extent_mergeable(back, cur);
}
static inline bool __is_front_mergeable(struct extent_info *cur,
struct extent_info *front)
{
return __is_extent_mergeable(cur, front);
}
extern void f2fs_mark_inode_dirty_sync(struct inode *inode, bool sync);
static inline void __try_update_largest_extent(struct extent_tree *et,
struct extent_node *en)
{
if (en->ei.len > et->largest.len) {
et->largest = en->ei;
et->largest_updated = true;
}
}
/*
* For free nid management
*/
enum nid_state {
FREE_NID, /* newly added to free nid list */
PREALLOC_NID, /* it is preallocated */
MAX_NID_STATE,
};
enum nat_state {
TOTAL_NAT,
DIRTY_NAT,
RECLAIMABLE_NAT,
MAX_NAT_STATE,
};
struct f2fs_nm_info {
block_t nat_blkaddr; /* base disk address of NAT */
nid_t max_nid; /* maximum possible node ids */
nid_t available_nids; /* # of available node ids */
nid_t next_scan_nid; /* the next nid to be scanned */
unsigned int ram_thresh; /* control the memory footprint */
unsigned int ra_nid_pages; /* # of nid pages to be readaheaded */
unsigned int dirty_nats_ratio; /* control dirty nats ratio threshold */
/* NAT cache management */
struct radix_tree_root nat_root;/* root of the nat entry cache */
struct radix_tree_root nat_set_root;/* root of the nat set cache */
struct f2fs_rwsem nat_tree_lock; /* protect nat entry tree */
struct list_head nat_entries; /* cached nat entry list (clean) */
spinlock_t nat_list_lock; /* protect clean nat entry list */
unsigned int nat_cnt[MAX_NAT_STATE]; /* the # of cached nat entries */
unsigned int nat_blocks; /* # of nat blocks */
/* free node ids management */
struct radix_tree_root free_nid_root;/* root of the free_nid cache */
struct list_head free_nid_list; /* list for free nids excluding preallocated nids */
unsigned int nid_cnt[MAX_NID_STATE]; /* the number of free node id */
spinlock_t nid_list_lock; /* protect nid lists ops */
struct mutex build_lock; /* lock for build free nids */
unsigned char **free_nid_bitmap;
unsigned char *nat_block_bitmap;
unsigned short *free_nid_count; /* free nid count of NAT block */
/* for checkpoint */
char *nat_bitmap; /* NAT bitmap pointer */
unsigned int nat_bits_blocks; /* # of nat bits blocks */
unsigned char *nat_bits; /* NAT bits blocks */
unsigned char *full_nat_bits; /* full NAT pages */
unsigned char *empty_nat_bits; /* empty NAT pages */
#ifdef CONFIG_F2FS_CHECK_FS
char *nat_bitmap_mir; /* NAT bitmap mirror */
#endif
int bitmap_size; /* bitmap size */
};
/*
* this structure is used as one of function parameters.
* all the information are dedicated to a given direct node block determined
* by the data offset in a file.
*/
struct dnode_of_data {
struct inode *inode; /* vfs inode pointer */
struct page *inode_page; /* its inode page, NULL is possible */
struct page *node_page; /* cached direct node page */
nid_t nid; /* node id of the direct node block */
unsigned int ofs_in_node; /* data offset in the node page */
bool inode_page_locked; /* inode page is locked or not */
bool node_changed; /* is node block changed */
char cur_level; /* level of hole node page */
char max_level; /* level of current page located */
block_t data_blkaddr; /* block address of the node block */
};
static inline void set_new_dnode(struct dnode_of_data *dn, struct inode *inode,
struct page *ipage, struct page *npage, nid_t nid)
{
memset(dn, 0, sizeof(*dn));
dn->inode = inode;
dn->inode_page = ipage;
dn->node_page = npage;
dn->nid = nid;
}
/*
* For SIT manager
*
* By default, there are 6 active log areas across the whole main area.
* When considering hot and cold data separation to reduce cleaning overhead,
* we split 3 for data logs and 3 for node logs as hot, warm, and cold types,
* respectively.
* In the current design, you should not change the numbers intentionally.
* Instead, as a mount option such as active_logs=x, you can use 2, 4, and 6
* logs individually according to the underlying devices. (default: 6)
* Just in case, on-disk layout covers maximum 16 logs that consist of 8 for
* data and 8 for node logs.
*/
#define NR_CURSEG_DATA_TYPE (3)
#define NR_CURSEG_NODE_TYPE (3)
#define NR_CURSEG_INMEM_TYPE (2)
#define NR_CURSEG_RO_TYPE (2)
#define NR_CURSEG_PERSIST_TYPE (NR_CURSEG_DATA_TYPE + NR_CURSEG_NODE_TYPE)
#define NR_CURSEG_TYPE (NR_CURSEG_INMEM_TYPE + NR_CURSEG_PERSIST_TYPE)
enum {
CURSEG_HOT_DATA = 0, /* directory entry blocks */
CURSEG_WARM_DATA, /* data blocks */
CURSEG_COLD_DATA, /* multimedia or GCed data blocks */
CURSEG_HOT_NODE, /* direct node blocks of directory files */
CURSEG_WARM_NODE, /* direct node blocks of normal files */
CURSEG_COLD_NODE, /* indirect node blocks */
NR_PERSISTENT_LOG, /* number of persistent log */
CURSEG_COLD_DATA_PINNED = NR_PERSISTENT_LOG,
/* pinned file that needs consecutive block address */
CURSEG_ALL_DATA_ATGC, /* SSR alloctor in hot/warm/cold data area */
NO_CHECK_TYPE, /* number of persistent & inmem log */
};
struct flush_cmd {
struct completion wait;
struct llist_node llnode;
nid_t ino;
int ret;
};
struct flush_cmd_control {
struct task_struct *f2fs_issue_flush; /* flush thread */
wait_queue_head_t flush_wait_queue; /* waiting queue for wake-up */
atomic_t issued_flush; /* # of issued flushes */
atomic_t queued_flush; /* # of queued flushes */
struct llist_head issue_list; /* list for command issue */
struct llist_node *dispatch_list; /* list for command dispatch */
};
struct f2fs_sm_info {
struct sit_info *sit_info; /* whole segment information */
struct free_segmap_info *free_info; /* free segment information */
struct dirty_seglist_info *dirty_info; /* dirty segment information */
struct curseg_info *curseg_array; /* active segment information */
struct f2fs_rwsem curseg_lock; /* for preventing curseg change */
block_t seg0_blkaddr; /* block address of 0'th segment */
block_t main_blkaddr; /* start block address of main area */
block_t ssa_blkaddr; /* start block address of SSA area */
unsigned int segment_count; /* total # of segments */
unsigned int main_segments; /* # of segments in main area */
unsigned int reserved_segments; /* # of reserved segments */
unsigned int additional_reserved_segments;/* reserved segs for IO align feature */
unsigned int ovp_segments; /* # of overprovision segments */
/* a threshold to reclaim prefree segments */
unsigned int rec_prefree_segments;
/* for batched trimming */
unsigned int trim_sections; /* # of sections to trim */
struct list_head sit_entry_set; /* sit entry set list */
unsigned int ipu_policy; /* in-place-update policy */
unsigned int min_ipu_util; /* in-place-update threshold */
unsigned int min_fsync_blocks; /* threshold for fsync */
unsigned int min_seq_blocks; /* threshold for sequential blocks */
unsigned int min_hot_blocks; /* threshold for hot block allocation */
unsigned int min_ssr_sections; /* threshold to trigger SSR allocation */
/* for flush command control */
struct flush_cmd_control *fcc_info;
/* for discard command control */
struct discard_cmd_control *dcc_info;
};
/*
* For superblock
*/
/*
* COUNT_TYPE for monitoring
*
* f2fs monitors the number of several block types such as on-writeback,
* dirty dentry blocks, dirty node blocks, and dirty meta blocks.
*/
#define WB_DATA_TYPE(p) (__is_cp_guaranteed(p) ? F2FS_WB_CP_DATA : F2FS_WB_DATA)
enum count_type {
F2FS_DIRTY_DENTS,
F2FS_DIRTY_DATA,
F2FS_DIRTY_QDATA,
F2FS_DIRTY_NODES,
F2FS_DIRTY_META,
F2FS_INMEM_PAGES,
F2FS_DIRTY_IMETA,
F2FS_WB_CP_DATA,
F2FS_WB_DATA,
F2FS_RD_DATA,
F2FS_RD_NODE,
F2FS_RD_META,
F2FS_DIO_WRITE,
F2FS_DIO_READ,
NR_COUNT_TYPE,
};
/*
* The below are the page types of bios used in submit_bio().
* The available types are:
* DATA User data pages. It operates as async mode.
* NODE Node pages. It operates as async mode.
* META FS metadata pages such as SIT, NAT, CP.
* NR_PAGE_TYPE The number of page types.
* META_FLUSH Make sure the previous pages are written
* with waiting the bio's completion
* ... Only can be used with META.
*/
#define PAGE_TYPE_OF_BIO(type) ((type) > META ? META : (type))
enum page_type {
DATA,
NODE,
META,
NR_PAGE_TYPE,
META_FLUSH,
INMEM, /* the below types are used by tracepoints only. */
INMEM_DROP,
INMEM_INVALIDATE,
INMEM_REVOKE,
IPU,
OPU,
};
enum temp_type {
HOT = 0, /* must be zero for meta bio */
WARM,
COLD,
NR_TEMP_TYPE,
};
enum need_lock_type {
LOCK_REQ = 0,
LOCK_DONE,
LOCK_RETRY,
};
enum cp_reason_type {
CP_NO_NEEDED,
CP_NON_REGULAR,
CP_COMPRESSED,
CP_HARDLINK,
CP_SB_NEED_CP,
CP_WRONG_PINO,
CP_NO_SPC_ROLL,
CP_NODE_NEED_CP,
CP_FASTBOOT_MODE,
CP_SPEC_LOG_NUM,
CP_RECOVER_DIR,
};
enum iostat_type {
/* WRITE IO */
APP_DIRECT_IO, /* app direct write IOs */
APP_BUFFERED_IO, /* app buffered write IOs */
APP_WRITE_IO, /* app write IOs */
APP_MAPPED_IO, /* app mapped IOs */
FS_DATA_IO, /* data IOs from kworker/fsync/reclaimer */
FS_NODE_IO, /* node IOs from kworker/fsync/reclaimer */
FS_META_IO, /* meta IOs from kworker/reclaimer */
FS_GC_DATA_IO, /* data IOs from forground gc */
FS_GC_NODE_IO, /* node IOs from forground gc */
FS_CP_DATA_IO, /* data IOs from checkpoint */
FS_CP_NODE_IO, /* node IOs from checkpoint */
FS_CP_META_IO, /* meta IOs from checkpoint */
/* READ IO */
APP_DIRECT_READ_IO, /* app direct read IOs */
APP_BUFFERED_READ_IO, /* app buffered read IOs */
APP_READ_IO, /* app read IOs */
APP_MAPPED_READ_IO, /* app mapped read IOs */
FS_DATA_READ_IO, /* data read IOs */
FS_GDATA_READ_IO, /* data read IOs from background gc */
FS_CDATA_READ_IO, /* compressed data read IOs */
FS_NODE_READ_IO, /* node read IOs */
FS_META_READ_IO, /* meta read IOs */
/* other */
FS_DISCARD, /* discard */
NR_IO_TYPE,
};
struct f2fs_io_info {
struct f2fs_sb_info *sbi; /* f2fs_sb_info pointer */
nid_t ino; /* inode number */
enum page_type type; /* contains DATA/NODE/META/META_FLUSH */
enum temp_type temp; /* contains HOT/WARM/COLD */
int op; /* contains REQ_OP_ */
int op_flags; /* req_flag_bits */
block_t new_blkaddr; /* new block address to be written */
block_t old_blkaddr; /* old block address before Cow */
struct page *page; /* page to be written */
struct page *encrypted_page; /* encrypted page */
struct page *compressed_page; /* compressed page */
struct list_head list; /* serialize IOs */
bool submitted; /* indicate IO submission */
int need_lock; /* indicate we need to lock cp_rwsem */
bool in_list; /* indicate fio is in io_list */
bool is_por; /* indicate IO is from recovery or not */
bool retry; /* need to reallocate block address */
int compr_blocks; /* # of compressed block addresses */
bool encrypted; /* indicate file is encrypted */
enum iostat_type io_type; /* io type */
struct writeback_control *io_wbc; /* writeback control */
struct bio **bio; /* bio for ipu */
sector_t *last_block; /* last block number in bio */
unsigned char version; /* version of the node */
};
struct bio_entry {
struct bio *bio;
struct list_head list;
};
#define is_read_io(rw) ((rw) == READ)
struct f2fs_bio_info {
struct f2fs_sb_info *sbi; /* f2fs superblock */
struct bio *bio; /* bios to merge */
sector_t last_block_in_bio; /* last block number */
struct f2fs_io_info fio; /* store buffered io info. */
struct f2fs_rwsem io_rwsem; /* blocking op for bio */
spinlock_t io_lock; /* serialize DATA/NODE IOs */
struct list_head io_list; /* track fios */
struct list_head bio_list; /* bio entry list head */
struct f2fs_rwsem bio_list_lock; /* lock to protect bio entry list */
};
#define FDEV(i) (sbi->devs[i])
#define RDEV(i) (raw_super->devs[i])
struct f2fs_dev_info {
struct block_device *bdev;
char path[MAX_PATH_LEN];
unsigned int total_segments;
block_t start_blk;
block_t end_blk;
#ifdef CONFIG_BLK_DEV_ZONED
unsigned int nr_blkz; /* Total number of zones */
unsigned long *blkz_seq; /* Bitmap indicating sequential zones */
block_t *zone_capacity_blocks; /* Array of zone capacity in blks */
#endif
};
enum inode_type {
DIR_INODE, /* for dirty dir inode */
FILE_INODE, /* for dirty regular/symlink inode */
DIRTY_META, /* for all dirtied inode metadata */
ATOMIC_FILE, /* for all atomic files */
NR_INODE_TYPE,
};
/* for inner inode cache management */
struct inode_management {
struct radix_tree_root ino_root; /* ino entry array */
spinlock_t ino_lock; /* for ino entry lock */
struct list_head ino_list; /* inode list head */
unsigned long ino_num; /* number of entries */
};
/* for GC_AT */
struct atgc_management {
bool atgc_enabled; /* ATGC is enabled or not */
struct rb_root_cached root; /* root of victim rb-tree */
struct list_head victim_list; /* linked with all victim entries */
unsigned int victim_count; /* victim count in rb-tree */
unsigned int candidate_ratio; /* candidate ratio */
unsigned int max_candidate_count; /* max candidate count */
unsigned int age_weight; /* age weight, vblock_weight = 100 - age_weight */
unsigned long long age_threshold; /* age threshold */
};
/* For s_flag in struct f2fs_sb_info */
enum {
SBI_IS_DIRTY, /* dirty flag for checkpoint */
SBI_IS_CLOSE, /* specify unmounting */
SBI_NEED_FSCK, /* need fsck.f2fs to fix */
SBI_POR_DOING, /* recovery is doing or not */
SBI_NEED_SB_WRITE, /* need to recover superblock */
SBI_NEED_CP, /* need to checkpoint */
SBI_IS_SHUTDOWN, /* shutdown by ioctl */
SBI_IS_RECOVERED, /* recovered orphan/data */
SBI_CP_DISABLED, /* CP was disabled last mount */
SBI_CP_DISABLED_QUICK, /* CP was disabled quickly */
SBI_QUOTA_NEED_FLUSH, /* need to flush quota info in CP */
SBI_QUOTA_SKIP_FLUSH, /* skip flushing quota in current CP */
SBI_QUOTA_NEED_REPAIR, /* quota file may be corrupted */
SBI_IS_RESIZEFS, /* resizefs is in process */
};
enum {
CP_TIME,
REQ_TIME,
DISCARD_TIME,
GC_TIME,
DISABLE_TIME,
UMOUNT_DISCARD_TIMEOUT,
MAX_TIME,
};
enum {
GC_NORMAL,
GC_IDLE_CB,
GC_IDLE_GREEDY,
GC_IDLE_AT,
GC_URGENT_HIGH,
GC_URGENT_LOW,
MAX_GC_MODE,
};
enum {
BGGC_MODE_ON, /* background gc is on */
BGGC_MODE_OFF, /* background gc is off */
BGGC_MODE_SYNC, /*
* background gc is on, migrating blocks
* like foreground gc
*/
};
enum {
FS_MODE_ADAPTIVE, /* use both lfs/ssr allocation */
FS_MODE_LFS, /* use lfs allocation only */
};
enum {
WHINT_MODE_OFF, /* not pass down write hints */
WHINT_MODE_USER, /* try to pass down hints given by users */
WHINT_MODE_FS, /* pass down hints with F2FS policy */
};
enum {
ALLOC_MODE_DEFAULT, /* stay default */
ALLOC_MODE_REUSE, /* reuse segments as much as possible */
};
enum fsync_mode {
FSYNC_MODE_POSIX, /* fsync follows posix semantics */
FSYNC_MODE_STRICT, /* fsync behaves in line with ext4 */
FSYNC_MODE_NOBARRIER, /* fsync behaves nobarrier based on posix */
};
enum {
COMPR_MODE_FS, /*
* automatically compress compression
* enabled files
*/
COMPR_MODE_USER, /*
* automatical compression is disabled.
* user can control the file compression
* using ioctls
*/
};
static inline int f2fs_test_bit(unsigned int nr, char *addr);
static inline void f2fs_set_bit(unsigned int nr, char *addr);
static inline void f2fs_clear_bit(unsigned int nr, char *addr);
/*
* Layout of f2fs page.private:
*
* Layout A: lowest bit should be 1
* | bit0 = 1 | bit1 | bit2 | ... | bit MAX | private data .... |
* bit 0 PAGE_PRIVATE_NOT_POINTER
* bit 1 PAGE_PRIVATE_ATOMIC_WRITE
* bit 2 PAGE_PRIVATE_DUMMY_WRITE
* bit 3 PAGE_PRIVATE_ONGOING_MIGRATION
* bit 4 PAGE_PRIVATE_INLINE_INODE
* bit 5 PAGE_PRIVATE_REF_RESOURCE
* bit 6- f2fs private data
*
* Layout B: lowest bit should be 0
* page.private is a wrapped pointer.
*/
enum {
PAGE_PRIVATE_NOT_POINTER, /* private contains non-pointer data */
PAGE_PRIVATE_ATOMIC_WRITE, /* data page from atomic write path */
PAGE_PRIVATE_DUMMY_WRITE, /* data page for padding aligned IO */
PAGE_PRIVATE_ONGOING_MIGRATION, /* data page which is on-going migrating */
PAGE_PRIVATE_INLINE_INODE, /* inode page contains inline data */
PAGE_PRIVATE_REF_RESOURCE, /* dirty page has referenced resources */
PAGE_PRIVATE_MAX
};
#define PAGE_PRIVATE_GET_FUNC(name, flagname) \
static inline bool page_private_##name(struct page *page) \
{ \
return PagePrivate(page) && \
test_bit(PAGE_PRIVATE_NOT_POINTER, &page_private(page)) && \
test_bit(PAGE_PRIVATE_##flagname, &page_private(page)); \
}
#define PAGE_PRIVATE_SET_FUNC(name, flagname) \
static inline void set_page_private_##name(struct page *page) \
{ \
if (!PagePrivate(page)) { \
get_page(page); \
SetPagePrivate(page); \
set_page_private(page, 0); \
} \
set_bit(PAGE_PRIVATE_NOT_POINTER, &page_private(page)); \
set_bit(PAGE_PRIVATE_##flagname, &page_private(page)); \
}
#define PAGE_PRIVATE_CLEAR_FUNC(name, flagname) \
static inline void clear_page_private_##name(struct page *page) \
{ \
clear_bit(PAGE_PRIVATE_##flagname, &page_private(page)); \
if (page_private(page) == 1 << PAGE_PRIVATE_NOT_POINTER) { \
set_page_private(page, 0); \
if (PagePrivate(page)) { \
ClearPagePrivate(page); \
put_page(page); \
}\
} \
}
PAGE_PRIVATE_GET_FUNC(nonpointer, NOT_POINTER);
PAGE_PRIVATE_GET_FUNC(reference, REF_RESOURCE);
PAGE_PRIVATE_GET_FUNC(inline, INLINE_INODE);
PAGE_PRIVATE_GET_FUNC(gcing, ONGOING_MIGRATION);
PAGE_PRIVATE_GET_FUNC(atomic, ATOMIC_WRITE);
PAGE_PRIVATE_GET_FUNC(dummy, DUMMY_WRITE);
PAGE_PRIVATE_SET_FUNC(reference, REF_RESOURCE);
PAGE_PRIVATE_SET_FUNC(inline, INLINE_INODE);
PAGE_PRIVATE_SET_FUNC(gcing, ONGOING_MIGRATION);
PAGE_PRIVATE_SET_FUNC(atomic, ATOMIC_WRITE);
PAGE_PRIVATE_SET_FUNC(dummy, DUMMY_WRITE);
PAGE_PRIVATE_CLEAR_FUNC(reference, REF_RESOURCE);
PAGE_PRIVATE_CLEAR_FUNC(inline, INLINE_INODE);
PAGE_PRIVATE_CLEAR_FUNC(gcing, ONGOING_MIGRATION);
PAGE_PRIVATE_CLEAR_FUNC(atomic, ATOMIC_WRITE);
PAGE_PRIVATE_CLEAR_FUNC(dummy, DUMMY_WRITE);
static inline unsigned long get_page_private_data(struct page *page)
{
unsigned long data = page_private(page);
if (!test_bit(PAGE_PRIVATE_NOT_POINTER, &data))
return 0;
return data >> PAGE_PRIVATE_MAX;
}
static inline void set_page_private_data(struct page *page, unsigned long data)
{
if (!PagePrivate(page)) {
get_page(page);
SetPagePrivate(page);
set_page_private(page, 0);
}
set_bit(PAGE_PRIVATE_NOT_POINTER, &page_private(page));
page_private(page) |= data << PAGE_PRIVATE_MAX;
}
static inline void clear_page_private_data(struct page *page)
{
page_private(page) &= (1 << PAGE_PRIVATE_MAX) - 1;
if (page_private(page) == 1 << PAGE_PRIVATE_NOT_POINTER) {
set_page_private(page, 0);
if (PagePrivate(page)) {
ClearPagePrivate(page);
put_page(page);
}
}
}
/* For compression */
enum compress_algorithm_type {
COMPRESS_LZO,
COMPRESS_LZ4,
COMPRESS_ZSTD,
COMPRESS_LZORLE,
COMPRESS_MAX,
};
enum compress_flag {
COMPRESS_CHKSUM,
COMPRESS_MAX_FLAG,
};
#define COMPRESS_WATERMARK 20
#define COMPRESS_PERCENT 20
#define COMPRESS_DATA_RESERVED_SIZE 4
struct compress_data {
__le32 clen; /* compressed data size */
__le32 chksum; /* compressed data chksum */
__le32 reserved[COMPRESS_DATA_RESERVED_SIZE]; /* reserved */
u8 cdata[]; /* compressed data */
};
#define COMPRESS_HEADER_SIZE (sizeof(struct compress_data))
#define F2FS_COMPRESSED_PAGE_MAGIC 0xF5F2C000
#define COMPRESS_LEVEL_OFFSET 8
/* compress context */
struct compress_ctx {
struct inode *inode; /* inode the context belong to */
pgoff_t cluster_idx; /* cluster index number */
unsigned int cluster_size; /* page count in cluster */
unsigned int log_cluster_size; /* log of cluster size */
struct page **rpages; /* pages store raw data in cluster */
unsigned int nr_rpages; /* total page number in rpages */
struct page **cpages; /* pages store compressed data in cluster */
unsigned int nr_cpages; /* total page number in cpages */
void *rbuf; /* virtual mapped address on rpages */
struct compress_data *cbuf; /* virtual mapped address on cpages */
size_t rlen; /* valid data length in rbuf */
size_t clen; /* valid data length in cbuf */
void *private; /* payload buffer for specified compression algorithm */
void *private2; /* extra payload buffer */
};
/* compress context for write IO path */
struct compress_io_ctx {
u32 magic; /* magic number to indicate page is compressed */
struct inode *inode; /* inode the context belong to */
struct page **rpages; /* pages store raw data in cluster */
unsigned int nr_rpages; /* total page number in rpages */
atomic_t pending_pages; /* in-flight compressed page count */
};
/* Context for decompressing one cluster on the read IO path */
struct decompress_io_ctx {
u32 magic; /* magic number to indicate page is compressed */
struct inode *inode; /* inode the context belong to */
pgoff_t cluster_idx; /* cluster index number */
unsigned int cluster_size; /* page count in cluster */
unsigned int log_cluster_size; /* log of cluster size */
struct page **rpages; /* pages store raw data in cluster */
unsigned int nr_rpages; /* total page number in rpages */
struct page **cpages; /* pages store compressed data in cluster */
unsigned int nr_cpages; /* total page number in cpages */
struct page **tpages; /* temp pages to pad holes in cluster */
void *rbuf; /* virtual mapped address on rpages */
struct compress_data *cbuf; /* virtual mapped address on cpages */
size_t rlen; /* valid data length in rbuf */
size_t clen; /* valid data length in cbuf */
/*
* The number of compressed pages remaining to be read in this cluster.
* This is initially nr_cpages. It is decremented by 1 each time a page
* has been read (or failed to be read). When it reaches 0, the cluster
* is decompressed (or an error is reported).
*
* If an error occurs before all the pages have been submitted for I/O,
* then this will never reach 0. In this case the I/O submitter is
* responsible for calling f2fs_decompress_end_io() instead.
*/
atomic_t remaining_pages;
/*
* Number of references to this decompress_io_ctx.
*
* One reference is held for I/O completion. This reference is dropped
* after the pagecache pages are updated and unlocked -- either after
* decompression (and verity if enabled), or after an error.
*
* In addition, each compressed page holds a reference while it is in a
* bio. These references are necessary prevent compressed pages from
* being freed while they are still in a bio.
*/
refcount_t refcnt;
bool failed; /* IO error occurred before decompression? */
bool need_verity; /* need fs-verity verification after decompression? */
void *private; /* payload buffer for specified decompression algorithm */
void *private2; /* extra payload buffer */
struct work_struct verity_work; /* work to verify the decompressed pages */
};
#define NULL_CLUSTER ((unsigned int)(~0))
#define MIN_COMPRESS_LOG_SIZE 2
#define MAX_COMPRESS_LOG_SIZE 8
#define MAX_COMPRESS_WINDOW_SIZE(log_size) ((PAGE_SIZE) << (log_size))
struct f2fs_sb_info {
struct super_block *sb; /* pointer to VFS super block */
struct proc_dir_entry *s_proc; /* proc entry */
struct f2fs_super_block *raw_super; /* raw super block pointer */
struct f2fs_rwsem sb_lock; /* lock for raw super block */
int valid_super_block; /* valid super block no */
unsigned long s_flag; /* flags for sbi */
struct mutex writepages; /* mutex for writepages() */
#ifdef CONFIG_BLK_DEV_ZONED
unsigned int blocks_per_blkz; /* F2FS blocks per zone */
unsigned int log_blocks_per_blkz; /* log2 F2FS blocks per zone */
#endif
/* for node-related operations */
struct f2fs_nm_info *nm_info; /* node manager */
struct inode *node_inode; /* cache node blocks */
/* for segment-related operations */
struct f2fs_sm_info *sm_info; /* segment manager */
/* for bio operations */
struct f2fs_bio_info *write_io[NR_PAGE_TYPE]; /* for write bios */
/* keep migration IO order for LFS mode */
struct f2fs_rwsem io_order_lock;
mempool_t *write_io_dummy; /* Dummy pages */
/* for checkpoint */
struct f2fs_checkpoint *ckpt; /* raw checkpoint pointer */
int cur_cp_pack; /* remain current cp pack */
spinlock_t cp_lock; /* for flag in ckpt */
struct inode *meta_inode; /* cache meta blocks */
struct f2fs_rwsem cp_global_sem; /* checkpoint procedure lock */
struct f2fs_rwsem cp_rwsem; /* blocking FS operations */
struct f2fs_rwsem node_write; /* locking node writes */
struct f2fs_rwsem node_change; /* locking node change */
wait_queue_head_t cp_wait;
unsigned long last_time[MAX_TIME]; /* to store time in jiffies */
long interval_time[MAX_TIME]; /* to store thresholds */
struct ckpt_req_control cprc_info; /* for checkpoint request control */
struct inode_management im[MAX_INO_ENTRY]; /* manage inode cache */
spinlock_t fsync_node_lock; /* for node entry lock */
struct list_head fsync_node_list; /* node list head */
unsigned int fsync_seg_id; /* sequence id */
unsigned int fsync_node_num; /* number of node entries */
/* for orphan inode, use 0'th array */
unsigned int max_orphans; /* max orphan inodes */
/* for inode management */
struct list_head inode_list[NR_INODE_TYPE]; /* dirty inode list */
spinlock_t inode_lock[NR_INODE_TYPE]; /* for dirty inode list lock */
struct mutex flush_lock; /* for flush exclusion */
/* for extent tree cache */
struct radix_tree_root extent_tree_root;/* cache extent cache entries */
struct mutex extent_tree_lock; /* locking extent radix tree */
struct list_head extent_list; /* lru list for shrinker */
spinlock_t extent_lock; /* locking extent lru list */
atomic_t total_ext_tree; /* extent tree count */
struct list_head zombie_list; /* extent zombie tree list */
atomic_t total_zombie_tree; /* extent zombie tree count */
atomic_t total_ext_node; /* extent info count */
/* basic filesystem units */
unsigned int log_sectors_per_block; /* log2 sectors per block */
unsigned int log_blocksize; /* log2 block size */
unsigned int blocksize; /* block size */
unsigned int root_ino_num; /* root inode number*/
unsigned int node_ino_num; /* node inode number*/
unsigned int meta_ino_num; /* meta inode number*/
unsigned int log_blocks_per_seg; /* log2 blocks per segment */
unsigned int blocks_per_seg; /* blocks per segment */
unsigned int segs_per_sec; /* segments per section */
unsigned int secs_per_zone; /* sections per zone */
unsigned int total_sections; /* total section count */
unsigned int total_node_count; /* total node block count */
unsigned int total_valid_node_count; /* valid node block count */
int dir_level; /* directory level */
int readdir_ra; /* readahead inode in readdir */
u64 max_io_bytes; /* max io bytes to merge IOs */
block_t user_block_count; /* # of user blocks */
block_t total_valid_block_count; /* # of valid blocks */
block_t discard_blks; /* discard command candidats */
block_t last_valid_block_count; /* for recovery */
block_t reserved_blocks; /* configurable reserved blocks */
block_t current_reserved_blocks; /* current reserved blocks */
/* Additional tracking for no checkpoint mode */
block_t unusable_block_count; /* # of blocks saved by last cp */
unsigned int nquota_files; /* # of quota sysfile */
struct f2fs_rwsem quota_sem; /* blocking cp for flags */
/* # of pages, see count_type */
atomic_t nr_pages[NR_COUNT_TYPE];
/* # of allocated blocks */
struct percpu_counter alloc_valid_block_count;
/* writeback control */
atomic_t wb_sync_req[META]; /* count # of WB_SYNC threads */
/* valid inode count */
struct percpu_counter total_valid_inode_count;
struct f2fs_mount_info mount_opt; /* mount options */
/* for cleaning operations */
struct f2fs_rwsem gc_lock; /*
* semaphore for GC, avoid
* race between GC and GC or CP
*/
struct f2fs_gc_kthread *gc_thread; /* GC thread */
struct atgc_management am; /* atgc management */
unsigned int cur_victim_sec; /* current victim section num */
unsigned int gc_mode; /* current GC state */
unsigned int next_victim_seg[2]; /* next segment in victim section */
/* for skip statistic */
unsigned int atomic_files; /* # of opened atomic file */
unsigned long long skipped_atomic_files[2]; /* FG_GC and BG_GC */
unsigned long long skipped_gc_rwsem; /* FG_GC only */
/* threshold for gc trials on pinned files */
u64 gc_pin_file_threshold;
struct f2fs_rwsem pin_sem;
/* maximum # of trials to find a victim segment for SSR and GC */
unsigned int max_victim_search;
/* migration granularity of garbage collection, unit: segment */
unsigned int migration_granularity;
/*
* for stat information.
* one is for the LFS mode, and the other is for the SSR mode.
*/
#ifdef CONFIG_F2FS_STAT_FS
struct f2fs_stat_info *stat_info; /* FS status information */
atomic_t meta_count[META_MAX]; /* # of meta blocks */
unsigned int segment_count[2]; /* # of allocated segments */
unsigned int block_count[2]; /* # of allocated blocks */
atomic_t inplace_count; /* # of inplace update */
atomic64_t total_hit_ext; /* # of lookup extent cache */
atomic64_t read_hit_rbtree; /* # of hit rbtree extent node */
atomic64_t read_hit_largest; /* # of hit largest extent node */
atomic64_t read_hit_cached; /* # of hit cached extent node */
atomic_t inline_xattr; /* # of inline_xattr inodes */
atomic_t inline_inode; /* # of inline_data inodes */
atomic_t inline_dir; /* # of inline_dentry inodes */
atomic_t compr_inode; /* # of compressed inodes */
atomic64_t compr_blocks; /* # of compressed blocks */
atomic_t vw_cnt; /* # of volatile writes */
atomic_t max_aw_cnt; /* max # of atomic writes */
atomic_t max_vw_cnt; /* max # of volatile writes */
unsigned int io_skip_bggc; /* skip background gc for in-flight IO */
unsigned int other_skip_bggc; /* skip background gc for other reasons */
unsigned int ndirty_inode[NR_INODE_TYPE]; /* # of dirty inodes */
#endif
spinlock_t stat_lock; /* lock for stat operations */
/* For app/fs IO statistics */
spinlock_t iostat_lock;
unsigned long long rw_iostat[NR_IO_TYPE];
unsigned long long prev_rw_iostat[NR_IO_TYPE];
bool iostat_enable;
unsigned long iostat_next_period;
unsigned int iostat_period_ms;
/* to attach REQ_META|REQ_FUA flags */
unsigned int data_io_flag;
unsigned int node_io_flag;
/* For sysfs suppport */
struct kobject s_kobj; /* /sys/fs/f2fs/<devname> */
struct completion s_kobj_unregister;
struct kobject s_stat_kobj; /* /sys/fs/f2fs/<devname>/stat */
struct completion s_stat_kobj_unregister;
struct kobject s_feature_list_kobj; /* /sys/fs/f2fs/<devname>/feature_list */
struct completion s_feature_list_kobj_unregister;
/* For shrinker support */
struct list_head s_list;
int s_ndevs; /* number of devices */
struct f2fs_dev_info *devs; /* for device list */
unsigned int dirty_device; /* for checkpoint data flush */
spinlock_t dev_lock; /* protect dirty_device */
struct mutex umount_mutex;
unsigned int shrinker_run_no;
/* For write statistics */
u64 sectors_written_start;
u64 kbytes_written;
/* Reference to checksum algorithm driver via cryptoapi */
struct crypto_shash *s_chksum_driver;
/* Precomputed FS UUID checksum for seeding other checksums */
__u32 s_chksum_seed;
struct workqueue_struct *post_read_wq; /* post read workqueue */
struct kmem_cache *inline_xattr_slab; /* inline xattr entry */
unsigned int inline_xattr_slab_size; /* default inline xattr slab size */
/* For reclaimed segs statistics per each GC mode */
unsigned int gc_segment_mode; /* GC state for reclaimed segments */
unsigned int gc_reclaimed_segs[MAX_GC_MODE]; /* Reclaimed segs for each mode */
#ifdef CONFIG_F2FS_FS_COMPRESSION
struct kmem_cache *page_array_slab; /* page array entry */
unsigned int page_array_slab_size; /* default page array slab size */
/* For runtime compression statistics */
u64 compr_written_block;
u64 compr_saved_block;
u32 compr_new_inode;
/* For compressed block cache */
struct inode *compress_inode; /* cache compressed blocks */
unsigned int compress_percent; /* cache page percentage */
unsigned int compress_watermark; /* cache page watermark */
atomic_t compress_page_hit; /* cache hit count */
#endif
};
struct f2fs_private_dio {
struct inode *inode;
void *orig_private;
bio_end_io_t *orig_end_io;
bool write;
};
#ifdef CONFIG_F2FS_FAULT_INJECTION
#define f2fs_show_injection_info(sbi, type) \
printk_ratelimited("%sF2FS-fs (%s) : inject %s in %s of %pS\n", \
KERN_INFO, sbi->sb->s_id, \
f2fs_fault_name[type], \
__func__, __builtin_return_address(0))
static inline bool time_to_inject(struct f2fs_sb_info *sbi, int type)
{
struct f2fs_fault_info *ffi = &F2FS_OPTION(sbi).fault_info;
if (!ffi->inject_rate)
return false;
if (!IS_FAULT_SET(ffi, type))
return false;
atomic_inc(&ffi->inject_ops);
if (atomic_read(&ffi->inject_ops) >= ffi->inject_rate) {
atomic_set(&ffi->inject_ops, 0);
return true;
}
return false;
}
#else
#define f2fs_show_injection_info(sbi, type) do { } while (0)
static inline bool time_to_inject(struct f2fs_sb_info *sbi, int type)
{
return false;
}
#endif
/*
* Test if the mounted volume is a multi-device volume.
* - For a single regular disk volume, sbi->s_ndevs is 0.
* - For a single zoned disk volume, sbi->s_ndevs is 1.
* - For a multi-device volume, sbi->s_ndevs is always 2 or more.
*/
static inline bool f2fs_is_multi_device(struct f2fs_sb_info *sbi)
{
return sbi->s_ndevs > 1;
}
static inline void f2fs_update_time(struct f2fs_sb_info *sbi, int type)
{
unsigned long now = jiffies;
sbi->last_time[type] = now;
/* DISCARD_TIME and GC_TIME are based on REQ_TIME */
if (type == REQ_TIME) {
sbi->last_time[DISCARD_TIME] = now;
sbi->last_time[GC_TIME] = now;
}
}
static inline bool f2fs_time_over(struct f2fs_sb_info *sbi, int type)
{
unsigned long interval = sbi->interval_time[type] * HZ;
return time_after(jiffies, sbi->last_time[type] + interval);
}
static inline unsigned int f2fs_time_to_wait(struct f2fs_sb_info *sbi,
int type)
{
unsigned long interval = sbi->interval_time[type] * HZ;
unsigned int wait_ms = 0;
long delta;
delta = (sbi->last_time[type] + interval) - jiffies;
if (delta > 0)
wait_ms = jiffies_to_msecs(delta);
return wait_ms;
}
/*
* Inline functions
*/
static inline u32 __f2fs_crc32(struct f2fs_sb_info *sbi, u32 crc,
const void *address, unsigned int length)
{
struct {
struct shash_desc shash;
char ctx[4];
} desc;
int err;
BUG_ON(crypto_shash_descsize(sbi->s_chksum_driver) != sizeof(desc.ctx));
desc.shash.tfm = sbi->s_chksum_driver;
*(u32 *)desc.ctx = crc;
err = crypto_shash_update(&desc.shash, address, length);
BUG_ON(err);
return *(u32 *)desc.ctx;
}
static inline u32 f2fs_crc32(struct f2fs_sb_info *sbi, const void *address,
unsigned int length)
{
return __f2fs_crc32(sbi, F2FS_SUPER_MAGIC, address, length);
}
static inline bool f2fs_crc_valid(struct f2fs_sb_info *sbi, __u32 blk_crc,
void *buf, size_t buf_size)
{
return f2fs_crc32(sbi, buf, buf_size) == blk_crc;
}
static inline u32 f2fs_chksum(struct f2fs_sb_info *sbi, u32 crc,
const void *address, unsigned int length)
{
return __f2fs_crc32(sbi, crc, address, length);
}
static inline struct f2fs_inode_info *F2FS_I(struct inode *inode)
{
return container_of(inode, struct f2fs_inode_info, vfs_inode);
}
static inline struct f2fs_sb_info *F2FS_SB(struct super_block *sb)
{
return sb->s_fs_info;
}
static inline struct f2fs_sb_info *F2FS_I_SB(struct inode *inode)
{
return F2FS_SB(inode->i_sb);
}
static inline struct f2fs_sb_info *F2FS_M_SB(struct address_space *mapping)
{
return F2FS_I_SB(mapping->host);
}
static inline struct f2fs_sb_info *F2FS_P_SB(struct page *page)
{
return F2FS_M_SB(page_file_mapping(page));
}
static inline struct f2fs_super_block *F2FS_RAW_SUPER(struct f2fs_sb_info *sbi)
{
return (struct f2fs_super_block *)(sbi->raw_super);
}
static inline struct f2fs_checkpoint *F2FS_CKPT(struct f2fs_sb_info *sbi)
{
return (struct f2fs_checkpoint *)(sbi->ckpt);
}
static inline struct f2fs_node *F2FS_NODE(struct page *page)
{
return (struct f2fs_node *)page_address(page);
}
static inline struct f2fs_inode *F2FS_INODE(struct page *page)
{
return &((struct f2fs_node *)page_address(page))->i;
}
static inline struct f2fs_nm_info *NM_I(struct f2fs_sb_info *sbi)
{
return (struct f2fs_nm_info *)(sbi->nm_info);
}
static inline struct f2fs_sm_info *SM_I(struct f2fs_sb_info *sbi)
{
return (struct f2fs_sm_info *)(sbi->sm_info);
}
static inline struct sit_info *SIT_I(struct f2fs_sb_info *sbi)
{
return (struct sit_info *)(SM_I(sbi)->sit_info);
}
static inline struct free_segmap_info *FREE_I(struct f2fs_sb_info *sbi)
{
return (struct free_segmap_info *)(SM_I(sbi)->free_info);
}
static inline struct dirty_seglist_info *DIRTY_I(struct f2fs_sb_info *sbi)
{
return (struct dirty_seglist_info *)(SM_I(sbi)->dirty_info);
}
static inline struct address_space *META_MAPPING(struct f2fs_sb_info *sbi)
{
return sbi->meta_inode->i_mapping;
}
static inline struct address_space *NODE_MAPPING(struct f2fs_sb_info *sbi)
{
return sbi->node_inode->i_mapping;
}
static inline bool is_sbi_flag_set(struct f2fs_sb_info *sbi, unsigned int type)
{
return test_bit(type, &sbi->s_flag);
}
static inline void set_sbi_flag(struct f2fs_sb_info *sbi, unsigned int type)
{
set_bit(type, &sbi->s_flag);
}
static inline void clear_sbi_flag(struct f2fs_sb_info *sbi, unsigned int type)
{
clear_bit(type, &sbi->s_flag);
}
static inline unsigned long long cur_cp_version(struct f2fs_checkpoint *cp)
{
return le64_to_cpu(cp->checkpoint_ver);
}
static inline unsigned long f2fs_qf_ino(struct super_block *sb, int type)
{
if (type < F2FS_MAX_QUOTAS)
return le32_to_cpu(F2FS_SB(sb)->raw_super->qf_ino[type]);
return 0;
}
static inline __u64 cur_cp_crc(struct f2fs_checkpoint *cp)
{
size_t crc_offset = le32_to_cpu(cp->checksum_offset);
return le32_to_cpu(*((__le32 *)((unsigned char *)cp + crc_offset)));
}
static inline bool __is_set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f)
{
unsigned int ckpt_flags = le32_to_cpu(cp->ckpt_flags);
return ckpt_flags & f;
}
static inline bool is_set_ckpt_flags(struct f2fs_sb_info *sbi, unsigned int f)
{
return __is_set_ckpt_flags(F2FS_CKPT(sbi), f);
}
static inline void __set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f)
{
unsigned int ckpt_flags;
ckpt_flags = le32_to_cpu(cp->ckpt_flags);
ckpt_flags |= f;
cp->ckpt_flags = cpu_to_le32(ckpt_flags);
}
static inline void set_ckpt_flags(struct f2fs_sb_info *sbi, unsigned int f)
{
unsigned long flags;
spin_lock_irqsave(&sbi->cp_lock, flags);
__set_ckpt_flags(F2FS_CKPT(sbi), f);
spin_unlock_irqrestore(&sbi->cp_lock, flags);
}
static inline void __clear_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f)
{
unsigned int ckpt_flags;
ckpt_flags = le32_to_cpu(cp->ckpt_flags);
ckpt_flags &= (~f);
cp->ckpt_flags = cpu_to_le32(ckpt_flags);
}
static inline void clear_ckpt_flags(struct f2fs_sb_info *sbi, unsigned int f)
{
unsigned long flags;
spin_lock_irqsave(&sbi->cp_lock, flags);
__clear_ckpt_flags(F2FS_CKPT(sbi), f);
spin_unlock_irqrestore(&sbi->cp_lock, flags);
}
static inline void disable_nat_bits(struct f2fs_sb_info *sbi, bool lock)
{
unsigned long flags;
unsigned char *nat_bits;
/*
* In order to re-enable nat_bits we need to call fsck.f2fs by
* set_sbi_flag(sbi, SBI_NEED_FSCK). But it may give huge cost,
* so let's rely on regular fsck or unclean shutdown.
*/
if (lock)
spin_lock_irqsave(&sbi->cp_lock, flags);
__clear_ckpt_flags(F2FS_CKPT(sbi), CP_NAT_BITS_FLAG);
nat_bits = NM_I(sbi)->nat_bits;
NM_I(sbi)->nat_bits = NULL;
if (lock)
spin_unlock_irqrestore(&sbi->cp_lock, flags);
kvfree(nat_bits);
}
static inline bool enabled_nat_bits(struct f2fs_sb_info *sbi,
struct cp_control *cpc)
{
bool set = is_set_ckpt_flags(sbi, CP_NAT_BITS_FLAG);
return (cpc) ? (cpc->reason & CP_UMOUNT) && set : set;
}
#define init_f2fs_rwsem(sem) \
do { \
static struct lock_class_key __key; \
\
__init_f2fs_rwsem((sem), #sem, &__key); \
} while (0)
static inline void __init_f2fs_rwsem(struct f2fs_rwsem *sem,
const char *sem_name, struct lock_class_key *key)
{
__init_rwsem(&sem->internal_rwsem, sem_name, key);
init_waitqueue_head(&sem->read_waiters);
}
static inline int f2fs_rwsem_is_locked(struct f2fs_rwsem *sem)
{
return rwsem_is_locked(&sem->internal_rwsem);
}
static inline int f2fs_rwsem_is_contended(struct f2fs_rwsem *sem)
{
return rwsem_is_contended(&sem->internal_rwsem);
}
static inline void f2fs_down_read(struct f2fs_rwsem *sem)
{
wait_event(sem->read_waiters, down_read_trylock(&sem->internal_rwsem));
}
static inline int f2fs_down_read_trylock(struct f2fs_rwsem *sem)
{
return down_read_trylock(&sem->internal_rwsem);
}
#ifdef CONFIG_DEBUG_LOCK_ALLOC
static inline void f2fs_down_read_nested(struct f2fs_rwsem *sem, int subclass)
{
down_read_nested(&sem->internal_rwsem, subclass);
}
#else
#define f2fs_down_read_nested(sem, subclass) f2fs_down_read(sem)
#endif
static inline void f2fs_up_read(struct f2fs_rwsem *sem)
{
up_read(&sem->internal_rwsem);
}
static inline void f2fs_down_write(struct f2fs_rwsem *sem)
{
down_write(&sem->internal_rwsem);
}
static inline int f2fs_down_write_trylock(struct f2fs_rwsem *sem)
{
return down_write_trylock(&sem->internal_rwsem);
}
static inline void f2fs_up_write(struct f2fs_rwsem *sem)
{
up_write(&sem->internal_rwsem);
wake_up_all(&sem->read_waiters);
}
static inline void f2fs_lock_op(struct f2fs_sb_info *sbi)
{
f2fs_down_read(&sbi->cp_rwsem);
}
static inline int f2fs_trylock_op(struct f2fs_sb_info *sbi)
{
return f2fs_down_read_trylock(&sbi->cp_rwsem);
}
static inline void f2fs_unlock_op(struct f2fs_sb_info *sbi)
{
f2fs_up_read(&sbi->cp_rwsem);
}
static inline void f2fs_lock_all(struct f2fs_sb_info *sbi)
{
f2fs_down_write(&sbi->cp_rwsem);
}
static inline void f2fs_unlock_all(struct f2fs_sb_info *sbi)
{
f2fs_up_write(&sbi->cp_rwsem);
}
static inline int __get_cp_reason(struct f2fs_sb_info *sbi)
{
int reason = CP_SYNC;
if (test_opt(sbi, FASTBOOT))
reason = CP_FASTBOOT;
if (is_sbi_flag_set(sbi, SBI_IS_CLOSE))
reason = CP_UMOUNT;
return reason;
}
static inline bool __remain_node_summaries(int reason)
{
return (reason & (CP_UMOUNT | CP_FASTBOOT));
}
static inline bool __exist_node_summaries(struct f2fs_sb_info *sbi)
{
return (is_set_ckpt_flags(sbi, CP_UMOUNT_FLAG) ||
is_set_ckpt_flags(sbi, CP_FASTBOOT_FLAG));
}
/*
* Check whether the inode has blocks or not
*/
static inline int F2FS_HAS_BLOCKS(struct inode *inode)
{
block_t xattr_block = F2FS_I(inode)->i_xattr_nid ? 1 : 0;
return (inode->i_blocks >> F2FS_LOG_SECTORS_PER_BLOCK) > xattr_block;
}
static inline bool f2fs_has_xattr_block(unsigned int ofs)
{
return ofs == XATTR_NODE_OFFSET;
}
static inline bool __allow_reserved_blocks(struct f2fs_sb_info *sbi,
struct inode *inode, bool cap)
{
if (!inode)
return true;
if (!test_opt(sbi, RESERVE_ROOT))
return false;
if (IS_NOQUOTA(inode))
return true;
if (uid_eq(F2FS_OPTION(sbi).s_resuid, current_fsuid()))
return true;
if (!gid_eq(F2FS_OPTION(sbi).s_resgid, GLOBAL_ROOT_GID) &&
in_group_p(F2FS_OPTION(sbi).s_resgid))
return true;
if (cap && capable(CAP_SYS_RESOURCE))
return true;
return false;
}
static inline void f2fs_i_blocks_write(struct inode *, block_t, bool, bool);
static inline int inc_valid_block_count(struct f2fs_sb_info *sbi,
struct inode *inode, blkcnt_t *count)
{
blkcnt_t diff = 0, release = 0;
block_t avail_user_block_count;
int ret;
ret = dquot_reserve_block(inode, *count);
if (ret)
return ret;
if (time_to_inject(sbi, FAULT_BLOCK)) {
f2fs_show_injection_info(sbi, FAULT_BLOCK);
release = *count;
goto release_quota;
}
/*
* let's increase this in prior to actual block count change in order
* for f2fs_sync_file to avoid data races when deciding checkpoint.
*/
percpu_counter_add(&sbi->alloc_valid_block_count, (*count));
spin_lock(&sbi->stat_lock);
sbi->total_valid_block_count += (block_t)(*count);
avail_user_block_count = sbi->user_block_count -
sbi->current_reserved_blocks;
if (!__allow_reserved_blocks(sbi, inode, true))
avail_user_block_count -= F2FS_OPTION(sbi).root_reserved_blocks;
if (F2FS_IO_ALIGNED(sbi))
avail_user_block_count -= sbi->blocks_per_seg *
SM_I(sbi)->additional_reserved_segments;
if (unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED))) {
if (avail_user_block_count > sbi->unusable_block_count)
avail_user_block_count -= sbi->unusable_block_count;
else
avail_user_block_count = 0;
}
if (unlikely(sbi->total_valid_block_count > avail_user_block_count)) {
diff = sbi->total_valid_block_count - avail_user_block_count;
if (diff > *count)
diff = *count;
*count -= diff;
release = diff;
sbi->total_valid_block_count -= diff;
if (!*count) {
spin_unlock(&sbi->stat_lock);
goto enospc;
}
}
spin_unlock(&sbi->stat_lock);
if (unlikely(release)) {
percpu_counter_sub(&sbi->alloc_valid_block_count, release);
dquot_release_reservation_block(inode, release);
}
f2fs_i_blocks_write(inode, *count, true, true);
return 0;
enospc:
percpu_counter_sub(&sbi->alloc_valid_block_count, release);
release_quota:
dquot_release_reservation_block(inode, release);
return -ENOSPC;
}
__printf(2, 3)
void f2fs_printk(struct f2fs_sb_info *sbi, const char *fmt, ...);
#define f2fs_err(sbi, fmt, ...) \
f2fs_printk(sbi, KERN_ERR fmt, ##__VA_ARGS__)
#define f2fs_warn(sbi, fmt, ...) \
f2fs_printk(sbi, KERN_WARNING fmt, ##__VA_ARGS__)
#define f2fs_notice(sbi, fmt, ...) \
f2fs_printk(sbi, KERN_NOTICE fmt, ##__VA_ARGS__)
#define f2fs_info(sbi, fmt, ...) \
f2fs_printk(sbi, KERN_INFO fmt, ##__VA_ARGS__)
#define f2fs_debug(sbi, fmt, ...) \
f2fs_printk(sbi, KERN_DEBUG fmt, ##__VA_ARGS__)
static inline void dec_valid_block_count(struct f2fs_sb_info *sbi,
struct inode *inode,
block_t count)
{
blkcnt_t sectors = count << F2FS_LOG_SECTORS_PER_BLOCK;
spin_lock(&sbi->stat_lock);
f2fs_bug_on(sbi, sbi->total_valid_block_count < (block_t) count);
sbi->total_valid_block_count -= (block_t)count;
if (sbi->reserved_blocks &&
sbi->current_reserved_blocks < sbi->reserved_blocks)
sbi->current_reserved_blocks = min(sbi->reserved_blocks,
sbi->current_reserved_blocks + count);
spin_unlock(&sbi->stat_lock);
if (unlikely(inode->i_blocks < sectors)) {
f2fs_warn(sbi, "Inconsistent i_blocks, ino:%lu, iblocks:%llu, sectors:%llu",
inode->i_ino,
(unsigned long long)inode->i_blocks,
(unsigned long long)sectors);
set_sbi_flag(sbi, SBI_NEED_FSCK);
return;
}
f2fs_i_blocks_write(inode, count, false, true);
}
static inline void inc_page_count(struct f2fs_sb_info *sbi, int count_type)
{
atomic_inc(&sbi->nr_pages[count_type]);
if (count_type == F2FS_DIRTY_DENTS ||
count_type == F2FS_DIRTY_NODES ||
count_type == F2FS_DIRTY_META ||
count_type == F2FS_DIRTY_QDATA ||
count_type == F2FS_DIRTY_IMETA)
set_sbi_flag(sbi, SBI_IS_DIRTY);
}
static inline void inode_inc_dirty_pages(struct inode *inode)
{
atomic_inc(&F2FS_I(inode)->dirty_pages);
inc_page_count(F2FS_I_SB(inode), S_ISDIR(inode->i_mode) ?
F2FS_DIRTY_DENTS : F2FS_DIRTY_DATA);
if (IS_NOQUOTA(inode))
inc_page_count(F2FS_I_SB(inode), F2FS_DIRTY_QDATA);
}
static inline void dec_page_count(struct f2fs_sb_info *sbi, int count_type)
{
atomic_dec(&sbi->nr_pages[count_type]);
}
static inline void inode_dec_dirty_pages(struct inode *inode)
{
if (!S_ISDIR(inode->i_mode) && !S_ISREG(inode->i_mode) &&
!S_ISLNK(inode->i_mode))
return;
atomic_dec(&F2FS_I(inode)->dirty_pages);
dec_page_count(F2FS_I_SB(inode), S_ISDIR(inode->i_mode) ?
F2FS_DIRTY_DENTS : F2FS_DIRTY_DATA);
if (IS_NOQUOTA(inode))
dec_page_count(F2FS_I_SB(inode), F2FS_DIRTY_QDATA);
}
static inline s64 get_pages(struct f2fs_sb_info *sbi, int count_type)
{
return atomic_read(&sbi->nr_pages[count_type]);
}
static inline int get_dirty_pages(struct inode *inode)
{
return atomic_read(&F2FS_I(inode)->dirty_pages);
}
static inline int get_blocktype_secs(struct f2fs_sb_info *sbi, int block_type)
{
unsigned int pages_per_sec = sbi->segs_per_sec * sbi->blocks_per_seg;
unsigned int segs = (get_pages(sbi, block_type) + pages_per_sec - 1) >>
sbi->log_blocks_per_seg;
return segs / sbi->segs_per_sec;
}
static inline block_t valid_user_blocks(struct f2fs_sb_info *sbi)
{
return sbi->total_valid_block_count;
}
static inline block_t discard_blocks(struct f2fs_sb_info *sbi)
{
return sbi->discard_blks;
}
static inline unsigned long __bitmap_size(struct f2fs_sb_info *sbi, int flag)
{
struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
/* return NAT or SIT bitmap */
if (flag == NAT_BITMAP)
return le32_to_cpu(ckpt->nat_ver_bitmap_bytesize);
else if (flag == SIT_BITMAP)
return le32_to_cpu(ckpt->sit_ver_bitmap_bytesize);
return 0;
}
static inline block_t __cp_payload(struct f2fs_sb_info *sbi)
{
return le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_payload);
}
static inline void *__bitmap_ptr(struct f2fs_sb_info *sbi, int flag)
{
struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
void *tmp_ptr = &ckpt->sit_nat_version_bitmap;
int offset;
if (is_set_ckpt_flags(sbi, CP_LARGE_NAT_BITMAP_FLAG)) {
offset = (flag == SIT_BITMAP) ?
le32_to_cpu(ckpt->nat_ver_bitmap_bytesize) : 0;
/*
* if large_nat_bitmap feature is enabled, leave checksum
* protection for all nat/sit bitmaps.
*/
return tmp_ptr + offset + sizeof(__le32);
}
if (__cp_payload(sbi) > 0) {
if (flag == NAT_BITMAP)
return &ckpt->sit_nat_version_bitmap;
else
return (unsigned char *)ckpt + F2FS_BLKSIZE;
} else {
offset = (flag == NAT_BITMAP) ?
le32_to_cpu(ckpt->sit_ver_bitmap_bytesize) : 0;
return tmp_ptr + offset;
}
}
static inline block_t __start_cp_addr(struct f2fs_sb_info *sbi)
{
block_t start_addr = le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_blkaddr);
if (sbi->cur_cp_pack == 2)
start_addr += sbi->blocks_per_seg;
return start_addr;
}
static inline block_t __start_cp_next_addr(struct f2fs_sb_info *sbi)
{
block_t start_addr = le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_blkaddr);
if (sbi->cur_cp_pack == 1)
start_addr += sbi->blocks_per_seg;
return start_addr;
}
static inline void __set_cp_next_pack(struct f2fs_sb_info *sbi)
{
sbi->cur_cp_pack = (sbi->cur_cp_pack == 1) ? 2 : 1;
}
static inline block_t __start_sum_addr(struct f2fs_sb_info *sbi)
{
return le32_to_cpu(F2FS_CKPT(sbi)->cp_pack_start_sum);
}
static inline int inc_valid_node_count(struct f2fs_sb_info *sbi,
struct inode *inode, bool is_inode)
{
block_t valid_block_count;
unsigned int valid_node_count, user_block_count;
int err;
if (is_inode) {
if (inode) {
err = dquot_alloc_inode(inode);
if (err)
return err;
}
} else {
err = dquot_reserve_block(inode, 1);
if (err)
return err;
}
if (time_to_inject(sbi, FAULT_BLOCK)) {
f2fs_show_injection_info(sbi, FAULT_BLOCK);
goto enospc;
}
spin_lock(&sbi->stat_lock);
valid_block_count = sbi->total_valid_block_count +
sbi->current_reserved_blocks + 1;
if (!__allow_reserved_blocks(sbi, inode, false))
valid_block_count += F2FS_OPTION(sbi).root_reserved_blocks;
if (F2FS_IO_ALIGNED(sbi))
valid_block_count += sbi->blocks_per_seg *
SM_I(sbi)->additional_reserved_segments;
user_block_count = sbi->user_block_count;
if (unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED)))
user_block_count -= sbi->unusable_block_count;
if (unlikely(valid_block_count > user_block_count)) {
spin_unlock(&sbi->stat_lock);
goto enospc;
}
valid_node_count = sbi->total_valid_node_count + 1;
if (unlikely(valid_node_count > sbi->total_node_count)) {
spin_unlock(&sbi->stat_lock);
goto enospc;
}
sbi->total_valid_node_count++;
sbi->total_valid_block_count++;
spin_unlock(&sbi->stat_lock);
if (inode) {
if (is_inode)
f2fs_mark_inode_dirty_sync(inode, true);
else
f2fs_i_blocks_write(inode, 1, true, true);
}
percpu_counter_inc(&sbi->alloc_valid_block_count);
return 0;
enospc:
if (is_inode) {
if (inode)
dquot_free_inode(inode);
} else {
dquot_release_reservation_block(inode, 1);
}
return -ENOSPC;
}
static inline void dec_valid_node_count(struct f2fs_sb_info *sbi,
struct inode *inode, bool is_inode)
{
spin_lock(&sbi->stat_lock);
f2fs_bug_on(sbi, !sbi->total_valid_block_count);
f2fs_bug_on(sbi, !sbi->total_valid_node_count);
sbi->total_valid_node_count--;
sbi->total_valid_block_count--;
if (sbi->reserved_blocks &&
sbi->current_reserved_blocks < sbi->reserved_blocks)
sbi->current_reserved_blocks++;
spin_unlock(&sbi->stat_lock);
if (is_inode) {
dquot_free_inode(inode);
} else {
if (unlikely(inode->i_blocks == 0)) {
f2fs_warn(sbi, "dec_valid_node_count: inconsistent i_blocks, ino:%lu, iblocks:%llu",
inode->i_ino,
(unsigned long long)inode->i_blocks);
set_sbi_flag(sbi, SBI_NEED_FSCK);
return;
}
f2fs_i_blocks_write(inode, 1, false, true);
}
}
static inline unsigned int valid_node_count(struct f2fs_sb_info *sbi)
{
return sbi->total_valid_node_count;
}
static inline void inc_valid_inode_count(struct f2fs_sb_info *sbi)
{
percpu_counter_inc(&sbi->total_valid_inode_count);
}
static inline void dec_valid_inode_count(struct f2fs_sb_info *sbi)
{
percpu_counter_dec(&sbi->total_valid_inode_count);
}
static inline s64 valid_inode_count(struct f2fs_sb_info *sbi)
{
return percpu_counter_sum_positive(&sbi->total_valid_inode_count);
}
static inline struct page *f2fs_grab_cache_page(struct address_space *mapping,
pgoff_t index, bool for_write)
{
struct page *page;
if (IS_ENABLED(CONFIG_F2FS_FAULT_INJECTION)) {
if (!for_write)
page = find_get_page_flags(mapping, index,
FGP_LOCK | FGP_ACCESSED);
else
page = find_lock_page(mapping, index);
if (page)
return page;
if (time_to_inject(F2FS_M_SB(mapping), FAULT_PAGE_ALLOC)) {
f2fs_show_injection_info(F2FS_M_SB(mapping),
FAULT_PAGE_ALLOC);
return NULL;
}
}
if (!for_write)
return grab_cache_page(mapping, index);
return grab_cache_page_write_begin(mapping, index, AOP_FLAG_NOFS);
}
static inline struct page *f2fs_pagecache_get_page(
struct address_space *mapping, pgoff_t index,
int fgp_flags, gfp_t gfp_mask)
{
if (time_to_inject(F2FS_M_SB(mapping), FAULT_PAGE_GET)) {
f2fs_show_injection_info(F2FS_M_SB(mapping), FAULT_PAGE_GET);
return NULL;
}
return pagecache_get_page(mapping, index, fgp_flags, gfp_mask);
}
static inline void f2fs_copy_page(struct page *src, struct page *dst)
{
char *src_kaddr = kmap(src);
char *dst_kaddr = kmap(dst);
memcpy(dst_kaddr, src_kaddr, PAGE_SIZE);
kunmap(dst);
kunmap(src);
}
static inline void f2fs_put_page(struct page *page, int unlock)
{
if (!page)
return;
if (unlock) {
f2fs_bug_on(F2FS_P_SB(page), !PageLocked(page));
unlock_page(page);
}
put_page(page);
}
static inline void f2fs_put_dnode(struct dnode_of_data *dn)
{
if (dn->node_page)
f2fs_put_page(dn->node_page, 1);
if (dn->inode_page && dn->node_page != dn->inode_page)
f2fs_put_page(dn->inode_page, 0);
dn->node_page = NULL;
dn->inode_page = NULL;
}
static inline struct kmem_cache *f2fs_kmem_cache_create(const char *name,
size_t size)
{
return kmem_cache_create(name, size, 0, SLAB_RECLAIM_ACCOUNT, NULL);
}
static inline void *f2fs_kmem_cache_alloc(struct kmem_cache *cachep,
gfp_t flags)
{
void *entry;
entry = kmem_cache_alloc(cachep, flags);
if (!entry)
entry = kmem_cache_alloc(cachep, flags | __GFP_NOFAIL);
return entry;
}
static inline bool is_inflight_io(struct f2fs_sb_info *sbi, int type)
{
if (get_pages(sbi, F2FS_RD_DATA) || get_pages(sbi, F2FS_RD_NODE) ||
get_pages(sbi, F2FS_RD_META) || get_pages(sbi, F2FS_WB_DATA) ||
get_pages(sbi, F2FS_WB_CP_DATA) ||
get_pages(sbi, F2FS_DIO_READ) ||
get_pages(sbi, F2FS_DIO_WRITE))
return true;
if (type != DISCARD_TIME && SM_I(sbi) && SM_I(sbi)->dcc_info &&
atomic_read(&SM_I(sbi)->dcc_info->queued_discard))
return true;
if (SM_I(sbi) && SM_I(sbi)->fcc_info &&
atomic_read(&SM_I(sbi)->fcc_info->queued_flush))
return true;
return false;
}
static inline bool is_idle(struct f2fs_sb_info *sbi, int type)
{
if (sbi->gc_mode == GC_URGENT_HIGH)
return true;
if (is_inflight_io(sbi, type))
return false;
if (sbi->gc_mode == GC_URGENT_LOW &&
(type == DISCARD_TIME || type == GC_TIME))
return true;
return f2fs_time_over(sbi, type);
}
static inline void f2fs_radix_tree_insert(struct radix_tree_root *root,
unsigned long index, void *item)
{
while (radix_tree_insert(root, index, item))
cond_resched();
}
#define RAW_IS_INODE(p) ((p)->footer.nid == (p)->footer.ino)
static inline bool IS_INODE(struct page *page)
{
struct f2fs_node *p = F2FS_NODE(page);
return RAW_IS_INODE(p);
}
static inline int offset_in_addr(struct f2fs_inode *i)
{
return (i->i_inline & F2FS_EXTRA_ATTR) ?
(le16_to_cpu(i->i_extra_isize) / sizeof(__le32)) : 0;
}
static inline __le32 *blkaddr_in_node(struct f2fs_node *node)
{
return RAW_IS_INODE(node) ? node->i.i_addr : node->dn.addr;
}
static inline int f2fs_has_extra_attr(struct inode *inode);
static inline block_t data_blkaddr(struct inode *inode,
struct page *node_page, unsigned int offset)
{
struct f2fs_node *raw_node;
__le32 *addr_array;
int base = 0;
bool is_inode = IS_INODE(node_page);
raw_node = F2FS_NODE(node_page);
if (is_inode) {
if (!inode)
/* from GC path only */
base = offset_in_addr(&raw_node->i);
else if (f2fs_has_extra_attr(inode))
base = get_extra_isize(inode);
}
addr_array = blkaddr_in_node(raw_node);
return le32_to_cpu(addr_array[base + offset]);
}
static inline block_t f2fs_data_blkaddr(struct dnode_of_data *dn)
{
return data_blkaddr(dn->inode, dn->node_page, dn->ofs_in_node);
}
static inline int f2fs_test_bit(unsigned int nr, char *addr)
{
int mask;
addr += (nr >> 3);
mask = 1 << (7 - (nr & 0x07));
return mask & *addr;
}
static inline void f2fs_set_bit(unsigned int nr, char *addr)
{
int mask;
addr += (nr >> 3);
mask = 1 << (7 - (nr & 0x07));
*addr |= mask;
}
static inline void f2fs_clear_bit(unsigned int nr, char *addr)
{
int mask;
addr += (nr >> 3);
mask = 1 << (7 - (nr & 0x07));
*addr &= ~mask;
}
static inline int f2fs_test_and_set_bit(unsigned int nr, char *addr)
{
int mask;
int ret;
addr += (nr >> 3);
mask = 1 << (7 - (nr & 0x07));
ret = mask & *addr;
*addr |= mask;
return ret;
}
static inline int f2fs_test_and_clear_bit(unsigned int nr, char *addr)
{
int mask;
int ret;
addr += (nr >> 3);
mask = 1 << (7 - (nr & 0x07));
ret = mask & *addr;
*addr &= ~mask;
return ret;
}
static inline void f2fs_change_bit(unsigned int nr, char *addr)
{
int mask;
addr += (nr >> 3);
mask = 1 << (7 - (nr & 0x07));
*addr ^= mask;
}
/*
* On-disk inode flags (f2fs_inode::i_flags)
*/
#define F2FS_COMPR_FL 0x00000004 /* Compress file */
#define F2FS_SYNC_FL 0x00000008 /* Synchronous updates */
#define F2FS_IMMUTABLE_FL 0x00000010 /* Immutable file */
#define F2FS_APPEND_FL 0x00000020 /* writes to file may only append */
#define F2FS_NODUMP_FL 0x00000040 /* do not dump file */
#define F2FS_NOATIME_FL 0x00000080 /* do not update atime */
#define F2FS_NOCOMP_FL 0x00000400 /* Don't compress */
#define F2FS_INDEX_FL 0x00001000 /* hash-indexed directory */
#define F2FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */
#define F2FS_PROJINHERIT_FL 0x20000000 /* Create with parents projid */
#define F2FS_CASEFOLD_FL 0x40000000 /* Casefolded file */
/* Flags that should be inherited by new inodes from their parent. */
#define F2FS_FL_INHERITED (F2FS_SYNC_FL | F2FS_NODUMP_FL | F2FS_NOATIME_FL | \
F2FS_DIRSYNC_FL | F2FS_PROJINHERIT_FL | \
F2FS_CASEFOLD_FL | F2FS_COMPR_FL | F2FS_NOCOMP_FL)
/* Flags that are appropriate for regular files (all but dir-specific ones). */
#define F2FS_REG_FLMASK (~(F2FS_DIRSYNC_FL | F2FS_PROJINHERIT_FL | \
F2FS_CASEFOLD_FL))
/* Flags that are appropriate for non-directories/regular files. */
#define F2FS_OTHER_FLMASK (F2FS_NODUMP_FL | F2FS_NOATIME_FL)
static inline __u32 f2fs_mask_flags(umode_t mode, __u32 flags)
{
if (S_ISDIR(mode))
return flags;
else if (S_ISREG(mode))
return flags & F2FS_REG_FLMASK;
else
return flags & F2FS_OTHER_FLMASK;
}
static inline void __mark_inode_dirty_flag(struct inode *inode,
int flag, bool set)
{
switch (flag) {
case FI_INLINE_XATTR:
case FI_INLINE_DATA:
case FI_INLINE_DENTRY:
case FI_NEW_INODE:
if (set)
return;
fallthrough;
case FI_DATA_EXIST:
case FI_INLINE_DOTS:
case FI_PIN_FILE:
case FI_COMPRESS_RELEASED:
f2fs_mark_inode_dirty_sync(inode, true);
}
}
static inline void set_inode_flag(struct inode *inode, int flag)
{
set_bit(flag, F2FS_I(inode)->flags);
__mark_inode_dirty_flag(inode, flag, true);
}
static inline int is_inode_flag_set(struct inode *inode, int flag)
{
return test_bit(flag, F2FS_I(inode)->flags);
}
static inline void clear_inode_flag(struct inode *inode, int flag)
{
clear_bit(flag, F2FS_I(inode)->flags);
__mark_inode_dirty_flag(inode, flag, false);
}
static inline bool f2fs_verity_in_progress(struct inode *inode)
{
return IS_ENABLED(CONFIG_FS_VERITY) &&
is_inode_flag_set(inode, FI_VERITY_IN_PROGRESS);
}
static inline void set_acl_inode(struct inode *inode, umode_t mode)
{
F2FS_I(inode)->i_acl_mode = mode;
set_inode_flag(inode, FI_ACL_MODE);
f2fs_mark_inode_dirty_sync(inode, false);
}
static inline void f2fs_i_links_write(struct inode *inode, bool inc)
{
if (inc)
inc_nlink(inode);
else
drop_nlink(inode);
f2fs_mark_inode_dirty_sync(inode, true);
}
static inline void f2fs_i_blocks_write(struct inode *inode,
block_t diff, bool add, bool claim)
{
bool clean = !is_inode_flag_set(inode, FI_DIRTY_INODE);
bool recover = is_inode_flag_set(inode, FI_AUTO_RECOVER);
/* add = 1, claim = 1 should be dquot_reserve_block in pair */
if (add) {
if (claim)
dquot_claim_block(inode, diff);
else
dquot_alloc_block_nofail(inode, diff);
} else {
dquot_free_block(inode, diff);
}
f2fs_mark_inode_dirty_sync(inode, true);
if (clean || recover)
set_inode_flag(inode, FI_AUTO_RECOVER);
}
static inline void f2fs_i_size_write(struct inode *inode, loff_t i_size)
{
bool clean = !is_inode_flag_set(inode, FI_DIRTY_INODE);
bool recover = is_inode_flag_set(inode, FI_AUTO_RECOVER);
if (i_size_read(inode) == i_size)
return;
i_size_write(inode, i_size);
f2fs_mark_inode_dirty_sync(inode, true);
if (clean || recover)
set_inode_flag(inode, FI_AUTO_RECOVER);
}
static inline void f2fs_i_depth_write(struct inode *inode, unsigned int depth)
{
F2FS_I(inode)->i_current_depth = depth;
f2fs_mark_inode_dirty_sync(inode, true);
}
static inline void f2fs_i_gc_failures_write(struct inode *inode,
unsigned int count)
{
F2FS_I(inode)->i_gc_failures[GC_FAILURE_PIN] = count;
f2fs_mark_inode_dirty_sync(inode, true);
}
static inline void f2fs_i_xnid_write(struct inode *inode, nid_t xnid)
{
F2FS_I(inode)->i_xattr_nid = xnid;
f2fs_mark_inode_dirty_sync(inode, true);
}
static inline void f2fs_i_pino_write(struct inode *inode, nid_t pino)
{
F2FS_I(inode)->i_pino = pino;
f2fs_mark_inode_dirty_sync(inode, true);
}
static inline void get_inline_info(struct inode *inode, struct f2fs_inode *ri)
{
struct f2fs_inode_info *fi = F2FS_I(inode);
if (ri->i_inline & F2FS_INLINE_XATTR)
set_bit(FI_INLINE_XATTR, fi->flags);
if (ri->i_inline & F2FS_INLINE_DATA)
set_bit(FI_INLINE_DATA, fi->flags);
if (ri->i_inline & F2FS_INLINE_DENTRY)
set_bit(FI_INLINE_DENTRY, fi->flags);
if (ri->i_inline & F2FS_DATA_EXIST)
set_bit(FI_DATA_EXIST, fi->flags);
if (ri->i_inline & F2FS_INLINE_DOTS)
set_bit(FI_INLINE_DOTS, fi->flags);
if (ri->i_inline & F2FS_EXTRA_ATTR)
set_bit(FI_EXTRA_ATTR, fi->flags);
if (ri->i_inline & F2FS_PIN_FILE)
set_bit(FI_PIN_FILE, fi->flags);
if (ri->i_inline & F2FS_COMPRESS_RELEASED)
set_bit(FI_COMPRESS_RELEASED, fi->flags);
}
static inline void set_raw_inline(struct inode *inode, struct f2fs_inode *ri)
{
ri->i_inline = 0;
if (is_inode_flag_set(inode, FI_INLINE_XATTR))
ri->i_inline |= F2FS_INLINE_XATTR;
if (is_inode_flag_set(inode, FI_INLINE_DATA))
ri->i_inline |= F2FS_INLINE_DATA;
if (is_inode_flag_set(inode, FI_INLINE_DENTRY))
ri->i_inline |= F2FS_INLINE_DENTRY;
if (is_inode_flag_set(inode, FI_DATA_EXIST))
ri->i_inline |= F2FS_DATA_EXIST;
if (is_inode_flag_set(inode, FI_INLINE_DOTS))
ri->i_inline |= F2FS_INLINE_DOTS;
if (is_inode_flag_set(inode, FI_EXTRA_ATTR))
ri->i_inline |= F2FS_EXTRA_ATTR;
if (is_inode_flag_set(inode, FI_PIN_FILE))
ri->i_inline |= F2FS_PIN_FILE;
if (is_inode_flag_set(inode, FI_COMPRESS_RELEASED))
ri->i_inline |= F2FS_COMPRESS_RELEASED;
}
static inline int f2fs_has_extra_attr(struct inode *inode)
{
return is_inode_flag_set(inode, FI_EXTRA_ATTR);
}
static inline int f2fs_has_inline_xattr(struct inode *inode)
{
return is_inode_flag_set(inode, FI_INLINE_XATTR);
}
static inline int f2fs_compressed_file(struct inode *inode)
{
return S_ISREG(inode->i_mode) &&
is_inode_flag_set(inode, FI_COMPRESSED_FILE);
}
static inline bool f2fs_need_compress_data(struct inode *inode)
{
int compress_mode = F2FS_OPTION(F2FS_I_SB(inode)).compress_mode;
if (!f2fs_compressed_file(inode))
return false;
if (compress_mode == COMPR_MODE_FS)
return true;
else if (compress_mode == COMPR_MODE_USER &&
is_inode_flag_set(inode, FI_ENABLE_COMPRESS))
return true;
return false;
}
static inline unsigned int addrs_per_inode(struct inode *inode)
{
unsigned int addrs = CUR_ADDRS_PER_INODE(inode) -
get_inline_xattr_addrs(inode);
if (!f2fs_compressed_file(inode))
return addrs;
return ALIGN_DOWN(addrs, F2FS_I(inode)->i_cluster_size);
}
static inline unsigned int addrs_per_block(struct inode *inode)
{
if (!f2fs_compressed_file(inode))
return DEF_ADDRS_PER_BLOCK;
return ALIGN_DOWN(DEF_ADDRS_PER_BLOCK, F2FS_I(inode)->i_cluster_size);
}
static inline void *inline_xattr_addr(struct inode *inode, struct page *page)
{
struct f2fs_inode *ri = F2FS_INODE(page);
return (void *)&(ri->i_addr[DEF_ADDRS_PER_INODE -
get_inline_xattr_addrs(inode)]);
}
static inline int inline_xattr_size(struct inode *inode)
{
if (f2fs_has_inline_xattr(inode))
return get_inline_xattr_addrs(inode) * sizeof(__le32);
return 0;
}
static inline int f2fs_has_inline_data(struct inode *inode)
{
return is_inode_flag_set(inode, FI_INLINE_DATA);
}
static inline int f2fs_exist_data(struct inode *inode)
{
return is_inode_flag_set(inode, FI_DATA_EXIST);
}
static inline int f2fs_has_inline_dots(struct inode *inode)
{
return is_inode_flag_set(inode, FI_INLINE_DOTS);
}
static inline int f2fs_is_mmap_file(struct inode *inode)
{
return is_inode_flag_set(inode, FI_MMAP_FILE);
}
static inline bool f2fs_is_pinned_file(struct inode *inode)
{
return is_inode_flag_set(inode, FI_PIN_FILE);
}
static inline bool f2fs_is_atomic_file(struct inode *inode)
{
return is_inode_flag_set(inode, FI_ATOMIC_FILE);
}
static inline bool f2fs_is_commit_atomic_write(struct inode *inode)
{
return is_inode_flag_set(inode, FI_ATOMIC_COMMIT);
}
static inline bool f2fs_is_volatile_file(struct inode *inode)
{
return is_inode_flag_set(inode, FI_VOLATILE_FILE);
}
static inline bool f2fs_is_first_block_written(struct inode *inode)
{
return is_inode_flag_set(inode, FI_FIRST_BLOCK_WRITTEN);
}
static inline bool f2fs_is_drop_cache(struct inode *inode)
{
return is_inode_flag_set(inode, FI_DROP_CACHE);
}
static inline void *inline_data_addr(struct inode *inode, struct page *page)
{
struct f2fs_inode *ri = F2FS_INODE(page);
int extra_size = get_extra_isize(inode);
return (void *)&(ri->i_addr[extra_size + DEF_INLINE_RESERVED_SIZE]);
}
static inline int f2fs_has_inline_dentry(struct inode *inode)
{
return is_inode_flag_set(inode, FI_INLINE_DENTRY);
}
static inline int is_file(struct inode *inode, int type)
{
return F2FS_I(inode)->i_advise & type;
}
static inline void set_file(struct inode *inode, int type)
{
F2FS_I(inode)->i_advise |= type;
f2fs_mark_inode_dirty_sync(inode, true);
}
static inline void clear_file(struct inode *inode, int type)
{
F2FS_I(inode)->i_advise &= ~type;
f2fs_mark_inode_dirty_sync(inode, true);
}
static inline bool f2fs_is_time_consistent(struct inode *inode)
{
if (!timespec64_equal(F2FS_I(inode)->i_disk_time, &inode->i_atime))
return false;
if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 1, &inode->i_ctime))
return false;
if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 2, &inode->i_mtime))
return false;
if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 3,
&F2FS_I(inode)->i_crtime))
return false;
return true;
}
static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync)
{
bool ret;
if (dsync) {
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
spin_lock(&sbi->inode_lock[DIRTY_META]);
ret = list_empty(&F2FS_I(inode)->gdirty_list);
spin_unlock(&sbi->inode_lock[DIRTY_META]);
return ret;
}
if (!is_inode_flag_set(inode, FI_AUTO_RECOVER) ||
file_keep_isize(inode) ||
i_size_read(inode) & ~PAGE_MASK)
return false;
if (!f2fs_is_time_consistent(inode))
return false;
spin_lock(&F2FS_I(inode)->i_size_lock);
ret = F2FS_I(inode)->last_disk_size == i_size_read(inode);
spin_unlock(&F2FS_I(inode)->i_size_lock);
return ret;
}
static inline bool f2fs_readonly(struct super_block *sb)
{
return sb_rdonly(sb);
}
static inline bool f2fs_cp_error(struct f2fs_sb_info *sbi)
{
return is_set_ckpt_flags(sbi, CP_ERROR_FLAG);
}
static inline bool is_dot_dotdot(const u8 *name, size_t len)
{
if (len == 1 && name[0] == '.')
return true;
if (len == 2 && name[0] == '.' && name[1] == '.')
return true;
return false;
}
static inline void *f2fs_kmalloc(struct f2fs_sb_info *sbi,
size_t size, gfp_t flags)
{
if (time_to_inject(sbi, FAULT_KMALLOC)) {
f2fs_show_injection_info(sbi, FAULT_KMALLOC);
return NULL;
}
return kmalloc(size, flags);
}
static inline void *f2fs_kzalloc(struct f2fs_sb_info *sbi,
size_t size, gfp_t flags)
{
return f2fs_kmalloc(sbi, size, flags | __GFP_ZERO);
}
static inline void *f2fs_kvmalloc(struct f2fs_sb_info *sbi,
size_t size, gfp_t flags)
{
if (time_to_inject(sbi, FAULT_KVMALLOC)) {
f2fs_show_injection_info(sbi, FAULT_KVMALLOC);
return NULL;
}
return kvmalloc(size, flags);
}
static inline void *f2fs_kvzalloc(struct f2fs_sb_info *sbi,
size_t size, gfp_t flags)
{
return f2fs_kvmalloc(sbi, size, flags | __GFP_ZERO);
}
static inline int get_extra_isize(struct inode *inode)
{
return F2FS_I(inode)->i_extra_isize / sizeof(__le32);
}
static inline int get_inline_xattr_addrs(struct inode *inode)
{
return F2FS_I(inode)->i_inline_xattr_size;
}
#define f2fs_get_inode_mode(i) \
((is_inode_flag_set(i, FI_ACL_MODE)) ? \
(F2FS_I(i)->i_acl_mode) : ((i)->i_mode))
#define F2FS_TOTAL_EXTRA_ATTR_SIZE \
(offsetof(struct f2fs_inode, i_extra_end) - \
offsetof(struct f2fs_inode, i_extra_isize)) \
#define F2FS_OLD_ATTRIBUTE_SIZE (offsetof(struct f2fs_inode, i_addr))
#define F2FS_FITS_IN_INODE(f2fs_inode, extra_isize, field) \
((offsetof(typeof(*(f2fs_inode)), field) + \
sizeof((f2fs_inode)->field)) \
<= (F2FS_OLD_ATTRIBUTE_SIZE + (extra_isize))) \
#define DEFAULT_IOSTAT_PERIOD_MS 3000
#define MIN_IOSTAT_PERIOD_MS 100
/* maximum period of iostat tracing is 1 day */
#define MAX_IOSTAT_PERIOD_MS 8640000
static inline void f2fs_reset_iostat(struct f2fs_sb_info *sbi)
{
int i;
spin_lock(&sbi->iostat_lock);
for (i = 0; i < NR_IO_TYPE; i++) {
sbi->rw_iostat[i] = 0;
sbi->prev_rw_iostat[i] = 0;
}
spin_unlock(&sbi->iostat_lock);
}
extern void f2fs_record_iostat(struct f2fs_sb_info *sbi);
static inline void f2fs_update_iostat(struct f2fs_sb_info *sbi,
enum iostat_type type, unsigned long long io_bytes)
{
if (!sbi->iostat_enable)
return;
spin_lock(&sbi->iostat_lock);
sbi->rw_iostat[type] += io_bytes;
if (type == APP_WRITE_IO || type == APP_DIRECT_IO)
sbi->rw_iostat[APP_BUFFERED_IO] =
sbi->rw_iostat[APP_WRITE_IO] -
sbi->rw_iostat[APP_DIRECT_IO];
if (type == APP_READ_IO || type == APP_DIRECT_READ_IO)
sbi->rw_iostat[APP_BUFFERED_READ_IO] =
sbi->rw_iostat[APP_READ_IO] -
sbi->rw_iostat[APP_DIRECT_READ_IO];
spin_unlock(&sbi->iostat_lock);
f2fs_record_iostat(sbi);
}
#define __is_large_section(sbi) ((sbi)->segs_per_sec > 1)
#define __is_meta_io(fio) (PAGE_TYPE_OF_BIO((fio)->type) == META)
bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
block_t blkaddr, int type);
static inline void verify_blkaddr(struct f2fs_sb_info *sbi,
block_t blkaddr, int type)
{
if (!f2fs_is_valid_blkaddr(sbi, blkaddr, type)) {
f2fs_err(sbi, "invalid blkaddr: %u, type: %d, run fsck to fix.",
blkaddr, type);
f2fs_bug_on(sbi, 1);
}
}
static inline bool __is_valid_data_blkaddr(block_t blkaddr)
{
if (blkaddr == NEW_ADDR || blkaddr == NULL_ADDR ||
blkaddr == COMPRESS_ADDR)
return false;
return true;
}
/*
* file.c
*/
int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync);
void f2fs_truncate_data_blocks(struct dnode_of_data *dn);
int f2fs_do_truncate_blocks(struct inode *inode, u64 from, bool lock);
int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock);
int f2fs_truncate(struct inode *inode);
int f2fs_getattr(const struct path *path, struct kstat *stat,
u32 request_mask, unsigned int flags);
int f2fs_setattr(struct dentry *dentry, struct iattr *attr);
int f2fs_truncate_hole(struct inode *inode, pgoff_t pg_start, pgoff_t pg_end);
void f2fs_truncate_data_blocks_range(struct dnode_of_data *dn, int count);
int f2fs_precache_extents(struct inode *inode);
long f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
int f2fs_transfer_project_quota(struct inode *inode, kprojid_t kprojid);
int f2fs_pin_file_control(struct inode *inode, bool inc);
/*
* inode.c
*/
void f2fs_set_inode_flags(struct inode *inode);
bool f2fs_inode_chksum_verify(struct f2fs_sb_info *sbi, struct page *page);
void f2fs_inode_chksum_set(struct f2fs_sb_info *sbi, struct page *page);
struct inode *f2fs_iget(struct super_block *sb, unsigned long ino);
struct inode *f2fs_iget_retry(struct super_block *sb, unsigned long ino);
int f2fs_try_to_free_nats(struct f2fs_sb_info *sbi, int nr_shrink);
void f2fs_update_inode(struct inode *inode, struct page *node_page);
void f2fs_update_inode_page(struct inode *inode);
int f2fs_write_inode(struct inode *inode, struct writeback_control *wbc);
void f2fs_evict_inode(struct inode *inode);
void f2fs_handle_failed_inode(struct inode *inode);
/*
* namei.c
*/
int f2fs_update_extension_list(struct f2fs_sb_info *sbi, const char *name,
bool hot, bool set);
struct dentry *f2fs_get_parent(struct dentry *child);
/*
* dir.c
*/
unsigned char f2fs_get_de_type(struct f2fs_dir_entry *de);
int f2fs_init_casefolded_name(const struct inode *dir,
struct f2fs_filename *fname);
int f2fs_setup_filename(struct inode *dir, const struct qstr *iname,
int lookup, struct f2fs_filename *fname);
int f2fs_prepare_lookup(struct inode *dir, struct dentry *dentry,
struct f2fs_filename *fname);
void f2fs_free_filename(struct f2fs_filename *fname);
struct f2fs_dir_entry *f2fs_find_target_dentry(const struct f2fs_dentry_ptr *d,
const struct f2fs_filename *fname, int *max_slots);
int f2fs_fill_dentries(struct dir_context *ctx, struct f2fs_dentry_ptr *d,
unsigned int start_pos, struct fscrypt_str *fstr);
void f2fs_do_make_empty_dir(struct inode *inode, struct inode *parent,
struct f2fs_dentry_ptr *d);
struct page *f2fs_init_inode_metadata(struct inode *inode, struct inode *dir,
const struct f2fs_filename *fname, struct page *dpage);
void f2fs_update_parent_metadata(struct inode *dir, struct inode *inode,
unsigned int current_depth);
int f2fs_room_for_filename(const void *bitmap, int slots, int max_slots);
void f2fs_drop_nlink(struct inode *dir, struct inode *inode);
struct f2fs_dir_entry *__f2fs_find_entry(struct inode *dir,
const struct f2fs_filename *fname,
struct page **res_page);
struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir,
const struct qstr *child, struct page **res_page);
struct f2fs_dir_entry *f2fs_parent_dir(struct inode *dir, struct page **p);
ino_t f2fs_inode_by_name(struct inode *dir, const struct qstr *qstr,
struct page **page);
void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de,
struct page *page, struct inode *inode);
bool f2fs_has_enough_room(struct inode *dir, struct page *ipage,
const struct f2fs_filename *fname);
void f2fs_update_dentry(nid_t ino, umode_t mode, struct f2fs_dentry_ptr *d,
const struct fscrypt_str *name, f2fs_hash_t name_hash,
unsigned int bit_pos);
int f2fs_add_regular_entry(struct inode *dir, const struct f2fs_filename *fname,
struct inode *inode, nid_t ino, umode_t mode);
int f2fs_add_dentry(struct inode *dir, const struct f2fs_filename *fname,
struct inode *inode, nid_t ino, umode_t mode);
int f2fs_do_add_link(struct inode *dir, const struct qstr *name,
struct inode *inode, nid_t ino, umode_t mode);
void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page,
struct inode *dir, struct inode *inode);
int f2fs_do_tmpfile(struct inode *inode, struct inode *dir);
bool f2fs_empty_dir(struct inode *dir);
static inline int f2fs_add_link(struct dentry *dentry, struct inode *inode)
{
if (fscrypt_is_nokey_name(dentry))
return -ENOKEY;
return f2fs_do_add_link(d_inode(dentry->d_parent), &dentry->d_name,
inode, inode->i_ino, inode->i_mode);
}
/*
* super.c
*/
int f2fs_inode_dirtied(struct inode *inode, bool sync);
void f2fs_inode_synced(struct inode *inode);
int f2fs_enable_quota_files(struct f2fs_sb_info *sbi, bool rdonly);
int f2fs_quota_sync(struct super_block *sb, int type);
loff_t max_file_blocks(struct inode *inode);
void f2fs_quota_off_umount(struct super_block *sb);
int f2fs_commit_super(struct f2fs_sb_info *sbi, bool recover);
int f2fs_sync_fs(struct super_block *sb, int sync);
int f2fs_sanity_check_ckpt(struct f2fs_sb_info *sbi);
/*
* hash.c
*/
void f2fs_hash_filename(const struct inode *dir, struct f2fs_filename *fname);
/*
* node.c
*/
struct node_info;
int f2fs_check_nid_range(struct f2fs_sb_info *sbi, nid_t nid);
bool f2fs_available_free_memory(struct f2fs_sb_info *sbi, int type);
bool f2fs_in_warm_node_list(struct f2fs_sb_info *sbi, struct page *page);
void f2fs_init_fsync_node_info(struct f2fs_sb_info *sbi);
void f2fs_del_fsync_node_entry(struct f2fs_sb_info *sbi, struct page *page);
void f2fs_reset_fsync_node_info(struct f2fs_sb_info *sbi);
int f2fs_need_dentry_mark(struct f2fs_sb_info *sbi, nid_t nid);
bool f2fs_is_checkpointed_node(struct f2fs_sb_info *sbi, nid_t nid);
bool f2fs_need_inode_block_update(struct f2fs_sb_info *sbi, nid_t ino);
int f2fs_get_node_info(struct f2fs_sb_info *sbi, nid_t nid,
struct node_info *ni, bool checkpoint_context);
pgoff_t f2fs_get_next_page_offset(struct dnode_of_data *dn, pgoff_t pgofs);
int f2fs_get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode);
int f2fs_truncate_inode_blocks(struct inode *inode, pgoff_t from);
int f2fs_truncate_xattr_node(struct inode *inode);
int f2fs_wait_on_node_pages_writeback(struct f2fs_sb_info *sbi,
unsigned int seq_id);
int f2fs_remove_inode_page(struct inode *inode);
struct page *f2fs_new_inode_page(struct inode *inode);
struct page *f2fs_new_node_page(struct dnode_of_data *dn, unsigned int ofs);
void f2fs_ra_node_page(struct f2fs_sb_info *sbi, nid_t nid);
struct page *f2fs_get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid);
struct page *f2fs_get_node_page_ra(struct page *parent, int start);
int f2fs_move_node_page(struct page *node_page, int gc_type);
void f2fs_flush_inline_data(struct f2fs_sb_info *sbi);
int f2fs_fsync_node_pages(struct f2fs_sb_info *sbi, struct inode *inode,
struct writeback_control *wbc, bool atomic,
unsigned int *seq_id);
int f2fs_sync_node_pages(struct f2fs_sb_info *sbi,
struct writeback_control *wbc,
bool do_balance, enum iostat_type io_type);
int f2fs_build_free_nids(struct f2fs_sb_info *sbi, bool sync, bool mount);
bool f2fs_alloc_nid(struct f2fs_sb_info *sbi, nid_t *nid);
void f2fs_alloc_nid_done(struct f2fs_sb_info *sbi, nid_t nid);
void f2fs_alloc_nid_failed(struct f2fs_sb_info *sbi, nid_t nid);
int f2fs_try_to_free_nids(struct f2fs_sb_info *sbi, int nr_shrink);
int f2fs_recover_inline_xattr(struct inode *inode, struct page *page);
int f2fs_recover_xattr_data(struct inode *inode, struct page *page);
int f2fs_recover_inode_page(struct f2fs_sb_info *sbi, struct page *page);
int f2fs_restore_node_summary(struct f2fs_sb_info *sbi,
unsigned int segno, struct f2fs_summary_block *sum);
int f2fs_flush_nat_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc);
int f2fs_build_node_manager(struct f2fs_sb_info *sbi);
void f2fs_destroy_node_manager(struct f2fs_sb_info *sbi);
int __init f2fs_create_node_manager_caches(void);
void f2fs_destroy_node_manager_caches(void);
/*
* segment.c
*/
bool f2fs_need_SSR(struct f2fs_sb_info *sbi);
void f2fs_register_inmem_page(struct inode *inode, struct page *page);
void f2fs_drop_inmem_pages_all(struct f2fs_sb_info *sbi, bool gc_failure);
void f2fs_drop_inmem_pages(struct inode *inode);
void f2fs_drop_inmem_page(struct inode *inode, struct page *page);
int f2fs_commit_inmem_pages(struct inode *inode);
void f2fs_balance_fs(struct f2fs_sb_info *sbi, bool need);
void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi, bool from_bg);
int f2fs_issue_flush(struct f2fs_sb_info *sbi, nid_t ino);
int f2fs_create_flush_cmd_control(struct f2fs_sb_info *sbi);
int f2fs_flush_device_cache(struct f2fs_sb_info *sbi);
void f2fs_destroy_flush_cmd_control(struct f2fs_sb_info *sbi, bool free);
void f2fs_invalidate_blocks(struct f2fs_sb_info *sbi, block_t addr);
bool f2fs_is_checkpointed_data(struct f2fs_sb_info *sbi, block_t blkaddr);
void f2fs_drop_discard_cmd(struct f2fs_sb_info *sbi);
void f2fs_stop_discard_thread(struct f2fs_sb_info *sbi);
bool f2fs_issue_discard_timeout(struct f2fs_sb_info *sbi);
void f2fs_clear_prefree_segments(struct f2fs_sb_info *sbi,
struct cp_control *cpc);
void f2fs_dirty_to_prefree(struct f2fs_sb_info *sbi);
block_t f2fs_get_unusable_blocks(struct f2fs_sb_info *sbi);
int f2fs_disable_cp_again(struct f2fs_sb_info *sbi, block_t unusable);
void f2fs_release_discard_addrs(struct f2fs_sb_info *sbi);
int f2fs_npages_for_summary_flush(struct f2fs_sb_info *sbi, bool for_ra);
bool f2fs_segment_has_free_slot(struct f2fs_sb_info *sbi, int segno);
void f2fs_init_inmem_curseg(struct f2fs_sb_info *sbi);
void f2fs_save_inmem_curseg(struct f2fs_sb_info *sbi);
void f2fs_restore_inmem_curseg(struct f2fs_sb_info *sbi);
void f2fs_get_new_segment(struct f2fs_sb_info *sbi,
unsigned int *newseg, bool new_sec, int dir);
void f2fs_allocate_segment_for_resize(struct f2fs_sb_info *sbi, int type,
unsigned int start, unsigned int end);
void f2fs_allocate_new_section(struct f2fs_sb_info *sbi, int type, bool force);
void f2fs_allocate_new_segments(struct f2fs_sb_info *sbi);
int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range);
bool f2fs_exist_trim_candidates(struct f2fs_sb_info *sbi,
struct cp_control *cpc);
struct page *f2fs_get_sum_page(struct f2fs_sb_info *sbi, unsigned int segno);
void f2fs_update_meta_page(struct f2fs_sb_info *sbi, void *src,
block_t blk_addr);
void f2fs_do_write_meta_page(struct f2fs_sb_info *sbi, struct page *page,
enum iostat_type io_type);
void f2fs_do_write_node_page(unsigned int nid, struct f2fs_io_info *fio);
void f2fs_outplace_write_data(struct dnode_of_data *dn,
struct f2fs_io_info *fio);
int f2fs_inplace_write_data(struct f2fs_io_info *fio);
void f2fs_do_replace_block(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
block_t old_blkaddr, block_t new_blkaddr,
bool recover_curseg, bool recover_newaddr,
bool from_gc);
void f2fs_replace_block(struct f2fs_sb_info *sbi, struct dnode_of_data *dn,
block_t old_addr, block_t new_addr,
unsigned char version, bool recover_curseg,
bool recover_newaddr);
void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
block_t old_blkaddr, block_t *new_blkaddr,
struct f2fs_summary *sum, int type,
struct f2fs_io_info *fio);
void f2fs_wait_on_page_writeback(struct page *page,
enum page_type type, bool ordered, bool locked);
void f2fs_wait_on_block_writeback(struct inode *inode, block_t blkaddr);
void f2fs_wait_on_block_writeback_range(struct inode *inode, block_t blkaddr,
block_t len);
void f2fs_write_data_summaries(struct f2fs_sb_info *sbi, block_t start_blk);
void f2fs_write_node_summaries(struct f2fs_sb_info *sbi, block_t start_blk);
int f2fs_lookup_journal_in_cursum(struct f2fs_journal *journal, int type,
unsigned int val, int alloc);
void f2fs_flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc);
int f2fs_fix_curseg_write_pointer(struct f2fs_sb_info *sbi);
int f2fs_check_write_pointer(struct f2fs_sb_info *sbi);
int f2fs_build_segment_manager(struct f2fs_sb_info *sbi);
void f2fs_destroy_segment_manager(struct f2fs_sb_info *sbi);
int __init f2fs_create_segment_manager_caches(void);
void f2fs_destroy_segment_manager_caches(void);
int f2fs_rw_hint_to_seg_type(enum rw_hint hint);
enum rw_hint f2fs_io_type_to_rw_hint(struct f2fs_sb_info *sbi,
enum page_type type, enum temp_type temp);
unsigned int f2fs_usable_segs_in_sec(struct f2fs_sb_info *sbi,
unsigned int segno);
unsigned int f2fs_usable_blks_in_seg(struct f2fs_sb_info *sbi,
unsigned int segno);
/*
* checkpoint.c
*/
void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io);
struct page *f2fs_grab_meta_page(struct f2fs_sb_info *sbi, pgoff_t index);
struct page *f2fs_get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index);
struct page *f2fs_get_meta_page_retry(struct f2fs_sb_info *sbi, pgoff_t index);
struct page *f2fs_get_tmp_page(struct f2fs_sb_info *sbi, pgoff_t index);
bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
block_t blkaddr, int type);
int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages,
int type, bool sync);
void f2fs_ra_meta_pages_cond(struct f2fs_sb_info *sbi, pgoff_t index);
long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,
long nr_to_write, enum iostat_type io_type);
void f2fs_add_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type);
void f2fs_remove_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type);
void f2fs_release_ino_entry(struct f2fs_sb_info *sbi, bool all);
bool f2fs_exist_written_data(struct f2fs_sb_info *sbi, nid_t ino, int mode);
void f2fs_set_dirty_device(struct f2fs_sb_info *sbi, nid_t ino,
unsigned int devidx, int type);
bool f2fs_is_dirty_device(struct f2fs_sb_info *sbi, nid_t ino,
unsigned int devidx, int type);
int f2fs_sync_inode_meta(struct f2fs_sb_info *sbi);
int f2fs_acquire_orphan_inode(struct f2fs_sb_info *sbi);
void f2fs_release_orphan_inode(struct f2fs_sb_info *sbi);
void f2fs_add_orphan_inode(struct inode *inode);
void f2fs_remove_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino);
int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi);
int f2fs_get_valid_checkpoint(struct f2fs_sb_info *sbi);
void f2fs_update_dirty_page(struct inode *inode, struct page *page);
void f2fs_remove_dirty_inode(struct inode *inode);
int f2fs_sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type);
void f2fs_wait_on_all_pages(struct f2fs_sb_info *sbi, int type);
u64 f2fs_get_sectors_written(struct f2fs_sb_info *sbi);
int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc);
void f2fs_init_ino_entry_info(struct f2fs_sb_info *sbi);
int __init f2fs_create_checkpoint_caches(void);
void f2fs_destroy_checkpoint_caches(void);
int f2fs_issue_checkpoint(struct f2fs_sb_info *sbi);
int f2fs_start_ckpt_thread(struct f2fs_sb_info *sbi);
void f2fs_stop_ckpt_thread(struct f2fs_sb_info *sbi);
void f2fs_init_ckpt_req_control(struct f2fs_sb_info *sbi);
/*
* data.c
*/
int __init f2fs_init_bioset(void);
void f2fs_destroy_bioset(void);
int f2fs_init_bio_entry_cache(void);
void f2fs_destroy_bio_entry_cache(void);
void f2fs_submit_bio(struct f2fs_sb_info *sbi,
struct bio *bio, enum page_type type);
void f2fs_submit_merged_write(struct f2fs_sb_info *sbi, enum page_type type);
void f2fs_submit_merged_write_cond(struct f2fs_sb_info *sbi,
struct inode *inode, struct page *page,
nid_t ino, enum page_type type);
void f2fs_submit_merged_ipu_write(struct f2fs_sb_info *sbi,
struct bio **bio, struct page *page);
void f2fs_flush_merged_writes(struct f2fs_sb_info *sbi);
int f2fs_submit_page_bio(struct f2fs_io_info *fio);
int f2fs_merge_page_bio(struct f2fs_io_info *fio);
void f2fs_submit_page_write(struct f2fs_io_info *fio);
struct block_device *f2fs_target_device(struct f2fs_sb_info *sbi,
block_t blk_addr, struct bio *bio);
int f2fs_target_device_index(struct f2fs_sb_info *sbi, block_t blkaddr);
void f2fs_set_data_blkaddr(struct dnode_of_data *dn);
void f2fs_update_data_blkaddr(struct dnode_of_data *dn, block_t blkaddr);
int f2fs_reserve_new_blocks(struct dnode_of_data *dn, blkcnt_t count);
int f2fs_reserve_new_block(struct dnode_of_data *dn);
int f2fs_get_block(struct dnode_of_data *dn, pgoff_t index);
int f2fs_preallocate_blocks(struct kiocb *iocb, struct iov_iter *from);
int f2fs_reserve_block(struct dnode_of_data *dn, pgoff_t index);
struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index,
int op_flags, bool for_write);
struct page *f2fs_find_data_page(struct inode *inode, pgoff_t index);
struct page *f2fs_get_lock_data_page(struct inode *inode, pgoff_t index,
bool for_write);
struct page *f2fs_get_new_data_page(struct inode *inode,
struct page *ipage, pgoff_t index, bool new_i_size);
int f2fs_do_write_data_page(struct f2fs_io_info *fio);
void f2fs_do_map_lock(struct f2fs_sb_info *sbi, int flag, bool lock);
int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map,
int create, int flag);
int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
u64 start, u64 len);
int f2fs_encrypt_one_page(struct f2fs_io_info *fio);
bool f2fs_should_update_inplace(struct inode *inode, struct f2fs_io_info *fio);
bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio);
int f2fs_write_single_data_page(struct page *page, int *submitted,
struct bio **bio, sector_t *last_block,
struct writeback_control *wbc,
enum iostat_type io_type,
int compr_blocks, bool allow_balance);
void f2fs_invalidate_page(struct page *page, unsigned int offset,
unsigned int length);
int f2fs_release_page(struct page *page, gfp_t wait);
#ifdef CONFIG_MIGRATION
int f2fs_migrate_page(struct address_space *mapping, struct page *newpage,
struct page *page, enum migrate_mode mode);
#endif
bool f2fs_overwrite_io(struct inode *inode, loff_t pos, size_t len);
void f2fs_clear_page_cache_dirty_tag(struct page *page);
int f2fs_init_post_read_processing(void);
void f2fs_destroy_post_read_processing(void);
int f2fs_init_post_read_wq(struct f2fs_sb_info *sbi);
void f2fs_destroy_post_read_wq(struct f2fs_sb_info *sbi);
/*
* gc.c
*/
int f2fs_start_gc_thread(struct f2fs_sb_info *sbi);
void f2fs_stop_gc_thread(struct f2fs_sb_info *sbi);
block_t f2fs_start_bidx_of_node(unsigned int node_ofs, struct inode *inode);
int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, bool background, bool force,
unsigned int segno);
void f2fs_build_gc_manager(struct f2fs_sb_info *sbi);
int f2fs_resize_fs(struct f2fs_sb_info *sbi, __u64 block_count);
int __init f2fs_create_garbage_collection_cache(void);
void f2fs_destroy_garbage_collection_cache(void);
/*
* recovery.c
*/
int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only);
bool f2fs_space_for_roll_forward(struct f2fs_sb_info *sbi);
int __init f2fs_create_recovery_cache(void);
void f2fs_destroy_recovery_cache(void);
/*
* debug.c
*/
#ifdef CONFIG_F2FS_STAT_FS
struct f2fs_stat_info {
struct list_head stat_list;
struct f2fs_sb_info *sbi;
int all_area_segs, sit_area_segs, nat_area_segs, ssa_area_segs;
int main_area_segs, main_area_sections, main_area_zones;
unsigned long long hit_largest, hit_cached, hit_rbtree;
unsigned long long hit_total, total_ext;
int ext_tree, zombie_tree, ext_node;
int ndirty_node, ndirty_dent, ndirty_meta, ndirty_imeta;
int ndirty_data, ndirty_qdata;
int inmem_pages;
unsigned int ndirty_dirs, ndirty_files, nquota_files, ndirty_all;
int nats, dirty_nats, sits, dirty_sits;
int free_nids, avail_nids, alloc_nids;
int total_count, utilization;
int bg_gc, nr_wb_cp_data, nr_wb_data;
int nr_rd_data, nr_rd_node, nr_rd_meta;
int nr_dio_read, nr_dio_write;
unsigned int io_skip_bggc, other_skip_bggc;
int nr_flushing, nr_flushed, flush_list_empty;
int nr_discarding, nr_discarded;
int nr_discard_cmd;
unsigned int undiscard_blks;
int nr_issued_ckpt, nr_total_ckpt, nr_queued_ckpt;
unsigned int cur_ckpt_time, peak_ckpt_time;
int inline_xattr, inline_inode, inline_dir, append, update, orphans;
int compr_inode;
unsigned long long compr_blocks;
int aw_cnt, max_aw_cnt, vw_cnt, max_vw_cnt;
unsigned int valid_count, valid_node_count, valid_inode_count, discard_blks;
unsigned int bimodal, avg_vblocks;
int util_free, util_valid, util_invalid;
int rsvd_segs, overp_segs;
int dirty_count, node_pages, meta_pages, compress_pages;
int compress_page_hit;
int prefree_count, call_count, cp_count, bg_cp_count;
int tot_segs, node_segs, data_segs, free_segs, free_secs;
int bg_node_segs, bg_data_segs;
int tot_blks, data_blks, node_blks;
int bg_data_blks, bg_node_blks;
unsigned long long skipped_atomic_files[2];
int curseg[NR_CURSEG_TYPE];
int cursec[NR_CURSEG_TYPE];
int curzone[NR_CURSEG_TYPE];
unsigned int dirty_seg[NR_CURSEG_TYPE];
unsigned int full_seg[NR_CURSEG_TYPE];
unsigned int valid_blks[NR_CURSEG_TYPE];
unsigned int meta_count[META_MAX];
unsigned int segment_count[2];
unsigned int block_count[2];
unsigned int inplace_count;
unsigned long long base_mem, cache_mem, page_mem;
};
static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)
{
return (struct f2fs_stat_info *)sbi->stat_info;
}
#define stat_inc_cp_count(si) ((si)->cp_count++)
#define stat_inc_bg_cp_count(si) ((si)->bg_cp_count++)
#define stat_inc_call_count(si) ((si)->call_count++)
#define stat_inc_bggc_count(si) ((si)->bg_gc++)
#define stat_io_skip_bggc_count(sbi) ((sbi)->io_skip_bggc++)
#define stat_other_skip_bggc_count(sbi) ((sbi)->other_skip_bggc++)
#define stat_inc_dirty_inode(sbi, type) ((sbi)->ndirty_inode[type]++)
#define stat_dec_dirty_inode(sbi, type) ((sbi)->ndirty_inode[type]--)
#define stat_inc_total_hit(sbi) (atomic64_inc(&(sbi)->total_hit_ext))
#define stat_inc_rbtree_node_hit(sbi) (atomic64_inc(&(sbi)->read_hit_rbtree))
#define stat_inc_largest_node_hit(sbi) (atomic64_inc(&(sbi)->read_hit_largest))
#define stat_inc_cached_node_hit(sbi) (atomic64_inc(&(sbi)->read_hit_cached))
#define stat_inc_inline_xattr(inode) \
do { \
if (f2fs_has_inline_xattr(inode)) \
(atomic_inc(&F2FS_I_SB(inode)->inline_xattr)); \
} while (0)
#define stat_dec_inline_xattr(inode) \
do { \
if (f2fs_has_inline_xattr(inode)) \
(atomic_dec(&F2FS_I_SB(inode)->inline_xattr)); \
} while (0)
#define stat_inc_inline_inode(inode) \
do { \
if (f2fs_has_inline_data(inode)) \
(atomic_inc(&F2FS_I_SB(inode)->inline_inode)); \
} while (0)
#define stat_dec_inline_inode(inode) \
do { \
if (f2fs_has_inline_data(inode)) \
(atomic_dec(&F2FS_I_SB(inode)->inline_inode)); \
} while (0)
#define stat_inc_inline_dir(inode) \
do { \
if (f2fs_has_inline_dentry(inode)) \
(atomic_inc(&F2FS_I_SB(inode)->inline_dir)); \
} while (0)
#define stat_dec_inline_dir(inode) \
do { \
if (f2fs_has_inline_dentry(inode)) \
(atomic_dec(&F2FS_I_SB(inode)->inline_dir)); \
} while (0)
#define stat_inc_compr_inode(inode) \
do { \
if (f2fs_compressed_file(inode)) \
(atomic_inc(&F2FS_I_SB(inode)->compr_inode)); \
} while (0)
#define stat_dec_compr_inode(inode) \
do { \
if (f2fs_compressed_file(inode)) \
(atomic_dec(&F2FS_I_SB(inode)->compr_inode)); \
} while (0)
#define stat_add_compr_blocks(inode, blocks) \
(atomic64_add(blocks, &F2FS_I_SB(inode)->compr_blocks))
#define stat_sub_compr_blocks(inode, blocks) \
(atomic64_sub(blocks, &F2FS_I_SB(inode)->compr_blocks))
#define stat_inc_meta_count(sbi, blkaddr) \
do { \
if (blkaddr < SIT_I(sbi)->sit_base_addr) \
atomic_inc(&(sbi)->meta_count[META_CP]); \
else if (blkaddr < NM_I(sbi)->nat_blkaddr) \
atomic_inc(&(sbi)->meta_count[META_SIT]); \
else if (blkaddr < SM_I(sbi)->ssa_blkaddr) \
atomic_inc(&(sbi)->meta_count[META_NAT]); \
else if (blkaddr < SM_I(sbi)->main_blkaddr) \
atomic_inc(&(sbi)->meta_count[META_SSA]); \
} while (0)
#define stat_inc_seg_type(sbi, curseg) \
((sbi)->segment_count[(curseg)->alloc_type]++)
#define stat_inc_block_count(sbi, curseg) \
((sbi)->block_count[(curseg)->alloc_type]++)
#define stat_inc_inplace_blocks(sbi) \
(atomic_inc(&(sbi)->inplace_count))
#define stat_update_max_atomic_write(inode) \
do { \
int cur = F2FS_I_SB(inode)->atomic_files; \
int max = atomic_read(&F2FS_I_SB(inode)->max_aw_cnt); \
if (cur > max) \
atomic_set(&F2FS_I_SB(inode)->max_aw_cnt, cur); \
} while (0)
#define stat_inc_volatile_write(inode) \
(atomic_inc(&F2FS_I_SB(inode)->vw_cnt))
#define stat_dec_volatile_write(inode) \
(atomic_dec(&F2FS_I_SB(inode)->vw_cnt))
#define stat_update_max_volatile_write(inode) \
do { \
int cur = atomic_read(&F2FS_I_SB(inode)->vw_cnt); \
int max = atomic_read(&F2FS_I_SB(inode)->max_vw_cnt); \
if (cur > max) \
atomic_set(&F2FS_I_SB(inode)->max_vw_cnt, cur); \
} while (0)
#define stat_inc_seg_count(sbi, type, gc_type) \
do { \
struct f2fs_stat_info *si = F2FS_STAT(sbi); \
si->tot_segs++; \
if ((type) == SUM_TYPE_DATA) { \
si->data_segs++; \
si->bg_data_segs += (gc_type == BG_GC) ? 1 : 0; \
} else { \
si->node_segs++; \
si->bg_node_segs += (gc_type == BG_GC) ? 1 : 0; \
} \
} while (0)
#define stat_inc_tot_blk_count(si, blks) \
((si)->tot_blks += (blks))
#define stat_inc_data_blk_count(sbi, blks, gc_type) \
do { \
struct f2fs_stat_info *si = F2FS_STAT(sbi); \
stat_inc_tot_blk_count(si, blks); \
si->data_blks += (blks); \
si->bg_data_blks += ((gc_type) == BG_GC) ? (blks) : 0; \
} while (0)
#define stat_inc_node_blk_count(sbi, blks, gc_type) \
do { \
struct f2fs_stat_info *si = F2FS_STAT(sbi); \
stat_inc_tot_blk_count(si, blks); \
si->node_blks += (blks); \
si->bg_node_blks += ((gc_type) == BG_GC) ? (blks) : 0; \
} while (0)
int f2fs_build_stats(struct f2fs_sb_info *sbi);
void f2fs_destroy_stats(struct f2fs_sb_info *sbi);
void __init f2fs_create_root_stats(void);
void f2fs_destroy_root_stats(void);
void f2fs_update_sit_info(struct f2fs_sb_info *sbi);
#else
#define stat_inc_cp_count(si) do { } while (0)
#define stat_inc_bg_cp_count(si) do { } while (0)
#define stat_inc_call_count(si) do { } while (0)
#define stat_inc_bggc_count(si) do { } while (0)
#define stat_io_skip_bggc_count(sbi) do { } while (0)
#define stat_other_skip_bggc_count(sbi) do { } while (0)
#define stat_inc_dirty_inode(sbi, type) do { } while (0)
#define stat_dec_dirty_inode(sbi, type) do { } while (0)
#define stat_inc_total_hit(sbi) do { } while (0)
#define stat_inc_rbtree_node_hit(sbi) do { } while (0)
#define stat_inc_largest_node_hit(sbi) do { } while (0)
#define stat_inc_cached_node_hit(sbi) do { } while (0)
#define stat_inc_inline_xattr(inode) do { } while (0)
#define stat_dec_inline_xattr(inode) do { } while (0)
#define stat_inc_inline_inode(inode) do { } while (0)
#define stat_dec_inline_inode(inode) do { } while (0)
#define stat_inc_inline_dir(inode) do { } while (0)
#define stat_dec_inline_dir(inode) do { } while (0)
#define stat_inc_compr_inode(inode) do { } while (0)
#define stat_dec_compr_inode(inode) do { } while (0)
#define stat_add_compr_blocks(inode, blocks) do { } while (0)
#define stat_sub_compr_blocks(inode, blocks) do { } while (0)
#define stat_update_max_atomic_write(inode) do { } while (0)
#define stat_inc_volatile_write(inode) do { } while (0)
#define stat_dec_volatile_write(inode) do { } while (0)
#define stat_update_max_volatile_write(inode) do { } while (0)
#define stat_inc_meta_count(sbi, blkaddr) do { } while (0)
#define stat_inc_seg_type(sbi, curseg) do { } while (0)
#define stat_inc_block_count(sbi, curseg) do { } while (0)
#define stat_inc_inplace_blocks(sbi) do { } while (0)
#define stat_inc_seg_count(sbi, type, gc_type) do { } while (0)
#define stat_inc_tot_blk_count(si, blks) do { } while (0)
#define stat_inc_data_blk_count(sbi, blks, gc_type) do { } while (0)
#define stat_inc_node_blk_count(sbi, blks, gc_type) do { } while (0)
static inline int f2fs_build_stats(struct f2fs_sb_info *sbi) { return 0; }
static inline void f2fs_destroy_stats(struct f2fs_sb_info *sbi) { }
static inline void __init f2fs_create_root_stats(void) { }
static inline void f2fs_destroy_root_stats(void) { }
static inline void f2fs_update_sit_info(struct f2fs_sb_info *sbi) {}
#endif
extern const struct file_operations f2fs_dir_operations;
extern const struct file_operations f2fs_file_operations;
extern const struct inode_operations f2fs_file_inode_operations;
extern const struct address_space_operations f2fs_dblock_aops;
extern const struct address_space_operations f2fs_node_aops;
extern const struct address_space_operations f2fs_meta_aops;
extern const struct inode_operations f2fs_dir_inode_operations;
extern const struct inode_operations f2fs_symlink_inode_operations;
extern const struct inode_operations f2fs_encrypted_symlink_inode_operations;
extern const struct inode_operations f2fs_special_inode_operations;
extern struct kmem_cache *f2fs_inode_entry_slab;
/*
* inline.c
*/
bool f2fs_may_inline_data(struct inode *inode);
bool f2fs_may_inline_dentry(struct inode *inode);
void f2fs_do_read_inline_data(struct page *page, struct page *ipage);
void f2fs_truncate_inline_inode(struct inode *inode,
struct page *ipage, u64 from);
int f2fs_read_inline_data(struct inode *inode, struct page *page);
int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page);
int f2fs_convert_inline_inode(struct inode *inode);
int f2fs_try_convert_inline_dir(struct inode *dir, struct dentry *dentry);
int f2fs_write_inline_data(struct inode *inode, struct page *page);
int f2fs_recover_inline_data(struct inode *inode, struct page *npage);
struct f2fs_dir_entry *f2fs_find_in_inline_dir(struct inode *dir,
const struct f2fs_filename *fname,
struct page **res_page);
int f2fs_make_empty_inline_dir(struct inode *inode, struct inode *parent,
struct page *ipage);
int f2fs_add_inline_entry(struct inode *dir, const struct f2fs_filename *fname,
struct inode *inode, nid_t ino, umode_t mode);
void f2fs_delete_inline_entry(struct f2fs_dir_entry *dentry,
struct page *page, struct inode *dir,
struct inode *inode);
bool f2fs_empty_inline_dir(struct inode *dir);
int f2fs_read_inline_dir(struct file *file, struct dir_context *ctx,
struct fscrypt_str *fstr);
int f2fs_inline_data_fiemap(struct inode *inode,
struct fiemap_extent_info *fieinfo,
__u64 start, __u64 len);
/*
* shrinker.c
*/
unsigned long f2fs_shrink_count(struct shrinker *shrink,
struct shrink_control *sc);
unsigned long f2fs_shrink_scan(struct shrinker *shrink,
struct shrink_control *sc);
void f2fs_join_shrinker(struct f2fs_sb_info *sbi);
void f2fs_leave_shrinker(struct f2fs_sb_info *sbi);
/*
* extent_cache.c
*/
struct rb_entry *f2fs_lookup_rb_tree(struct rb_root_cached *root,
struct rb_entry *cached_re, unsigned int ofs);
struct rb_node **f2fs_lookup_rb_tree_ext(struct f2fs_sb_info *sbi,
struct rb_root_cached *root,
struct rb_node **parent,
unsigned long long key, bool *left_most);
struct rb_node **f2fs_lookup_rb_tree_for_insert(struct f2fs_sb_info *sbi,
struct rb_root_cached *root,
struct rb_node **parent,
unsigned int ofs, bool *leftmost);
struct rb_entry *f2fs_lookup_rb_tree_ret(struct rb_root_cached *root,
struct rb_entry *cached_re, unsigned int ofs,
struct rb_entry **prev_entry, struct rb_entry **next_entry,
struct rb_node ***insert_p, struct rb_node **insert_parent,
bool force, bool *leftmost);
bool f2fs_check_rb_tree_consistence(struct f2fs_sb_info *sbi,
struct rb_root_cached *root, bool check_key);
unsigned int f2fs_shrink_extent_tree(struct f2fs_sb_info *sbi, int nr_shrink);
void f2fs_init_extent_tree(struct inode *inode, struct page *ipage);
void f2fs_drop_extent_tree(struct inode *inode);
unsigned int f2fs_destroy_extent_node(struct inode *inode);
void f2fs_destroy_extent_tree(struct inode *inode);
bool f2fs_lookup_extent_cache(struct inode *inode, pgoff_t pgofs,
struct extent_info *ei);
void f2fs_update_extent_cache(struct dnode_of_data *dn);
void f2fs_update_extent_cache_range(struct dnode_of_data *dn,
pgoff_t fofs, block_t blkaddr, unsigned int len);
void f2fs_init_extent_cache_info(struct f2fs_sb_info *sbi);
int __init f2fs_create_extent_cache(void);
void f2fs_destroy_extent_cache(void);
/*
* sysfs.c
*/
int __init f2fs_init_sysfs(void);
void f2fs_exit_sysfs(void);
int f2fs_register_sysfs(struct f2fs_sb_info *sbi);
void f2fs_unregister_sysfs(struct f2fs_sb_info *sbi);
/* verity.c */
extern const struct fsverity_operations f2fs_verityops;
/*
* crypto support
*/
static inline bool f2fs_encrypted_file(struct inode *inode)
{
return IS_ENCRYPTED(inode) && S_ISREG(inode->i_mode);
}
static inline void f2fs_set_encrypted_inode(struct inode *inode)
{
#ifdef CONFIG_FS_ENCRYPTION
file_set_encrypt(inode);
f2fs_set_inode_flags(inode);
#endif
}
/*
* Returns true if the reads of the inode's data need to undergo some
* postprocessing step, like decryption or authenticity verification.
*/
static inline bool f2fs_post_read_required(struct inode *inode)
{
return f2fs_encrypted_file(inode) || fsverity_active(inode) ||
f2fs_compressed_file(inode);
}
/*
* compress.c
*/
#ifdef CONFIG_F2FS_FS_COMPRESSION
bool f2fs_is_compressed_page(struct page *page);
struct page *f2fs_compress_control_page(struct page *page);
int f2fs_prepare_compress_overwrite(struct inode *inode,
struct page **pagep, pgoff_t index, void **fsdata);
bool f2fs_compress_write_end(struct inode *inode, void *fsdata,
pgoff_t index, unsigned copied);
int f2fs_truncate_partial_cluster(struct inode *inode, u64 from, bool lock);
void f2fs_compress_write_end_io(struct bio *bio, struct page *page);
bool f2fs_is_compress_backend_ready(struct inode *inode);
int f2fs_init_compress_mempool(void);
void f2fs_destroy_compress_mempool(void);
void f2fs_decompress_cluster(struct decompress_io_ctx *dic);
void f2fs_end_read_compressed_page(struct page *page, bool failed,
block_t blkaddr);
bool f2fs_cluster_is_empty(struct compress_ctx *cc);
bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index);
void f2fs_compress_ctx_add_page(struct compress_ctx *cc, struct page *page);
int f2fs_write_multi_pages(struct compress_ctx *cc,
int *submitted,
struct writeback_control *wbc,
enum iostat_type io_type);
int f2fs_is_compressed_cluster(struct inode *inode, pgoff_t index);
int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret,
unsigned nr_pages, sector_t *last_block_in_bio,
bool is_readahead, bool for_write);
struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc);
void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed);
void f2fs_put_page_dic(struct page *page);
int f2fs_init_compress_ctx(struct compress_ctx *cc);
void f2fs_destroy_compress_ctx(struct compress_ctx *cc, bool reuse);
void f2fs_init_compress_info(struct f2fs_sb_info *sbi);
int f2fs_init_compress_inode(struct f2fs_sb_info *sbi);
void f2fs_destroy_compress_inode(struct f2fs_sb_info *sbi);
int f2fs_init_page_array_cache(struct f2fs_sb_info *sbi);
void f2fs_destroy_page_array_cache(struct f2fs_sb_info *sbi);
int __init f2fs_init_compress_cache(void);
void f2fs_destroy_compress_cache(void);
struct address_space *COMPRESS_MAPPING(struct f2fs_sb_info *sbi);
void f2fs_invalidate_compress_page(struct f2fs_sb_info *sbi, block_t blkaddr);
void f2fs_cache_compressed_page(struct f2fs_sb_info *sbi, struct page *page,
nid_t ino, block_t blkaddr);
bool f2fs_load_compressed_page(struct f2fs_sb_info *sbi, struct page *page,
block_t blkaddr);
void f2fs_invalidate_compress_pages(struct f2fs_sb_info *sbi, nid_t ino);
#define inc_compr_inode_stat(inode) \
do { \
struct f2fs_sb_info *sbi = F2FS_I_SB(inode); \
sbi->compr_new_inode++; \
} while (0)
#define add_compr_block_stat(inode, blocks) \
do { \
struct f2fs_sb_info *sbi = F2FS_I_SB(inode); \
int diff = F2FS_I(inode)->i_cluster_size - blocks; \
sbi->compr_written_block += blocks; \
sbi->compr_saved_block += diff; \
} while (0)
#else
static inline bool f2fs_is_compressed_page(struct page *page) { return false; }
static inline bool f2fs_is_compress_backend_ready(struct inode *inode)
{
if (!f2fs_compressed_file(inode))
return true;
/* not support compression */
return false;
}
static inline struct page *f2fs_compress_control_page(struct page *page)
{
WARN_ON_ONCE(1);
return ERR_PTR(-EINVAL);
}
static inline int f2fs_init_compress_mempool(void) { return 0; }
static inline void f2fs_destroy_compress_mempool(void) { }
static inline void f2fs_decompress_cluster(struct decompress_io_ctx *dic) { }
static inline void f2fs_end_read_compressed_page(struct page *page,
bool failed, block_t blkaddr)
{
WARN_ON_ONCE(1);
}
static inline void f2fs_put_page_dic(struct page *page)
{
WARN_ON_ONCE(1);
}
static inline int f2fs_init_compress_inode(struct f2fs_sb_info *sbi) { return 0; }
static inline void f2fs_destroy_compress_inode(struct f2fs_sb_info *sbi) { }
static inline int f2fs_init_page_array_cache(struct f2fs_sb_info *sbi) { return 0; }
static inline void f2fs_destroy_page_array_cache(struct f2fs_sb_info *sbi) { }
static inline int __init f2fs_init_compress_cache(void) { return 0; }
static inline void f2fs_destroy_compress_cache(void) { }
static inline void f2fs_invalidate_compress_page(struct f2fs_sb_info *sbi,
block_t blkaddr) { }
static inline void f2fs_cache_compressed_page(struct f2fs_sb_info *sbi,
struct page *page, nid_t ino, block_t blkaddr) { }
static inline bool f2fs_load_compressed_page(struct f2fs_sb_info *sbi,
struct page *page, block_t blkaddr) { return false; }
static inline void f2fs_invalidate_compress_pages(struct f2fs_sb_info *sbi,
nid_t ino) { }
#define inc_compr_inode_stat(inode) do { } while (0)
#endif
static inline void set_compress_context(struct inode *inode)
{
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
F2FS_I(inode)->i_compress_algorithm =
F2FS_OPTION(sbi).compress_algorithm;
F2FS_I(inode)->i_log_cluster_size =
F2FS_OPTION(sbi).compress_log_size;
F2FS_I(inode)->i_compress_flag =
F2FS_OPTION(sbi).compress_chksum ?
1 << COMPRESS_CHKSUM : 0;
F2FS_I(inode)->i_cluster_size =
1 << F2FS_I(inode)->i_log_cluster_size;
if (F2FS_I(inode)->i_compress_algorithm == COMPRESS_LZ4 &&
F2FS_OPTION(sbi).compress_level)
F2FS_I(inode)->i_compress_flag |=
F2FS_OPTION(sbi).compress_level <<
COMPRESS_LEVEL_OFFSET;
F2FS_I(inode)->i_flags |= F2FS_COMPR_FL;
set_inode_flag(inode, FI_COMPRESSED_FILE);
stat_inc_compr_inode(inode);
inc_compr_inode_stat(inode);
f2fs_mark_inode_dirty_sync(inode, true);
}
static inline bool f2fs_disable_compressed_file(struct inode *inode)
{
struct f2fs_inode_info *fi = F2FS_I(inode);
if (!f2fs_compressed_file(inode))
return true;
if (S_ISREG(inode->i_mode) && F2FS_HAS_BLOCKS(inode))
return false;
fi->i_flags &= ~F2FS_COMPR_FL;
stat_dec_compr_inode(inode);
clear_inode_flag(inode, FI_COMPRESSED_FILE);
f2fs_mark_inode_dirty_sync(inode, true);
return true;
}
#define F2FS_FEATURE_FUNCS(name, flagname) \
static inline int f2fs_sb_has_##name(struct f2fs_sb_info *sbi) \
{ \
return F2FS_HAS_FEATURE(sbi, F2FS_FEATURE_##flagname); \
}
F2FS_FEATURE_FUNCS(encrypt, ENCRYPT);
F2FS_FEATURE_FUNCS(blkzoned, BLKZONED);
F2FS_FEATURE_FUNCS(extra_attr, EXTRA_ATTR);
F2FS_FEATURE_FUNCS(project_quota, PRJQUOTA);
F2FS_FEATURE_FUNCS(inode_chksum, INODE_CHKSUM);
F2FS_FEATURE_FUNCS(flexible_inline_xattr, FLEXIBLE_INLINE_XATTR);
F2FS_FEATURE_FUNCS(quota_ino, QUOTA_INO);
F2FS_FEATURE_FUNCS(inode_crtime, INODE_CRTIME);
F2FS_FEATURE_FUNCS(lost_found, LOST_FOUND);
F2FS_FEATURE_FUNCS(verity, VERITY);
F2FS_FEATURE_FUNCS(sb_chksum, SB_CHKSUM);
F2FS_FEATURE_FUNCS(casefold, CASEFOLD);
F2FS_FEATURE_FUNCS(compression, COMPRESSION);
F2FS_FEATURE_FUNCS(readonly, RO);
static inline bool f2fs_may_extent_tree(struct inode *inode)
{
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
if (!test_opt(sbi, EXTENT_CACHE) ||
is_inode_flag_set(inode, FI_NO_EXTENT) ||
(is_inode_flag_set(inode, FI_COMPRESSED_FILE) &&
!f2fs_sb_has_readonly(sbi)))
return false;
/*
* for recovered files during mount do not create extents
* if shrinker is not registered.
*/
if (list_empty(&sbi->s_list))
return false;
return S_ISREG(inode->i_mode);
}
#ifdef CONFIG_BLK_DEV_ZONED
static inline bool f2fs_blkz_is_seq(struct f2fs_sb_info *sbi, int devi,
block_t blkaddr)
{
unsigned int zno = blkaddr >> sbi->log_blocks_per_blkz;
return test_bit(zno, FDEV(devi).blkz_seq);
}
#endif
static inline bool f2fs_hw_should_discard(struct f2fs_sb_info *sbi)
{
return f2fs_sb_has_blkzoned(sbi);
}
static inline bool f2fs_bdev_support_discard(struct block_device *bdev)
{
return blk_queue_discard(bdev_get_queue(bdev)) ||
bdev_is_zoned(bdev);
}
static inline bool f2fs_hw_support_discard(struct f2fs_sb_info *sbi)
{
int i;
if (!f2fs_is_multi_device(sbi))
return f2fs_bdev_support_discard(sbi->sb->s_bdev);
for (i = 0; i < sbi->s_ndevs; i++)
if (f2fs_bdev_support_discard(FDEV(i).bdev))
return true;
return false;
}
static inline bool f2fs_realtime_discard_enable(struct f2fs_sb_info *sbi)
{
return (test_opt(sbi, DISCARD) && f2fs_hw_support_discard(sbi)) ||
f2fs_hw_should_discard(sbi);
}
static inline bool f2fs_hw_is_readonly(struct f2fs_sb_info *sbi)
{
int i;
if (!f2fs_is_multi_device(sbi))
return bdev_read_only(sbi->sb->s_bdev);
for (i = 0; i < sbi->s_ndevs; i++)
if (bdev_read_only(FDEV(i).bdev))
return true;
return false;
}
static inline bool f2fs_lfs_mode(struct f2fs_sb_info *sbi)
{
return F2FS_OPTION(sbi).fs_mode == FS_MODE_LFS;
}
static inline bool f2fs_may_compress(struct inode *inode)
{
if (IS_SWAPFILE(inode) || f2fs_is_pinned_file(inode) ||
f2fs_is_atomic_file(inode) ||
f2fs_is_volatile_file(inode))
return false;
return S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode);
}
static inline void f2fs_i_compr_blocks_update(struct inode *inode,
u64 blocks, bool add)
{
int diff = F2FS_I(inode)->i_cluster_size - blocks;
struct f2fs_inode_info *fi = F2FS_I(inode);
/* don't update i_compr_blocks if saved blocks were released */
if (!add && !atomic_read(&fi->i_compr_blocks))
return;
if (add) {
atomic_add(diff, &fi->i_compr_blocks);
stat_add_compr_blocks(inode, diff);
} else {
atomic_sub(diff, &fi->i_compr_blocks);
stat_sub_compr_blocks(inode, diff);
}
f2fs_mark_inode_dirty_sync(inode, true);
}
static inline int block_unaligned_IO(struct inode *inode,
struct kiocb *iocb, struct iov_iter *iter)
{
unsigned int i_blkbits = READ_ONCE(inode->i_blkbits);
unsigned int blocksize_mask = (1 << i_blkbits) - 1;
loff_t offset = iocb->ki_pos;
unsigned long align = offset | iov_iter_alignment(iter);
return align & blocksize_mask;
}
static inline int allow_outplace_dio(struct inode *inode,
struct kiocb *iocb, struct iov_iter *iter)
{
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
int rw = iov_iter_rw(iter);
return (f2fs_lfs_mode(sbi) && (rw == WRITE) &&
!block_unaligned_IO(inode, iocb, iter));
}
static inline bool f2fs_force_buffered_io(struct inode *inode,
struct kiocb *iocb, struct iov_iter *iter)
{
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
int rw = iov_iter_rw(iter);
if (!fscrypt_dio_supported(iocb, iter))
return true;
if (fsverity_active(inode))
return true;
if (f2fs_compressed_file(inode))
return true;
if (f2fs_is_multi_device(sbi))
return true;
/*
* for blkzoned device, fallback direct IO to buffered IO, so
* all IOs can be serialized by log-structured write.
*/
if (f2fs_sb_has_blkzoned(sbi))
return true;
if (f2fs_lfs_mode(sbi) && (rw == WRITE)) {
if (block_unaligned_IO(inode, iocb, iter))
return true;
if (F2FS_IO_ALIGNED(sbi))
return true;
}
if (is_sbi_flag_set(F2FS_I_SB(inode), SBI_CP_DISABLED))
return true;
return false;
}
static inline bool f2fs_need_verity(const struct inode *inode, pgoff_t idx)
{
return fsverity_active(inode) &&
idx < DIV_ROUND_UP(inode->i_size, PAGE_SIZE);
}
#ifdef CONFIG_F2FS_FAULT_INJECTION
extern void f2fs_build_fault_attr(struct f2fs_sb_info *sbi, unsigned int rate,
unsigned int type);
#else
#define f2fs_build_fault_attr(sbi, rate, type) do { } while (0)
#endif
static inline bool is_journalled_quota(struct f2fs_sb_info *sbi)
{
#ifdef CONFIG_QUOTA
if (f2fs_sb_has_quota_ino(sbi))
return true;
if (F2FS_OPTION(sbi).s_qf_names[USRQUOTA] ||
F2FS_OPTION(sbi).s_qf_names[GRPQUOTA] ||
F2FS_OPTION(sbi).s_qf_names[PRJQUOTA])
return true;
#endif
return false;
}
#define EFSBADCRC EBADMSG /* Bad CRC detected */
#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
#endif /* _LINUX_F2FS_H */