fs: Move mmap callback before truncate in [file|mountpt]_operations

since mmap may exist in block_operations, but truncate may not,
moving mmap beforee truncate could make three struct more compatible

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2023-01-03 01:06:12 +08:00
committed by Petro Karashchenko
parent c623ee20f1
commit b0a0ba3ad7
103 changed files with 105 additions and 106 deletions
+1 -1
View File
@@ -106,8 +106,8 @@ static const struct file_operations g_geofencefops =
NULL, /* write */
NULL, /* seek */
cxd56_geofence_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
cxd56_geofence_poll /* poll */
};
+1 -1
View File
@@ -317,8 +317,8 @@ static const struct file_operations g_gnssfops =
cxd56_gnss_write, /* write */
NULL, /* seek */
cxd56_gnss_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
cxd56_gnss_poll /* poll */
};
+1 -1
View File
@@ -145,8 +145,8 @@ static const struct file_operations g_hif_fops =
hif_write, /* write */
hif_seek, /* seek */
hif_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
hif_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, hif_unlink /* unlink */
+1 -1
View File
@@ -249,8 +249,8 @@ static const struct file_operations g_tsdops =
NULL, /* write */
NULL, /* seek */
sam_tsd_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
sam_tsd_poll /* poll */
};
@@ -296,8 +296,8 @@ static const struct file_operations g_slcdops =
slcd_write, /* write */
NULL, /* seek */
slcd_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
slcd_poll /* poll */
};
@@ -268,8 +268,8 @@ static const struct file_operations tc_fops =
NULL, /* write */
NULL, /* seek */
tc_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
tc_poll /* poll */
};
@@ -346,8 +346,8 @@ static const struct file_operations g_slcdops =
slcd_write, /* write */
NULL, /* seek */
slcd_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
slcd_poll /* poll */
};
@@ -249,8 +249,8 @@ static const struct file_operations tc_fops =
NULL, /* write */
NULL, /* seek */
tc_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
tc_poll /* poll */
};
@@ -181,8 +181,8 @@ static const struct file_operations g_lcdops =
lcd_write, /* write */
NULL, /* seek */
lcd_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
lcd_poll /* poll */
};
+2 -2
View File
@@ -125,8 +125,8 @@ static const struct file_operations g_cryptofops =
cryptof_write, /* write */
NULL, /* seek */
cryptof_ioctl, /* ioctl */
NULL, /* mmap */
NULL, /* truncate */
NULL, /* mmap */
cryptof_poll /* poll */
};
@@ -138,8 +138,8 @@ static const struct file_operations g_cryptoops =
NULL, /* write */
NULL, /* seek */
cryptoioctl, /* ioctl */
NULL, /* mmap */
NULL, /* truncate */
NULL, /* mmap */
NULL /* poll */
};
+1 -1
View File
@@ -72,8 +72,8 @@ static const struct file_operations g_adc_fops =
NULL, /* write */
NULL, /* seek */
adc_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
adc_poll /* poll */
};
+1 -1
View File
@@ -65,8 +65,8 @@ static const struct file_operations comp_fops =
NULL, /* write */
NULL, /* seek */
comp_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
comp_poll /* poll */
};
+1 -1
View File
@@ -78,8 +78,8 @@ const struct file_operations bch_fops =
bch_write, /* write */
bch_seek, /* seek */
bch_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
bch_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, bch_unlink /* unlink */
+1 -1
View File
@@ -135,8 +135,8 @@ static const struct file_operations g_canops =
can_write, /* write */
NULL, /* seek */
can_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
can_poll /* poll */
};
+1 -1
View File
@@ -100,8 +100,8 @@ static const struct file_operations g_urand_fops =
devurand_write, /* write */
NULL, /* seek */
NULL, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
devurand_poll /* poll */
};
+1 -1
View File
@@ -99,8 +99,8 @@ static const struct file_operations i2cdrvr_fops =
i2cdrvr_write, /* write */
NULL, /* seek */
i2cdrvr_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, i2cdrvr_unlink /* unlink */
+1 -1
View File
@@ -122,8 +122,8 @@ static const struct file_operations ads7843e_fops =
NULL, /* write */
NULL, /* seek */
ads7843e_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
ads7843e_poll /* poll */
};
+1 -1
View File
@@ -135,8 +135,8 @@ static const struct file_operations ajoy_fops =
NULL, /* write */
NULL, /* seek */
ajoy_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
ajoy_poll /* poll */
};
+1 -1
View File
@@ -133,8 +133,8 @@ static const struct file_operations btn_fops =
btn_write, /* write */
NULL, /* seek */
btn_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
btn_poll /* poll */
};
+1 -1
View File
@@ -224,8 +224,8 @@ static const struct file_operations g_mbr3108_fileops =
mbr3108_write, /* write */
NULL, /* seek */
NULL, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
mbr3108_poll /* poll */
};
+1 -1
View File
@@ -135,8 +135,8 @@ static const struct file_operations djoy_fops =
NULL, /* write */
NULL, /* seek */
djoy_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
djoy_poll /* poll */
};
+1 -1
View File
@@ -176,8 +176,8 @@ static const struct file_operations ft5x06_fops =
NULL, /* write */
NULL, /* seek */
ft5x06_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
ft5x06_poll /* poll */
};
+1 -1
View File
@@ -88,8 +88,8 @@ static const struct file_operations g_keyboard_fops =
keyboard_write, /* write */
NULL, /* seek */
NULL, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
keyboard_poll /* poll */
};
+1 -1
View File
@@ -115,8 +115,8 @@ static const struct file_operations max11802_fops =
NULL, /* write */
NULL, /* seek */
max11802_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
max11802_poll /* poll */
};
+1 -1
View File
@@ -280,8 +280,8 @@ static const struct file_operations mxt_fops =
NULL, /* write */
NULL, /* seek */
mxt_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
mxt_poll /* poll */
};
+1 -1
View File
@@ -255,8 +255,8 @@ static const struct file_operations g_hidkbd_fops =
spq10kbd_write, /* write */
NULL, /* seek */
NULL, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
spq10kbd_poll /* poll */
};
+1 -1
View File
@@ -124,8 +124,8 @@ static const struct file_operations g_stmpe811fops =
NULL, /* write */
NULL, /* seek */
stmpe811_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
stmpe811_poll /* poll */
};
+1 -1
View File
@@ -90,8 +90,8 @@ static const struct file_operations g_touch_fops =
touch_write, /* write */
NULL, /* seek */
touch_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
touch_poll /* poll */
};
+1 -1
View File
@@ -209,8 +209,8 @@ static const struct file_operations tsc2007_fops =
NULL, /* write */
NULL, /* seek */
tsc2007_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
tsc2007_poll /* poll */
};
+1 -1
View File
@@ -134,8 +134,8 @@ static const struct file_operations g_ft80x_fops =
ft80x_write, /* write */
NULL, /* seek */
ft80x_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, ft80x_unlink /* unlink */
+1 -1
View File
@@ -117,8 +117,8 @@ static const struct file_operations g_pcf8574_lcd_fops =
pcf8574_lcd_write, /* write */
pcf8574_lcd_seek, /* seek */
pcf8574_lcd_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
pcf8574_lcd_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, pcf8574_lcd_unlink /* unlink */
+1 -1
View File
@@ -170,8 +170,8 @@ static const struct file_operations tda19988_fops =
tda19988_write, /* write */
tda19988_seek, /* seek */
tda19988_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
tda19988_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, tda19988_unlink /* unlink */
+1 -1
View File
@@ -57,8 +57,8 @@ static const struct file_operations devnull_fops =
devnull_write, /* write */
NULL, /* seek */
NULL, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
devnull_poll /* poll */
};
+1 -1
View File
@@ -57,8 +57,8 @@ static const struct file_operations devzero_fops =
devzero_write, /* write */
NULL, /* seek */
NULL, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
devzero_poll /* poll */
};
+1 -1
View File
@@ -165,8 +165,8 @@ const struct file_operations g_rpmsgdev_ops =
rpmsgdev_write, /* write */
rpmsgdev_seek, /* seek */
rpmsgdev_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
rpmsgdev_poll /* poll */
};
+1 -1
View File
@@ -77,8 +77,8 @@ static const struct file_operations g_alt1250fops =
NULL, /* write */
NULL, /* seek */
alt1250_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
alt1250_poll, /* poll */
};
static uint8_t g_recvbuff[ALTCOM_RX_PKT_SIZE_MAX];
+1 -1
View File
@@ -114,8 +114,8 @@ static const struct file_operations ubxmdm_fops =
ubxmdm_write, /* write */
NULL, /* seek */
ubxmdm_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
ubxmdm_poll /* poll */
};
+1 -1
View File
@@ -119,8 +119,8 @@ static const struct file_operations mtdconfig_fops =
NULL, /* write */
NULL, /* seek */
mtdconfig_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
mtdconfig_poll /* poll */
};
+1 -1
View File
@@ -190,8 +190,8 @@ static const struct file_operations g_telnet_fops =
telnet_write, /* write */
NULL, /* seek */
telnet_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
telnet_poll /* poll */
};
+1 -1
View File
@@ -219,8 +219,8 @@ static const struct file_operations g_tun_file_ops =
tun_write, /* write */
NULL, /* seek */
tun_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
tun_poll /* poll */
};
+1 -1
View File
@@ -47,8 +47,8 @@ static const struct file_operations g_fifo_fops =
pipecommon_write, /* write */
NULL, /* seek */
pipecommon_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
pipecommon_poll /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, pipecommon_unlink /* unlink */
+1 -1
View File
@@ -61,8 +61,8 @@ static const struct file_operations g_pipe_fops =
pipecommon_write, /* write */
NULL, /* seek */
pipecommon_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
pipecommon_poll /* poll */
};
+1 -1
View File
@@ -91,8 +91,8 @@ static const struct file_operations g_batteryops =
bat_charger_write, /* write */
NULL, /* seek */
bat_charger_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
bat_charger_poll /* poll */
};
+1 -1
View File
@@ -93,8 +93,8 @@ static const struct file_operations g_batteryops =
bat_gauge_write, /* write */
NULL, /* seek */
bat_gauge_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
bat_gauge_poll /* poll */
};
+1 -1
View File
@@ -92,8 +92,8 @@ static const struct file_operations g_batteryops =
bat_monitor_write, /* write */
NULL, /* seek */
bat_monitor_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
bat_monitor_poll /* poll */
};
+1 -1
View File
@@ -103,8 +103,8 @@ static const struct file_operations g_lirc_fops =
lirc_write, /* write */
NULL, /* seek */
lirc_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
lirc_poll /* poll */
};
+1 -1
View File
@@ -116,8 +116,8 @@ static const struct file_operations g_aht10fops =
aht10_write, /* write */
NULL, /* seek */
aht10_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, aht10_unlink /* unlink */
+1 -1
View File
@@ -90,8 +90,8 @@ static const struct file_operations g_hcsr04ops =
hcsr04_write, /* write */
NULL, /* seek */
hcsr04_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
hcsr04_poll /* poll */
};
+1 -1
View File
@@ -161,8 +161,8 @@ static const struct file_operations g_hdc1008fops =
hdc1008_write, /* write */
NULL, /* seek */
hdc1008_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
NULL /* poll */
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
, hdc1008_unlink /* unlink */
+1 -1
View File
@@ -157,8 +157,8 @@ static const struct file_operations g_humidityops =
hts221_write, /* write */
NULL, /* seek */
hts221_ioctl, /* ioctl */
NULL, /* truncate */
NULL, /* mmap */
NULL, /* truncate */
hts221_poll /* poll */
};

Some files were not shown because too many files have changed in this diff Show More