summaryrefslogtreecommitdiffstats
path: root/fs/ntfs3/run.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fs/ntfs3: Improve checking of bad clustersKonstantin Komarov2022-11-141-19/+2
| | | | | | | Added new function wnd_set_used_safe. Load $BadClus before $AttrDef instead of before $Bitmap. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
* fs/ntfs3: Check fields while readingKonstantin Komarov2022-11-141-2/+5
| | | | | | | | | Added new functions index_hdr_check and index_buf_check. Now we check all stuff for correctness while reading from disk. Also fixed bug with stale nfs data. Reported-by: van fantasy <g1042620637@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
* fs/ntfs3: Refactoring attr_punch_hole to restore after errorsKonstantin Komarov2022-08-031-0/+25
| | | | | | | | Added comments to code Added new function run_clone to make a copy of run Added done and undo labels for restoring after errors Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
* fs/ntfs3: Check possible errors in run_pack in advanceKonstantin Komarov2022-08-031-17/+22
| | | | | | Checking in advance speeds things up in some cases. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
* fs/ntfs3: Added comments to frecord functionsKonstantin Komarov2022-08-031-1/+1
| | | | | | | Added some comments in frecord.c for more context. Also changed run_lookup to static because it's an internal function. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
* fs/ntfs3: Remove duplicated assignment to variable rColin Ian King2022-07-051-1/+0
| | | | | | | | The assignment to variable r is duplicated, the second assignment is redundant and can be removed. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
* fs/ntfs3: Fallocate (FALLOC_FL_INSERT_RANGE) implementationKonstantin Komarov2022-06-281-0/+43
| | | | | | Add functions for inserting hole in file and inserting range in run. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
* fs/ntfs3: Remove unneeded header files from c filesKari Argillander2021-09-131-2/+0
| | | | | | | | We have lot of unnecessary headers in these files. Remove them so that we help compiler a little bit. Signed-off-by: Kari Argillander <kari.argillander@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
* fs/ntfs3: Restyle comments to better align with kernel-docKari Argillander2021-08-301-93/+94
| | | | | | | | | | | | | | | | | | Capitalize comments and end with period for better reading. Also function comments are now little more kernel-doc style. This way we can easily convert them to kernel-doc style if we want. Note that these are not yet complete with this style. Example function comments start with /* and in kernel-doc style they start /**. Use imperative mood in function descriptions. Change words like ntfs -> NTFS, linux -> Linux. Use "we" not "I" when commenting code. Signed-off-by: Kari Argillander <kari.argillander@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
* fs/ntfs3: Do not use driver own alloc wrappersKari Argillander2021-08-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem with these wrapper is that we cannot take off example GFP_NOFS flag. It is not recomended use those in all places. Also if we change one driver specific wrapper to kernel wrapper then it would look really weird. People should be most familiar with kernel wrappers so let's just use those ones. Driver specific alloc wrapper also confuse some static analyzing tools, good example is example kernels checkpatch tool. After we converter these to kernel specific then warnings is showed. Following Coccinelle script was used to automate changing. virtual patch @alloc depends on patch@ expression x; expression y; @@ ( - ntfs_malloc(x) + kmalloc(x, GFP_NOFS) | - ntfs_zalloc(x) + kzalloc(x, GFP_NOFS) | - ntfs_vmalloc(x) + kvmalloc(x, GFP_NOFS) | - ntfs_free(x) + kfree(x) | - ntfs_vfree(x) + kvfree(x) | - ntfs_memdup(x, y) + kmemdup(x, y, GFP_NOFS) ) Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kari Argillander <kari.argillander@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
* fs/ntfs3: Use linux/log2 is_power_of_2 functionKari Argillander2021-08-271-1/+2
| | | | | | | | We do not need our own implementation for this function in this driver. It is much better to use generic one. Signed-off-by: Kari Argillander <kari.argillander@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
* fs/ntfs3: Fix various spelling mistakesColin Ian King2021-08-271-1/+1
| | | | | | | | | There is a spelling mistake in a ntfs_err error message. Also fix various spelling mistakes in comments. Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Kari Argillander <kari.argillander@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
* fs/ntfs3: Add file operations and implementationKonstantin Komarov2021-08-131-0/+1111
This adds file operations and implementation Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>