Commit daabacc2 authored by Anton Altaparmakov's avatar Anton Altaparmakov

NTFS: Really final white space cleanups.

parent 70bf88da
ToDo: ToDo:
- Find and fix bugs. - Find and fix bugs.
- Either invalidate quotas or update the quota charges on NTFS 3.x
volumes with quota tracking enabled ($Quota).
- Checkpoint or disable the user space journal ($UsnJrnl).
- Implement aops->set_page_dirty() in order to take control of buffer - Implement aops->set_page_dirty() in order to take control of buffer
dirtying. Not having it means if page_has_buffers(), all buffers dirtying. Not having it means if page_has_buffers(), all buffers
will be dirtied with the page. And if not they won't be. That is will be dirtied with the page. And if not they won't be. That is
fine for the moment but will break once we enable metadata updates. fine for the moment but will break once we enable metadata updates.
- Implement sops->dirty_inode() to implement {a,m,c} time updates and For now just always using __set_page_dirty_nobuffers() for metadata
pages as nothing can dirty a page other than ourselves. Should this
change, we will really need to roll our own ->set_page_dirty().
- Implement sops->dirty_inode() to implement {a,m,c}time updates and
such things. such things.
- Implement sops->write_inode(). - Implement sops->write_inode().
- In between ntfs_prepare/commit_write, need exclusion between - In between ntfs_prepare/commit_write, need exclusion between
...@@ -604,12 +610,12 @@ tng-0.0.8 - 08/03/2002 - Now using BitKeeper, http://linux-ntfs.bkbits.net/ ...@@ -604,12 +610,12 @@ tng-0.0.8 - 08/03/2002 - Now using BitKeeper, http://linux-ntfs.bkbits.net/
types of inode names readdir() returns and modify ntfs_filldir() types of inode names readdir() returns and modify ntfs_filldir()
accordingly. There are several parameters to show_inodes: accordingly. There are several parameters to show_inodes:
system: system files system: system files
win32: long file names (including POSIX file names) [DEFAULT] win32: long file names (including POSIX file names) [DEFAULT]
long: same as win32 long: same as win32
dos: short file names only (excluding POSIX file names) dos: short file names only (excluding POSIX file names)
short: same as dos short: same as dos
posix: same as both win32 and dos posix: same as both win32 and dos
all: all file names all: all file names
Note that the options are additive, i.e. specifying: Note that the options are additive, i.e. specifying:
-o show_inodes=system,show_inodes=win32,show_inodes=dos -o show_inodes=system,show_inodes=win32,show_inodes=dos
is the same as specifying: is the same as specifying:
......
...@@ -105,7 +105,7 @@ static inline run_list_element *ntfs_rl_realloc(run_list_element *rl, ...@@ -105,7 +105,7 @@ static inline run_list_element *ntfs_rl_realloc(run_list_element *rl,
* It is up to the caller to serialize access to the run lists @dst and @src. * It is up to the caller to serialize access to the run lists @dst and @src.
* *
* Return: TRUE Success, the run lists can be merged. * Return: TRUE Success, the run lists can be merged.
* FALSE Failure, the run lists cannot be merged. * FALSE Failure, the run lists cannot be merged.
*/ */
static inline BOOL ntfs_are_rl_mergeable(run_list_element *dst, static inline BOOL ntfs_are_rl_mergeable(run_list_element *dst,
run_list_element *src) run_list_element *src)
...@@ -151,7 +151,7 @@ static inline void __ntfs_rl_merge(run_list_element *dst, run_list_element *src) ...@@ -151,7 +151,7 @@ static inline void __ntfs_rl_merge(run_list_element *dst, run_list_element *src)
* It is up to the caller to serialize access to the run lists @dst and @src. * It is up to the caller to serialize access to the run lists @dst and @src.
* *
* Return: TRUE Success, the run lists have been merged. * Return: TRUE Success, the run lists have been merged.
* FALSE Failure, the run lists cannot be merged and have not been * FALSE Failure, the run lists cannot be merged and have not been
* modified. * modified.
*/ */
static inline BOOL ntfs_rl_merge(run_list_element *dst, run_list_element *src) static inline BOOL ntfs_rl_merge(run_list_element *dst, run_list_element *src)
...@@ -264,9 +264,9 @@ static inline run_list_element *ntfs_rl_insert(run_list_element *dst, ...@@ -264,9 +264,9 @@ static inline run_list_element *ntfs_rl_insert(run_list_element *dst,
BUG_ON(!src); BUG_ON(!src);
/* disc => Discontinuity between the end of @dst and the start of @src. /* disc => Discontinuity between the end of @dst and the start of @src.
* This means we might need to insert a hole. * This means we might need to insert a hole.
* hole => @dst ends with a hole or an unmapped region which we can * hole => @dst ends with a hole or an unmapped region which we can
* extend to match the discontinuity. */ * extend to match the discontinuity. */
if (loc == 0) if (loc == 0)
disc = (src[0].vcn > 0); disc = (src[0].vcn > 0);
else { else {
...@@ -444,7 +444,7 @@ static inline run_list_element *ntfs_rl_split(run_list_element *dst, int dsize, ...@@ -444,7 +444,7 @@ static inline run_list_element *ntfs_rl_split(run_list_element *dst, int dsize,
ntfs_rl_mc(dst, loc + 1, src, 0, ssize); ntfs_rl_mc(dst, loc + 1, src, 0, ssize);
/* Adjust the size of the holes either size of @src. */ /* Adjust the size of the holes either size of @src. */
dst[loc].length = dst[loc+1].vcn - dst[loc].vcn; dst[loc].length = dst[loc+1].vcn - dst[loc].vcn;
dst[loc+ssize+1].vcn = dst[loc+ssize].vcn + dst[loc+ssize].length; dst[loc+ssize+1].vcn = dst[loc+ssize].vcn + dst[loc+ssize].length;
dst[loc+ssize+1].length = dst[loc+ssize+2].vcn - dst[loc+ssize+1].vcn; dst[loc+ssize+1].length = dst[loc+ssize+2].vcn - dst[loc+ssize+1].vcn;
...@@ -504,7 +504,7 @@ run_list_element *ntfs_merge_run_lists(run_list_element *drl, ...@@ -504,7 +504,7 @@ run_list_element *ntfs_merge_run_lists(run_list_element *drl,
ntfs_debug_dump_runlist(srl); ntfs_debug_dump_runlist(srl);
#endif #endif
/* Check for silly calling... */ /* Check for silly calling... */
if (unlikely(!srl)) if (unlikely(!srl))
return drl; return drl;
if (unlikely(IS_ERR(srl) || IS_ERR(drl))) if (unlikely(IS_ERR(srl) || IS_ERR(drl)))
...@@ -706,9 +706,9 @@ run_list_element *ntfs_merge_run_lists(run_list_element *drl, ...@@ -706,9 +706,9 @@ run_list_element *ntfs_merge_run_lists(run_list_element *drl,
* *
* The following error codes are defined: * The following error codes are defined:
* -ENOMEM - Not enough memory to allocate run list array. * -ENOMEM - Not enough memory to allocate run list array.
* -EIO - Corrupt run list. * -EIO - Corrupt run list.
* -EINVAL - Invalid parameters were passed in. * -EINVAL - Invalid parameters were passed in.
* -ERANGE - The two run lists overlap. * -ERANGE - The two run lists overlap.
* *
* FIXME: For now we take the conceptionally simplest approach of creating the * FIXME: For now we take the conceptionally simplest approach of creating the
* new run list disregarding the already existing one and then splicing the * new run list disregarding the already existing one and then splicing the
...@@ -719,7 +719,7 @@ run_list_element *decompress_mapping_pairs(const ntfs_volume *vol, ...@@ -719,7 +719,7 @@ run_list_element *decompress_mapping_pairs(const ntfs_volume *vol,
const ATTR_RECORD *attr, run_list_element *old_rl) const ATTR_RECORD *attr, run_list_element *old_rl)
{ {
VCN vcn; /* Current vcn. */ VCN vcn; /* Current vcn. */
LCN lcn; /* Current lcn. */ LCN lcn; /* Current lcn. */
s64 deltaxcn; /* Change in [vl]cn. */ s64 deltaxcn; /* Change in [vl]cn. */
run_list_element *rl; /* The output run list. */ run_list_element *rl; /* The output run list. */
u8 *buf; /* Current position in mapping pairs array. */ u8 *buf; /* Current position in mapping pairs array. */
...@@ -769,7 +769,7 @@ run_list_element *decompress_mapping_pairs(const ntfs_volume *vol, ...@@ -769,7 +769,7 @@ run_list_element *decompress_mapping_pairs(const ntfs_volume *vol,
*/ */
if (((rlpos + 3) * sizeof(*old_rl)) > rlsize) { if (((rlpos + 3) * sizeof(*old_rl)) > rlsize) {
run_list_element *rl2; run_list_element *rl2;
rl2 = ntfs_malloc_nofs(rlsize + (int)PAGE_SIZE); rl2 = ntfs_malloc_nofs(rlsize + (int)PAGE_SIZE);
if (unlikely(!rl2)) { if (unlikely(!rl2)) {
ntfs_free(rl); ntfs_free(rl);
...@@ -946,7 +946,7 @@ int map_run_list(ntfs_inode *ni, VCN vcn) ...@@ -946,7 +946,7 @@ int map_run_list(ntfs_inode *ni, VCN vcn)
attr_search_context *ctx; attr_search_context *ctx;
MFT_RECORD *mrec; MFT_RECORD *mrec;
int err = 0; int err = 0;
ntfs_debug("Mapping run list part containing vcn 0x%llx.", ntfs_debug("Mapping run list part containing vcn 0x%llx.",
(unsigned long long)vcn); (unsigned long long)vcn);
...@@ -983,7 +983,7 @@ int map_run_list(ntfs_inode *ni, VCN vcn) ...@@ -983,7 +983,7 @@ int map_run_list(ntfs_inode *ni, VCN vcn)
ni->run_list.rl = rl; ni->run_list.rl = rl;
} }
up_write(&ni->run_list.lock); up_write(&ni->run_list.lock);
put_attr_search_ctx(ctx); put_attr_search_ctx(ctx);
err_out: err_out:
unmap_mft_record(base_ni); unmap_mft_record(base_ni);
...@@ -1148,7 +1148,7 @@ BOOL find_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len, ...@@ -1148,7 +1148,7 @@ BOOL find_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
(uchar_t*)((u8*)a + le16_to_cpu(a->name_offset)), (uchar_t*)((u8*)a + le16_to_cpu(a->name_offset)),
a->name_length, ic, upcase, upcase_len)) { a->name_length, ic, upcase, upcase_len)) {
register int rc; register int rc;
rc = ntfs_collate_names(name, name_len, rc = ntfs_collate_names(name, name_len,
(uchar_t*)((u8*)a + (uchar_t*)((u8*)a +
le16_to_cpu(a->name_offset)), le16_to_cpu(a->name_offset)),
...@@ -1162,7 +1162,7 @@ BOOL find_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len, ...@@ -1162,7 +1162,7 @@ BOOL find_attr(const ATTR_TYPES type, const uchar_t *name, const u32 name_len,
return FALSE; return FALSE;
/* If the strings are not equal, continue search. */ /* If the strings are not equal, continue search. */
if (rc) if (rc)
continue; continue;
rc = ntfs_collate_names(name, name_len, rc = ntfs_collate_names(name, name_len,
(uchar_t*)((u8*)a + (uchar_t*)((u8*)a +
le16_to_cpu(a->name_offset)), le16_to_cpu(a->name_offset)),
...@@ -1461,7 +1461,7 @@ static BOOL find_external_attr(const ATTR_TYPES type, const uchar_t *name, ...@@ -1461,7 +1461,7 @@ static BOOL find_external_attr(const ATTR_TYPES type, const uchar_t *name,
if (lowest_vcn && (u8*)next_al_entry >= al_start && if (lowest_vcn && (u8*)next_al_entry >= al_start &&
(u8*)next_al_entry + 6 < al_end && (u8*)next_al_entry + 6 < al_end &&
(u8*)next_al_entry + le16_to_cpu( (u8*)next_al_entry + le16_to_cpu(
next_al_entry->length) <= al_end && next_al_entry->length) <= al_end &&
sle64_to_cpu(next_al_entry->lowest_vcn) <= sle64_to_cpu(next_al_entry->lowest_vcn) <=
sle64_to_cpu(lowest_vcn) && sle64_to_cpu(lowest_vcn) &&
next_al_entry->type == al_entry->type && next_al_entry->type == al_entry->type &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment