- 20 9月, 2021 8 次提交
-
-
由 Kari Argillander 提交于
Drop tmp pointer bd_inode because this is only used ones in fill_super. Also we have so many initializing happening at the beginning that it is already way too much to follow. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
We only use this in two places so we do not really need it. Also wrapper sb_rdonly() is pretty self explanatory. This will make little bit easier to read this super long variable list in the beginning of ntfs_fill_super(). Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Use sb instead of sbi->sb in fill_super. We have sb so why not use it. Also makes code more readable. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Remove some unnecessary variable loading. These look like copy paste work and they are not used to anything. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
In many places it is not needed to use goto out. We can just return right away. This will make code little bit more cleaner as we won't need to check error path. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Remove root drop when we fault out. This can never happened because when we allocate root we eather fault when no root or success. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Change EINVAL to ENOMEM when d_make_root fails because that is right errno. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Fix wrong error message $Logfile -> $UpCase. Probably copy paste. Fixes: 203c2b3a406a ("fs/ntfs3: Add initialization of super block") Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
- 16 9月, 2021 8 次提交
-
-
由 Kari Argillander 提交于
We can make code little bit more readable by using min/max macros. These were found with Coccinelle. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
We can make code little more readable by using kernel macros clamp/max. This were found with kernel included Coccinelle minmax script. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
We do not need this check as this is same thing as NTFS_MIN_MFT_ZONE > zlen. We already check NTFS_MIN_MFT_ZONE <= zlen and exit because is too big request. Remove it so code is cleaner. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
If ntfs_refresh_zone() returns error it will be changed to -ENOSPC. It is not right. Also caller of this functions also check other errors. Fixes: 78ab59fe ("fs/ntfs3: Rework file operations") Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Remove tabs before spaces from comment as recommended by kernel coding style. Checkpatch also warn about these. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Remove braces from single statment block as they are not needed. Also Linux kernel coding style guide recommend this and checkpatch warn about this. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
For better code readability place constant always right side of the test. This will also address checkpatch warning. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
No need for plus sign here. So remove it. Checkpatch will also be happy. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
- 14 9月, 2021 12 次提交
-
-
由 Kari Argillander 提交于
We do not have any reason to keep old linear search in. Before this was used for error path or if table was so big that it cannot be allocated. Current binary search implementation won't need error path. Remove old references to linear entry search. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
We could try to optimize algorithm to first fill just small table and after that use bigger table all the way up to ARRAY_SIZE(offs). This way we can use bigger search array, but not lose benefits with entry count smaller < ARRAY_SIZE(offs). Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Current binary search allocates memory for table and fill whole table before we start actual binary search. This is quite inefficient because table fill will always be O(n). Also if table is huge we need to reallocate memory which is costly. This implementation use just stack memory and always when table is full we will check if last element is <= and if not start table fill again. The idea was that it would be same cost as table reallocation. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
We have lot of unnecessary headers in these files. Remove them so that we help compiler a little bit. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
There is lot of headers which we do not need in this file. Delete them and add what we really need. Here is list which identify why we need this header. <linux/kernel.h> // min() <linux/slab.h> // kzalloc() <linux/stddef.h> // offsetof() <linux/string.h> // memcpy(), memset() <linux/types.h> // u8, size_t, etc. "debug.h" // PtrOffset() Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
There is no headers. They will be included through ntfs_fs.c, but that is not right thing to do. Let's include headers what this file need straight away. types.h is needed for __le16, u8 etc. kernel.h is needed for le16_to_cpu() Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
We only need linux/types.h for types like u8 etc. So we can remove rest and help compiler a little bit. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
size_t needs header. Add missing header guards so that compiler will only include these ones. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
We do not have headers at all in this file. We should have them so that not every .c file needs to include all of the stuff which this file need for building. This way we can remove some headers from other files and get better picture what is needed. This can save some compilation time. And this can help if we sometimes want to separate this one big header. Also use forward declarations for structs and enums when it not included straight with include and it is used in function declarations input. This will prevent possible compiler warning: xxx declared inside parameter list will not be visible outside of this definition or declaration Here is list which I made when parsing this. There is not necessarily all example from this header file, but this just proofs we need it. <linux/blkdev.h> SECTOR_SHIFT <linux/buffer_head.h> sb_bread(), put_bh <linux/cleancache.h> put_page() <linux/fs.h> struct inode (Just struct ntfs_inode need it) <linux/highmem.h> kunmap(), kmap() <linux/kernel.h> cpu_to_leXX() ALIGN <linux/mm.h> kvfree() <linux/mutex.h> struct mutex, mutex_(un/try)lock() <linux/page-flags.h> PageError() <linux/pagemap.h> read_mapping_page() <linux/rbtree.h> struct rb_root <linux/rwsem.h> struct rw_semaphore <linux/slab.h> krfree(), kzalloc() <linux/string.h> memset() <linux/time64.h> struct timespec64 <linux/types.h> uXX, __leXX <linux/uidgid.h> kuid_t, kgid_t <asm/div64.h> do_div() <asm/page.h> PAGE_SIZE "debug.h" ntfs_err() (Just one entry. Maybe we can drop this) "ntfs.h" Do you even ask? Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
We do not have header files at all in this file. Add following headers and there is also explanation which for it was added. Note that explanation might not be complete, but it just proofs it is needed. <linux/blkdev.h> // SECTOR_SHIFT <linux/build_bug.h> // static_assert() <linux/kernel.h> // cpu_to_le64, cpu_to_le32, ALIGN <linux/stddef.h> // offsetof() <linux/string.h> // memcmp() <linux/types.h> //__le32, __le16 "debug.h" // PtrOffset(), Add2Ptr() Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Add forward declarations for structs so that we can include this file without warnings even without linux/fs.h Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Colin Ian King 提交于
The variable err is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: NColin Ian King <colin.king@canonical.com> Reviewed-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
- 10 9月, 2021 9 次提交
-
-
由 Kari Argillander 提交于
Show options should show option according documentation when some value is not default or when ever coder wants. Uid/gid are problematic because it is hard to know which are defaults. In file system there is many different implementation for this problem. Some file systems show uid/gid when they are different than root, some when user has set them and some show them always. There is also problem that what if root uid/gid change. This code just choose to show them always. This way we do not need to think this any more. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Rename mount option no_acs_rules to (no)acsrules. This allow us to use possibility to mount with options noaclrules or aclrules. Acked-by: NChristian Brauner <christian.brauner@ubuntu.com> Reviewed-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Other fs drivers are using iocharset= mount option for specifying charset. So add it also for ntfs3 and mark old nls= mount option as deprecated. Reviewed-by: NPali Rohár <pali@kernel.org> Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
If we call Opt_nohidden with just keyword hidden, then we can use hidden/nohidden when mounting. We already use this method for almoust all other parameters so it is just logical that this will use same method. Acked-by: NChristian Brauner <christian.brauner@ubuntu.com> Reviewed-by: NChristoph Hellwig <hch@lst.de> Reviewed-by: NPali Rohár <pali@kernel.org> Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
init_fs_context() is meant to initialize s_fs_info (spi). Move spi initializing code there which we can initialize before fill_super(). Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
We have now new mount api as described in Documentation/filesystems. We should use it as it gives us some benefits which are desribed here lore.kernel.org/linux-fsdevel/159646178122.1784947.11705396571718464082.stgit@warthog.procyon.org.uk/ Nls loading is changed a to load with string. This did make code also little cleaner. Also try to use fsparam_flag_no as much as possible. This is just nice little touch and is not mandatory but it should not make any harm. It is just convenient that we can use example acl/noacl mount options. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Use pointer to mount options. We want to do this because we will use new mount api which will benefit that we have spi and mount options in different allocations. When we remount we do not have to make whole new spi it is enough that we will allocate just mount options. Please note that we can do example remount lot cleaner but things will change in next patch so this should be just functional. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Remove unnecesarry remount flag handling. This does not do anything for this driver. We have already set SB_NODIRATIME when we fill super. Also noatime should be set from mount option. Now for some reson we try to set it when remounting. Lazytime part looks like it is copied from f2fs and there is own mount parameter for it. That is why they use it. We do not set lazytime anywhere in our code. So basically this just blocks lazytime when remounting. Acked-by: NChristian Brauner <christian.brauner@ubuntu.com> Reviewed-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Remove unnecesarry mount option noatime because this will be handled by VFS. Our option parser will never get opt like this. Acked-by: NChristian Brauner <christian.brauner@ubuntu.com> Reviewed-by: NChristoph Hellwig <hch@lst.de> Reviewed-by: NPali Rohár <pali@kernel.org> Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
- 02 9月, 2021 3 次提交
-
-
由 Kari Argillander 提交于
Usually in file system init() messages are only displayed in info level. Change level from notice to info, but keep CONFIG_NTFS3_64BIT_CLUSTER in notice level. Also this need even more attention so let's put big warning here so that nobody will not try accidentally use it. There is also no good reason to display internal stuff like binary tree search. This is always on option which can only disabled for debugging purposes by developer. Also this message does not even check if developer has disabled it or not so it is useless info. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
Files already have SDPX identifier so no reason to keep boilerplates in these files anymore. Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Acked-by: NEric Biggers <ebiggers@kernel.org> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-
由 Kari Argillander 提交于
This check will be also performed in generic_file_read_iter() so we do not want to check this two times in a row. This was founded with Smatch fs/ntfs3/file.c:803 ntfs_file_read_iter() warn: unused return: count = iov_iter_count() Signed-off-by: NKari Argillander <kari.argillander@gmail.com> Signed-off-by: NKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
-