Add ftruncate into file operation calls

- Add truncate into file_operations
- Move truncate to be common for mountpt_operations and file_operations
- Modify all drivers to initialize the operations struct accordingly

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

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