GNU Linux-libre 4.9.308-gnu1
[releases.git] / fs / ext4 / file.c
1 /*
2  *  linux/fs/ext4/file.c
3  *
4  * Copyright (C) 1992, 1993, 1994, 1995
5  * Remy Card (card@masi.ibp.fr)
6  * Laboratoire MASI - Institut Blaise Pascal
7  * Universite Pierre et Marie Curie (Paris VI)
8  *
9  *  from
10  *
11  *  linux/fs/minix/file.c
12  *
13  *  Copyright (C) 1991, 1992  Linus Torvalds
14  *
15  *  ext4 fs regular file handling primitives
16  *
17  *  64-bit file support on 64-bit platforms by Jakub Jelinek
18  *      (jj@sunsite.ms.mff.cuni.cz)
19  */
20
21 #include <linux/time.h>
22 #include <linux/fs.h>
23 #include <linux/mount.h>
24 #include <linux/path.h>
25 #include <linux/dax.h>
26 #include <linux/quotaops.h>
27 #include <linux/pagevec.h>
28 #include <linux/uio.h>
29 #include "ext4.h"
30 #include "ext4_jbd2.h"
31 #include "xattr.h"
32 #include "acl.h"
33
34 /*
35  * Called when an inode is released. Note that this is different
36  * from ext4_file_open: open gets called at every open, but release
37  * gets called only when /all/ the files are closed.
38  */
39 static int ext4_release_file(struct inode *inode, struct file *filp)
40 {
41         if (ext4_test_inode_state(inode, EXT4_STATE_DA_ALLOC_CLOSE)) {
42                 ext4_alloc_da_blocks(inode);
43                 ext4_clear_inode_state(inode, EXT4_STATE_DA_ALLOC_CLOSE);
44         }
45         /* if we are the last writer on the inode, drop the block reservation */
46         if ((filp->f_mode & FMODE_WRITE) &&
47                         (atomic_read(&inode->i_writecount) == 1) &&
48                         !EXT4_I(inode)->i_reserved_data_blocks)
49         {
50                 down_write(&EXT4_I(inode)->i_data_sem);
51                 ext4_discard_preallocations(inode);
52                 up_write(&EXT4_I(inode)->i_data_sem);
53         }
54         if (is_dx(inode) && filp->private_data)
55                 ext4_htree_free_dir_info(filp->private_data);
56
57         return 0;
58 }
59
60 static void ext4_unwritten_wait(struct inode *inode)
61 {
62         wait_queue_head_t *wq = ext4_ioend_wq(inode);
63
64         wait_event(*wq, (atomic_read(&EXT4_I(inode)->i_unwritten) == 0));
65 }
66
67 /*
68  * This tests whether the IO in question is block-aligned or not.
69  * Ext4 utilizes unwritten extents when hole-filling during direct IO, and they
70  * are converted to written only after the IO is complete.  Until they are
71  * mapped, these blocks appear as holes, so dio_zero_block() will assume that
72  * it needs to zero out portions of the start and/or end block.  If 2 AIO
73  * threads are at work on the same unwritten block, they must be synchronized
74  * or one thread will zero the other's data, causing corruption.
75  */
76 static int
77 ext4_unaligned_aio(struct inode *inode, struct iov_iter *from, loff_t pos)
78 {
79         struct super_block *sb = inode->i_sb;
80         int blockmask = sb->s_blocksize - 1;
81
82         if (pos >= ALIGN(i_size_read(inode), sb->s_blocksize))
83                 return 0;
84
85         if ((pos | iov_iter_alignment(from)) & blockmask)
86                 return 1;
87
88         return 0;
89 }
90
91 static ssize_t
92 ext4_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
93 {
94         struct inode *inode = file_inode(iocb->ki_filp);
95         int o_direct = iocb->ki_flags & IOCB_DIRECT;
96         int unaligned_aio = 0;
97         int overwrite = 0;
98         ssize_t ret;
99
100         inode_lock(inode);
101         ret = generic_write_checks(iocb, from);
102         if (ret <= 0)
103                 goto out;
104
105         /*
106          * Unaligned direct AIO must be serialized among each other as zeroing
107          * of partial blocks of two competing unaligned AIOs can result in data
108          * corruption.
109          */
110         if (o_direct && ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS) &&
111             !is_sync_kiocb(iocb) &&
112             ext4_unaligned_aio(inode, from, iocb->ki_pos)) {
113                 unaligned_aio = 1;
114                 ext4_unwritten_wait(inode);
115         }
116
117         /*
118          * If we have encountered a bitmap-format file, the size limit
119          * is smaller than s_maxbytes, which is for extent-mapped files.
120          */
121         if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
122                 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
123
124                 if (iocb->ki_pos >= sbi->s_bitmap_maxbytes) {
125                         ret = -EFBIG;
126                         goto out;
127                 }
128                 iov_iter_truncate(from, sbi->s_bitmap_maxbytes - iocb->ki_pos);
129         }
130
131         iocb->private = &overwrite;
132         if (o_direct) {
133                 size_t length = iov_iter_count(from);
134                 loff_t pos = iocb->ki_pos;
135
136                 /* check whether we do a DIO overwrite or not */
137                 if (ext4_should_dioread_nolock(inode) && !unaligned_aio &&
138                     pos + length <= i_size_read(inode)) {
139                         struct ext4_map_blocks map;
140                         unsigned int blkbits = inode->i_blkbits;
141                         int err, len;
142
143                         map.m_lblk = pos >> blkbits;
144                         map.m_len = EXT4_MAX_BLOCKS(length, pos, blkbits);
145                         len = map.m_len;
146
147                         err = ext4_map_blocks(NULL, inode, &map, 0);
148                         /*
149                          * 'err==len' means that all of blocks has
150                          * been preallocated no matter they are
151                          * initialized or not.  For excluding
152                          * unwritten extents, we need to check
153                          * m_flags.  There are two conditions that
154                          * indicate for initialized extents.  1) If we
155                          * hit extent cache, EXT4_MAP_MAPPED flag is
156                          * returned; 2) If we do a real lookup,
157                          * non-flags are returned.  So we should check
158                          * these two conditions.
159                          */
160                         if (err == len && (map.m_flags & EXT4_MAP_MAPPED))
161                                 overwrite = 1;
162                 }
163         }
164
165         ret = __generic_file_write_iter(iocb, from);
166         /*
167          * Unaligned direct AIO must be the only IO in flight. Otherwise
168          * overlapping aligned IO after unaligned might result in data
169          * corruption.
170          */
171         if (ret == -EIOCBQUEUED && unaligned_aio)
172                 ext4_unwritten_wait(inode);
173         inode_unlock(inode);
174
175         if (ret > 0)
176                 ret = generic_write_sync(iocb, ret);
177
178         return ret;
179
180 out:
181         inode_unlock(inode);
182         return ret;
183 }
184
185 #ifdef CONFIG_FS_DAX
186 static int ext4_dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
187 {
188         int result;
189         handle_t *handle = NULL;
190         struct inode *inode = file_inode(vma->vm_file);
191         struct super_block *sb = inode->i_sb;
192         bool write = vmf->flags & FAULT_FLAG_WRITE;
193
194         if (write) {
195                 sb_start_pagefault(sb);
196                 file_update_time(vma->vm_file);
197                 down_read(&EXT4_I(inode)->i_mmap_sem);
198                 handle = ext4_journal_start_sb(sb, EXT4_HT_WRITE_PAGE,
199                                                 EXT4_DATA_TRANS_BLOCKS(sb));
200         } else
201                 down_read(&EXT4_I(inode)->i_mmap_sem);
202
203         if (IS_ERR(handle))
204                 result = VM_FAULT_SIGBUS;
205         else
206                 result = dax_fault(vma, vmf, ext4_dax_get_block);
207
208         if (write) {
209                 if (!IS_ERR(handle))
210                         ext4_journal_stop(handle);
211                 up_read(&EXT4_I(inode)->i_mmap_sem);
212                 sb_end_pagefault(sb);
213         } else
214                 up_read(&EXT4_I(inode)->i_mmap_sem);
215
216         return result;
217 }
218
219 static int ext4_dax_pmd_fault(struct vm_area_struct *vma, unsigned long addr,
220                                                 pmd_t *pmd, unsigned int flags)
221 {
222         int result;
223         handle_t *handle = NULL;
224         struct inode *inode = file_inode(vma->vm_file);
225         struct super_block *sb = inode->i_sb;
226         bool write = flags & FAULT_FLAG_WRITE;
227
228         if (write) {
229                 sb_start_pagefault(sb);
230                 file_update_time(vma->vm_file);
231                 down_read(&EXT4_I(inode)->i_mmap_sem);
232                 handle = ext4_journal_start_sb(sb, EXT4_HT_WRITE_PAGE,
233                                 ext4_chunk_trans_blocks(inode,
234                                                         PMD_SIZE / PAGE_SIZE));
235         } else
236                 down_read(&EXT4_I(inode)->i_mmap_sem);
237
238         if (IS_ERR(handle))
239                 result = VM_FAULT_SIGBUS;
240         else
241                 result = dax_pmd_fault(vma, addr, pmd, flags,
242                                          ext4_dax_get_block);
243
244         if (write) {
245                 if (!IS_ERR(handle))
246                         ext4_journal_stop(handle);
247                 up_read(&EXT4_I(inode)->i_mmap_sem);
248                 sb_end_pagefault(sb);
249         } else
250                 up_read(&EXT4_I(inode)->i_mmap_sem);
251
252         return result;
253 }
254
255 /*
256  * Handle write fault for VM_MIXEDMAP mappings. Similarly to ext4_dax_fault()
257  * handler we check for races agaist truncate. Note that since we cycle through
258  * i_mmap_sem, we are sure that also any hole punching that began before we
259  * were called is finished by now and so if it included part of the file we
260  * are working on, our pte will get unmapped and the check for pte_same() in
261  * wp_pfn_shared() fails. Thus fault gets retried and things work out as
262  * desired.
263  */
264 static int ext4_dax_pfn_mkwrite(struct vm_area_struct *vma,
265                                 struct vm_fault *vmf)
266 {
267         struct inode *inode = file_inode(vma->vm_file);
268         struct super_block *sb = inode->i_sb;
269         loff_t size;
270         int ret;
271
272         sb_start_pagefault(sb);
273         file_update_time(vma->vm_file);
274         down_read(&EXT4_I(inode)->i_mmap_sem);
275         size = (i_size_read(inode) + PAGE_SIZE - 1) >> PAGE_SHIFT;
276         if (vmf->pgoff >= size)
277                 ret = VM_FAULT_SIGBUS;
278         else
279                 ret = dax_pfn_mkwrite(vma, vmf);
280         up_read(&EXT4_I(inode)->i_mmap_sem);
281         sb_end_pagefault(sb);
282
283         return ret;
284 }
285
286 static const struct vm_operations_struct ext4_dax_vm_ops = {
287         .fault          = ext4_dax_fault,
288         .pmd_fault      = ext4_dax_pmd_fault,
289         .page_mkwrite   = ext4_dax_fault,
290         .pfn_mkwrite    = ext4_dax_pfn_mkwrite,
291 };
292 #else
293 #define ext4_dax_vm_ops ext4_file_vm_ops
294 #endif
295
296 static const struct vm_operations_struct ext4_file_vm_ops = {
297         .fault          = ext4_filemap_fault,
298         .map_pages      = filemap_map_pages,
299         .page_mkwrite   = ext4_page_mkwrite,
300 };
301
302 static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma)
303 {
304         struct inode *inode = file->f_mapping->host;
305
306         if (ext4_encrypted_inode(inode)) {
307                 int err = fscrypt_get_encryption_info(inode);
308                 if (err)
309                         return 0;
310                 if (!fscrypt_has_encryption_key(inode))
311                         return -ENOKEY;
312         }
313         file_accessed(file);
314         if (IS_DAX(file_inode(file))) {
315                 vma->vm_ops = &ext4_dax_vm_ops;
316                 vma->vm_flags |= VM_MIXEDMAP | VM_HUGEPAGE;
317         } else {
318                 vma->vm_ops = &ext4_file_vm_ops;
319         }
320         return 0;
321 }
322
323 static int ext4_file_open(struct inode * inode, struct file * filp)
324 {
325         struct super_block *sb = inode->i_sb;
326         struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
327         struct vfsmount *mnt = filp->f_path.mnt;
328         struct dentry *dir;
329         struct path path;
330         char buf[64], *cp;
331         int ret;
332
333         if (unlikely(!(sbi->s_mount_flags & EXT4_MF_MNTDIR_SAMPLED) &&
334                      !(sb->s_flags & MS_RDONLY))) {
335                 sbi->s_mount_flags |= EXT4_MF_MNTDIR_SAMPLED;
336                 /*
337                  * Sample where the filesystem has been mounted and
338                  * store it in the superblock for sysadmin convenience
339                  * when trying to sort through large numbers of block
340                  * devices or filesystem images.
341                  */
342                 memset(buf, 0, sizeof(buf));
343                 path.mnt = mnt;
344                 path.dentry = mnt->mnt_root;
345                 cp = d_path(&path, buf, sizeof(buf));
346                 if (!IS_ERR(cp)) {
347                         handle_t *handle;
348                         int err;
349
350                         handle = ext4_journal_start_sb(sb, EXT4_HT_MISC, 1);
351                         if (IS_ERR(handle))
352                                 return PTR_ERR(handle);
353                         BUFFER_TRACE(sbi->s_sbh, "get_write_access");
354                         err = ext4_journal_get_write_access(handle, sbi->s_sbh);
355                         if (err) {
356                                 ext4_journal_stop(handle);
357                                 return err;
358                         }
359                         strlcpy(sbi->s_es->s_last_mounted, cp,
360                                 sizeof(sbi->s_es->s_last_mounted));
361                         ext4_handle_dirty_super(handle, sb);
362                         ext4_journal_stop(handle);
363                 }
364         }
365         if (ext4_encrypted_inode(inode)) {
366                 ret = fscrypt_get_encryption_info(inode);
367                 if (ret)
368                         return -EACCES;
369                 if (!fscrypt_has_encryption_key(inode))
370                         return -ENOKEY;
371         }
372
373         dir = dget_parent(file_dentry(filp));
374         if (ext4_encrypted_inode(d_inode(dir)) &&
375                         !fscrypt_has_permitted_context(d_inode(dir), inode)) {
376                 ext4_warning(inode->i_sb,
377                              "Inconsistent encryption contexts: %lu/%lu",
378                              (unsigned long) d_inode(dir)->i_ino,
379                              (unsigned long) inode->i_ino);
380                 dput(dir);
381                 return -EPERM;
382         }
383         dput(dir);
384         /*
385          * Set up the jbd2_inode if we are opening the inode for
386          * writing and the journal is present
387          */
388         if (filp->f_mode & FMODE_WRITE) {
389                 ret = ext4_inode_attach_jinode(inode);
390                 if (ret < 0)
391                         return ret;
392         }
393         return dquot_file_open(inode, filp);
394 }
395
396 /*
397  * Here we use ext4_map_blocks() to get a block mapping for a extent-based
398  * file rather than ext4_ext_walk_space() because we can introduce
399  * SEEK_DATA/SEEK_HOLE for block-mapped and extent-mapped file at the same
400  * function.  When extent status tree has been fully implemented, it will
401  * track all extent status for a file and we can directly use it to
402  * retrieve the offset for SEEK_DATA/SEEK_HOLE.
403  */
404
405 /*
406  * When we retrieve the offset for SEEK_DATA/SEEK_HOLE, we would need to
407  * lookup page cache to check whether or not there has some data between
408  * [startoff, endoff] because, if this range contains an unwritten extent,
409  * we determine this extent as a data or a hole according to whether the
410  * page cache has data or not.
411  */
412 static int ext4_find_unwritten_pgoff(struct inode *inode,
413                                      int whence,
414                                      ext4_lblk_t end_blk,
415                                      loff_t *offset)
416 {
417         struct pagevec pvec;
418         unsigned int blkbits;
419         pgoff_t index;
420         pgoff_t end;
421         loff_t endoff;
422         loff_t startoff;
423         loff_t lastoff;
424         int found = 0;
425
426         blkbits = inode->i_sb->s_blocksize_bits;
427         startoff = *offset;
428         lastoff = startoff;
429         endoff = (loff_t)end_blk << blkbits;
430
431         index = startoff >> PAGE_SHIFT;
432         end = endoff >> PAGE_SHIFT;
433
434         pagevec_init(&pvec, 0);
435         do {
436                 int i, num;
437                 unsigned long nr_pages;
438
439                 num = min_t(pgoff_t, end - index, PAGEVEC_SIZE - 1) + 1;
440                 nr_pages = pagevec_lookup(&pvec, inode->i_mapping, index,
441                                           (pgoff_t)num);
442                 if (nr_pages == 0)
443                         break;
444
445                 for (i = 0; i < nr_pages; i++) {
446                         struct page *page = pvec.pages[i];
447                         struct buffer_head *bh, *head;
448
449                         /*
450                          * If current offset is smaller than the page offset,
451                          * there is a hole at this offset.
452                          */
453                         if (whence == SEEK_HOLE && lastoff < endoff &&
454                             lastoff < page_offset(pvec.pages[i])) {
455                                 found = 1;
456                                 *offset = lastoff;
457                                 goto out;
458                         }
459
460                         if (page->index > end)
461                                 goto out;
462
463                         lock_page(page);
464
465                         if (unlikely(page->mapping != inode->i_mapping)) {
466                                 unlock_page(page);
467                                 continue;
468                         }
469
470                         if (!page_has_buffers(page)) {
471                                 unlock_page(page);
472                                 continue;
473                         }
474
475                         if (page_has_buffers(page)) {
476                                 lastoff = page_offset(page);
477                                 bh = head = page_buffers(page);
478                                 do {
479                                         if (lastoff + bh->b_size <= startoff)
480                                                 goto next;
481                                         if (buffer_uptodate(bh) ||
482                                             buffer_unwritten(bh)) {
483                                                 if (whence == SEEK_DATA)
484                                                         found = 1;
485                                         } else {
486                                                 if (whence == SEEK_HOLE)
487                                                         found = 1;
488                                         }
489                                         if (found) {
490                                                 *offset = max_t(loff_t,
491                                                         startoff, lastoff);
492                                                 unlock_page(page);
493                                                 goto out;
494                                         }
495 next:
496                                         lastoff += bh->b_size;
497                                         bh = bh->b_this_page;
498                                 } while (bh != head);
499                         }
500
501                         lastoff = page_offset(page) + PAGE_SIZE;
502                         unlock_page(page);
503                 }
504
505                 /* The no. of pages is less than our desired, we are done. */
506                 if (nr_pages < num)
507                         break;
508
509                 index = pvec.pages[i - 1]->index + 1;
510                 pagevec_release(&pvec);
511         } while (index <= end);
512
513         if (whence == SEEK_HOLE && lastoff < endoff) {
514                 found = 1;
515                 *offset = lastoff;
516         }
517 out:
518         pagevec_release(&pvec);
519         return found;
520 }
521
522 /*
523  * ext4_seek_data() retrieves the offset for SEEK_DATA.
524  */
525 static loff_t ext4_seek_data(struct file *file, loff_t offset, loff_t maxsize)
526 {
527         struct inode *inode = file->f_mapping->host;
528         struct extent_status es;
529         ext4_lblk_t start, last, end;
530         loff_t dataoff, isize;
531         int blkbits;
532         int ret;
533
534         inode_lock(inode);
535
536         isize = i_size_read(inode);
537         if (offset < 0 || offset >= isize) {
538                 inode_unlock(inode);
539                 return -ENXIO;
540         }
541
542         blkbits = inode->i_sb->s_blocksize_bits;
543         start = offset >> blkbits;
544         last = start;
545         end = isize >> blkbits;
546         dataoff = offset;
547
548         do {
549                 ret = ext4_get_next_extent(inode, last, end - last + 1, &es);
550                 if (ret <= 0) {
551                         /* No extent found -> no data */
552                         if (ret == 0)
553                                 ret = -ENXIO;
554                         inode_unlock(inode);
555                         return ret;
556                 }
557
558                 last = es.es_lblk;
559                 if (last != start)
560                         dataoff = (loff_t)last << blkbits;
561                 if (!ext4_es_is_unwritten(&es))
562                         break;
563
564                 /*
565                  * If there is a unwritten extent at this offset,
566                  * it will be as a data or a hole according to page
567                  * cache that has data or not.
568                  */
569                 if (ext4_find_unwritten_pgoff(inode, SEEK_DATA,
570                                               es.es_lblk + es.es_len, &dataoff))
571                         break;
572                 last += es.es_len;
573                 dataoff = (loff_t)last << blkbits;
574                 cond_resched();
575         } while (last <= end);
576
577         inode_unlock(inode);
578
579         if (dataoff > isize)
580                 return -ENXIO;
581
582         return vfs_setpos(file, dataoff, maxsize);
583 }
584
585 /*
586  * ext4_seek_hole() retrieves the offset for SEEK_HOLE.
587  */
588 static loff_t ext4_seek_hole(struct file *file, loff_t offset, loff_t maxsize)
589 {
590         struct inode *inode = file->f_mapping->host;
591         struct extent_status es;
592         ext4_lblk_t start, last, end;
593         loff_t holeoff, isize;
594         int blkbits;
595         int ret;
596
597         inode_lock(inode);
598
599         isize = i_size_read(inode);
600         if (offset < 0 || offset >= isize) {
601                 inode_unlock(inode);
602                 return -ENXIO;
603         }
604
605         blkbits = inode->i_sb->s_blocksize_bits;
606         start = offset >> blkbits;
607         last = start;
608         end = isize >> blkbits;
609         holeoff = offset;
610
611         do {
612                 ret = ext4_get_next_extent(inode, last, end - last + 1, &es);
613                 if (ret < 0) {
614                         inode_unlock(inode);
615                         return ret;
616                 }
617                 /* Found a hole? */
618                 if (ret == 0 || es.es_lblk > last) {
619                         if (last != start)
620                                 holeoff = (loff_t)last << blkbits;
621                         break;
622                 }
623                 /*
624                  * If there is a unwritten extent at this offset,
625                  * it will be as a data or a hole according to page
626                  * cache that has data or not.
627                  */
628                 if (ext4_es_is_unwritten(&es) &&
629                     ext4_find_unwritten_pgoff(inode, SEEK_HOLE,
630                                               last + es.es_len, &holeoff))
631                         break;
632
633                 last += es.es_len;
634                 holeoff = (loff_t)last << blkbits;
635                 cond_resched();
636         } while (last <= end);
637
638         inode_unlock(inode);
639
640         if (holeoff > isize)
641                 holeoff = isize;
642
643         return vfs_setpos(file, holeoff, maxsize);
644 }
645
646 /*
647  * ext4_llseek() handles both block-mapped and extent-mapped maxbytes values
648  * by calling generic_file_llseek_size() with the appropriate maxbytes
649  * value for each.
650  */
651 loff_t ext4_llseek(struct file *file, loff_t offset, int whence)
652 {
653         struct inode *inode = file->f_mapping->host;
654         loff_t maxbytes;
655
656         if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)))
657                 maxbytes = EXT4_SB(inode->i_sb)->s_bitmap_maxbytes;
658         else
659                 maxbytes = inode->i_sb->s_maxbytes;
660
661         switch (whence) {
662         case SEEK_SET:
663         case SEEK_CUR:
664         case SEEK_END:
665                 return generic_file_llseek_size(file, offset, whence,
666                                                 maxbytes, i_size_read(inode));
667         case SEEK_DATA:
668                 return ext4_seek_data(file, offset, maxbytes);
669         case SEEK_HOLE:
670                 return ext4_seek_hole(file, offset, maxbytes);
671         }
672
673         return -EINVAL;
674 }
675
676 const struct file_operations ext4_file_operations = {
677         .llseek         = ext4_llseek,
678         .read_iter      = generic_file_read_iter,
679         .write_iter     = ext4_file_write_iter,
680         .unlocked_ioctl = ext4_ioctl,
681 #ifdef CONFIG_COMPAT
682         .compat_ioctl   = ext4_compat_ioctl,
683 #endif
684         .mmap           = ext4_file_mmap,
685         .open           = ext4_file_open,
686         .release        = ext4_release_file,
687         .fsync          = ext4_sync_file,
688         .get_unmapped_area = thp_get_unmapped_area,
689         .splice_read    = generic_file_splice_read,
690         .splice_write   = iter_file_splice_write,
691         .fallocate      = ext4_fallocate,
692 };
693
694 const struct inode_operations ext4_file_inode_operations = {
695         .setattr        = ext4_setattr,
696         .getattr        = ext4_getattr,
697         .listxattr      = ext4_listxattr,
698         .get_acl        = ext4_get_acl,
699         .set_acl        = ext4_set_acl,
700         .fiemap         = ext4_fiemap,
701 };
702