Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
bf285b86
Commit
bf285b86
authored
Apr 24, 2002
by
Hirofumi Ogawa
Committed by
Linus Torvalds
Apr 24, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] fat_clusters_flush() cleanup (4/5)
This patch cleans up fat_clusters_flush().
parent
17005aed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
11 deletions
+10
-11
fs/fat/cache.c
fs/fat/cache.c
+3
-6
fs/fat/inode.c
fs/fat/inode.c
+1
-3
fs/fat/misc.c
fs/fat/misc.c
+6
-2
No files found.
fs/fat/cache.c
View file @
bf285b86
...
...
@@ -388,14 +388,11 @@ int fat_free(struct inode *inode,int skip)
nr
=
-
EIO
;
goto
error
;
}
if
(
MSDOS_SB
(
sb
)
->
free_clusters
!=
-
1
)
{
if
(
MSDOS_SB
(
sb
)
->
free_clusters
!=
-
1
)
MSDOS_SB
(
sb
)
->
free_clusters
++
;
if
(
MSDOS_SB
(
sb
)
->
fat_bits
==
32
)
{
fat_clusters_flush
(
sb
);
}
}
inode
->
i_blocks
-=
(
1
<<
MSDOS_SB
(
sb
)
->
cluster_bits
)
>>
9
;
inode
->
i_blocks
-=
(
1
<<
MSDOS_SB
(
sb
)
->
cluster_bits
)
>>
9
;
}
fat_clusters_flush
(
sb
);
nr
=
0
;
error:
unlock_fat
(
sb
);
...
...
fs/fat/inode.c
View file @
bf285b86
...
...
@@ -178,9 +178,7 @@ void fat_put_super(struct super_block *sb)
dec_cvf_format_use_count_by_version
(
sbi
->
cvf_format
->
cvf_version
);
sbi
->
cvf_format
->
unmount_cvf
(
sb
);
}
if
(
sbi
->
fat_bits
==
32
)
{
fat_clusters_flush
(
sb
);
}
fat_clusters_flush
(
sb
);
fat_cache_inval_dev
(
sb
);
if
(
sbi
->
nls_disk
)
{
unload_nls
(
sbi
->
nls_disk
);
...
...
fs/fat/misc.c
View file @
bf285b86
...
...
@@ -97,6 +97,11 @@ void fat_clusters_flush(struct super_block *sb)
struct
buffer_head
*
bh
;
struct
fat_boot_fsinfo
*
fsinfo
;
if
(
MSDOS_SB
(
sb
)
->
fat_bits
!=
32
)
return
;
if
(
MSDOS_SB
(
sb
)
->
free_clusters
==
-
1
)
return
;
bh
=
fat_bread
(
sb
,
MSDOS_SB
(
sb
)
->
fsinfo_sector
);
if
(
bh
==
NULL
)
{
printk
(
"FAT bread failed in fat_clusters_flush
\n
"
);
...
...
@@ -185,8 +190,7 @@ int fat_add_cluster(struct inode *inode)
fat_access
(
sb
,
nr
,
FAT_ENT_EOF
);
if
(
MSDOS_SB
(
sb
)
->
free_clusters
!=
-
1
)
MSDOS_SB
(
sb
)
->
free_clusters
--
;
if
(
MSDOS_SB
(
sb
)
->
fat_bits
==
32
)
fat_clusters_flush
(
sb
);
fat_clusters_flush
(
sb
);
unlock_fat
(
sb
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment