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
ffdc9064
Commit
ffdc9064
authored
Jun 08, 2009
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repair adfs ->write_inode(), switch to simple_fsync()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
bea6b64c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
6 deletions
+48
-6
fs/adfs/adfs.h
fs/adfs/adfs.h
+3
-1
fs/adfs/dir.c
fs/adfs/dir.c
+8
-2
fs/adfs/dir_f.c
fs/adfs/dir_f.c
+17
-0
fs/adfs/dir_fplus.c
fs/adfs/dir_fplus.c
+17
-0
fs/adfs/file.c
fs/adfs/file.c
+1
-1
fs/adfs/inode.c
fs/adfs/inode.c
+2
-2
No files found.
fs/adfs/adfs.h
View file @
ffdc9064
...
@@ -53,6 +53,7 @@ struct adfs_dir_ops {
...
@@ -53,6 +53,7 @@ struct adfs_dir_ops {
int
(
*
update
)(
struct
adfs_dir
*
dir
,
struct
object_info
*
obj
);
int
(
*
update
)(
struct
adfs_dir
*
dir
,
struct
object_info
*
obj
);
int
(
*
create
)(
struct
adfs_dir
*
dir
,
struct
object_info
*
obj
);
int
(
*
create
)(
struct
adfs_dir
*
dir
,
struct
object_info
*
obj
);
int
(
*
remove
)(
struct
adfs_dir
*
dir
,
struct
object_info
*
obj
);
int
(
*
remove
)(
struct
adfs_dir
*
dir
,
struct
object_info
*
obj
);
int
(
*
sync
)(
struct
adfs_dir
*
dir
);
void
(
*
free
)(
struct
adfs_dir
*
dir
);
void
(
*
free
)(
struct
adfs_dir
*
dir
);
};
};
...
@@ -90,7 +91,8 @@ extern const struct dentry_operations adfs_dentry_operations;
...
@@ -90,7 +91,8 @@ extern const struct dentry_operations adfs_dentry_operations;
extern
struct
adfs_dir_ops
adfs_f_dir_ops
;
extern
struct
adfs_dir_ops
adfs_f_dir_ops
;
extern
struct
adfs_dir_ops
adfs_fplus_dir_ops
;
extern
struct
adfs_dir_ops
adfs_fplus_dir_ops
;
extern
int
adfs_dir_update
(
struct
super_block
*
sb
,
struct
object_info
*
obj
);
extern
int
adfs_dir_update
(
struct
super_block
*
sb
,
struct
object_info
*
obj
,
int
wait
);
/* file.c */
/* file.c */
extern
const
struct
inode_operations
adfs_file_inode_operations
;
extern
const
struct
inode_operations
adfs_file_inode_operations
;
...
...
fs/adfs/dir.c
View file @
ffdc9064
...
@@ -83,7 +83,7 @@ adfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
...
@@ -83,7 +83,7 @@ adfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
}
}
int
int
adfs_dir_update
(
struct
super_block
*
sb
,
struct
object_info
*
obj
)
adfs_dir_update
(
struct
super_block
*
sb
,
struct
object_info
*
obj
,
int
wait
)
{
{
int
ret
=
-
EINVAL
;
int
ret
=
-
EINVAL
;
#ifdef CONFIG_ADFS_FS_RW
#ifdef CONFIG_ADFS_FS_RW
...
@@ -106,6 +106,12 @@ adfs_dir_update(struct super_block *sb, struct object_info *obj)
...
@@ -106,6 +106,12 @@ adfs_dir_update(struct super_block *sb, struct object_info *obj)
ret
=
ops
->
update
(
&
dir
,
obj
);
ret
=
ops
->
update
(
&
dir
,
obj
);
write_unlock
(
&
adfs_dir_lock
);
write_unlock
(
&
adfs_dir_lock
);
if
(
wait
)
{
int
err
=
ops
->
sync
(
&
dir
);
if
(
!
ret
)
ret
=
err
;
}
ops
->
free
(
&
dir
);
ops
->
free
(
&
dir
);
out:
out:
#endif
#endif
...
@@ -199,7 +205,7 @@ const struct file_operations adfs_dir_operations = {
...
@@ -199,7 +205,7 @@ const struct file_operations adfs_dir_operations = {
.
read
=
generic_read_dir
,
.
read
=
generic_read_dir
,
.
llseek
=
generic_file_llseek
,
.
llseek
=
generic_file_llseek
,
.
readdir
=
adfs_readdir
,
.
readdir
=
adfs_readdir
,
.
fsync
=
fi
le_fsync
,
.
fsync
=
simp
le_fsync
,
};
};
static
int
static
int
...
...
fs/adfs/dir_f.c
View file @
ffdc9064
...
@@ -437,6 +437,22 @@ adfs_f_update(struct adfs_dir *dir, struct object_info *obj)
...
@@ -437,6 +437,22 @@ adfs_f_update(struct adfs_dir *dir, struct object_info *obj)
#endif
#endif
}
}
static
int
adfs_f_sync
(
struct
adfs_dir
*
dir
)
{
int
err
=
0
;
int
i
;
for
(
i
=
dir
->
nr_buffers
-
1
;
i
>=
0
;
i
--
)
{
struct
buffer_head
*
bh
=
dir
->
bh
[
i
];
sync_dirty_buffer
(
bh
);
if
(
buffer_req
(
bh
)
&&
!
buffer_uptodate
(
bh
))
err
=
-
EIO
;
}
return
err
;
}
static
void
static
void
adfs_f_free
(
struct
adfs_dir
*
dir
)
adfs_f_free
(
struct
adfs_dir
*
dir
)
{
{
...
@@ -456,5 +472,6 @@ struct adfs_dir_ops adfs_f_dir_ops = {
...
@@ -456,5 +472,6 @@ struct adfs_dir_ops adfs_f_dir_ops = {
.
setpos
=
adfs_f_setpos
,
.
setpos
=
adfs_f_setpos
,
.
getnext
=
adfs_f_getnext
,
.
getnext
=
adfs_f_getnext
,
.
update
=
adfs_f_update
,
.
update
=
adfs_f_update
,
.
sync
=
adfs_f_sync
,
.
free
=
adfs_f_free
.
free
=
adfs_f_free
};
};
fs/adfs/dir_fplus.c
View file @
ffdc9064
...
@@ -161,6 +161,22 @@ adfs_fplus_getnext(struct adfs_dir *dir, struct object_info *obj)
...
@@ -161,6 +161,22 @@ adfs_fplus_getnext(struct adfs_dir *dir, struct object_info *obj)
return
ret
;
return
ret
;
}
}
static
int
adfs_fplus_sync
(
struct
adfs_dir
*
dir
)
{
int
err
=
0
;
int
i
;
for
(
i
=
dir
->
nr_buffers
-
1
;
i
>=
0
;
i
--
)
{
struct
buffer_head
*
bh
=
dir
->
bh
[
i
];
sync_dirty_buffer
(
bh
);
if
(
buffer_req
(
bh
)
&&
!
buffer_uptodate
(
bh
))
err
=
-
EIO
;
}
return
err
;
}
static
void
static
void
adfs_fplus_free
(
struct
adfs_dir
*
dir
)
adfs_fplus_free
(
struct
adfs_dir
*
dir
)
{
{
...
@@ -175,5 +191,6 @@ struct adfs_dir_ops adfs_fplus_dir_ops = {
...
@@ -175,5 +191,6 @@ struct adfs_dir_ops adfs_fplus_dir_ops = {
.
read
=
adfs_fplus_read
,
.
read
=
adfs_fplus_read
,
.
setpos
=
adfs_fplus_setpos
,
.
setpos
=
adfs_fplus_setpos
,
.
getnext
=
adfs_fplus_getnext
,
.
getnext
=
adfs_fplus_getnext
,
.
sync
=
adfs_fplus_sync
,
.
free
=
adfs_fplus_free
.
free
=
adfs_fplus_free
};
};
fs/adfs/file.c
View file @
ffdc9064
...
@@ -30,7 +30,7 @@ const struct file_operations adfs_file_operations = {
...
@@ -30,7 +30,7 @@ const struct file_operations adfs_file_operations = {
.
read
=
do_sync_read
,
.
read
=
do_sync_read
,
.
aio_read
=
generic_file_aio_read
,
.
aio_read
=
generic_file_aio_read
,
.
mmap
=
generic_file_mmap
,
.
mmap
=
generic_file_mmap
,
.
fsync
=
fi
le_fsync
,
.
fsync
=
simp
le_fsync
,
.
write
=
do_sync_write
,
.
write
=
do_sync_write
,
.
aio_write
=
generic_file_aio_write
,
.
aio_write
=
generic_file_aio_write
,
.
splice_read
=
generic_file_splice_read
,
.
splice_read
=
generic_file_splice_read
,
...
...
fs/adfs/inode.c
View file @
ffdc9064
...
@@ -376,7 +376,7 @@ adfs_notify_change(struct dentry *dentry, struct iattr *attr)
...
@@ -376,7 +376,7 @@ adfs_notify_change(struct dentry *dentry, struct iattr *attr)
* The adfs-specific inode data has already been updated by
* The adfs-specific inode data has already been updated by
* adfs_notify_change()
* adfs_notify_change()
*/
*/
int
adfs_write_inode
(
struct
inode
*
inode
,
int
unused
)
int
adfs_write_inode
(
struct
inode
*
inode
,
int
wait
)
{
{
struct
super_block
*
sb
=
inode
->
i_sb
;
struct
super_block
*
sb
=
inode
->
i_sb
;
struct
object_info
obj
;
struct
object_info
obj
;
...
@@ -391,7 +391,7 @@ int adfs_write_inode(struct inode *inode, int unused)
...
@@ -391,7 +391,7 @@ int adfs_write_inode(struct inode *inode, int unused)
obj
.
attr
=
ADFS_I
(
inode
)
->
attr
;
obj
.
attr
=
ADFS_I
(
inode
)
->
attr
;
obj
.
size
=
inode
->
i_size
;
obj
.
size
=
inode
->
i_size
;
ret
=
adfs_dir_update
(
sb
,
&
obj
);
ret
=
adfs_dir_update
(
sb
,
&
obj
,
wait
);
unlock_kernel
();
unlock_kernel
();
return
ret
;
return
ret
;
}
}
...
...
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