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
ede3ef5c
Commit
ede3ef5c
authored
Mar 07, 2023
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sysv: switch to put_and_unmap_page()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
8ad77c57
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
22 deletions
+15
-22
fs/sysv/dir.c
fs/sysv/dir.c
+11
-17
fs/sysv/namei.c
fs/sysv/namei.c
+4
-4
fs/sysv/sysv.h
fs/sysv/sysv.h
+0
-1
No files found.
fs/sysv/dir.c
View file @
ede3ef5c
...
@@ -28,12 +28,6 @@ const struct file_operations sysv_dir_operations = {
...
@@ -28,12 +28,6 @@ const struct file_operations sysv_dir_operations = {
.
fsync
=
generic_file_fsync
,
.
fsync
=
generic_file_fsync
,
};
};
inline
void
dir_put_page
(
struct
page
*
page
,
void
*
page_addr
)
{
kunmap_local
(
page_addr
);
put_page
(
page
);
}
static
void
dir_commit_chunk
(
struct
page
*
page
,
loff_t
pos
,
unsigned
len
)
static
void
dir_commit_chunk
(
struct
page
*
page
,
loff_t
pos
,
unsigned
len
)
{
{
struct
address_space
*
mapping
=
page
->
mapping
;
struct
address_space
*
mapping
=
page
->
mapping
;
...
@@ -58,7 +52,7 @@ static int sysv_handle_dirsync(struct inode *dir)
...
@@ -58,7 +52,7 @@ static int sysv_handle_dirsync(struct inode *dir)
}
}
/*
/*
* Calls to dir_get_page()/
dir_put
_page() must be nested according to the
* Calls to dir_get_page()/
put_and_unmap
_page() must be nested according to the
* rules documented in mm/highmem.rst.
* rules documented in mm/highmem.rst.
*
*
* NOTE: sysv_find_entry() and sysv_dotdot() act as calls to dir_get_page()
* NOTE: sysv_find_entry() and sysv_dotdot() act as calls to dir_get_page()
...
@@ -109,11 +103,11 @@ static int sysv_readdir(struct file *file, struct dir_context *ctx)
...
@@ -109,11 +103,11 @@ static int sysv_readdir(struct file *file, struct dir_context *ctx)
if
(
!
dir_emit
(
ctx
,
name
,
strnlen
(
name
,
SYSV_NAMELEN
),
if
(
!
dir_emit
(
ctx
,
name
,
strnlen
(
name
,
SYSV_NAMELEN
),
fs16_to_cpu
(
SYSV_SB
(
sb
),
de
->
inode
),
fs16_to_cpu
(
SYSV_SB
(
sb
),
de
->
inode
),
DT_UNKNOWN
))
{
DT_UNKNOWN
))
{
dir_put
_page
(
page
,
kaddr
);
put_and_unmap
_page
(
page
,
kaddr
);
return
0
;
return
0
;
}
}
}
}
dir_put
_page
(
page
,
kaddr
);
put_and_unmap
_page
(
page
,
kaddr
);
}
}
return
0
;
return
0
;
}
}
...
@@ -137,7 +131,7 @@ static inline int namecompare(int len, int maxlen,
...
@@ -137,7 +131,7 @@ static inline int namecompare(int len, int maxlen,
* itself (as a parameter - res_dir). It does NOT read the inode of the
* itself (as a parameter - res_dir). It does NOT read the inode of the
* entry - you'll have to do that yourself if you want to.
* entry - you'll have to do that yourself if you want to.
*
*
* On Success
dir_put
_page() should be called on *res_page.
* On Success
put_and_unmap
_page() should be called on *res_page.
*
*
* sysv_find_entry() acts as a call to dir_get_page() and must be treated
* sysv_find_entry() acts as a call to dir_get_page() and must be treated
* accordingly for nesting purposes.
* accordingly for nesting purposes.
...
@@ -172,7 +166,7 @@ struct sysv_dir_entry *sysv_find_entry(struct dentry *dentry, struct page **res_
...
@@ -172,7 +166,7 @@ struct sysv_dir_entry *sysv_find_entry(struct dentry *dentry, struct page **res_
name
,
de
->
name
))
name
,
de
->
name
))
goto
found
;
goto
found
;
}
}
dir_put
_page
(
page
,
kaddr
);
put_and_unmap
_page
(
page
,
kaddr
);
}
}
if
(
++
n
>=
npages
)
if
(
++
n
>=
npages
)
...
@@ -215,7 +209,7 @@ int sysv_add_link(struct dentry *dentry, struct inode *inode)
...
@@ -215,7 +209,7 @@ int sysv_add_link(struct dentry *dentry, struct inode *inode)
goto
out_page
;
goto
out_page
;
de
++
;
de
++
;
}
}
dir_put
_page
(
page
,
kaddr
);
put_and_unmap
_page
(
page
,
kaddr
);
}
}
BUG
();
BUG
();
return
-
EINVAL
;
return
-
EINVAL
;
...
@@ -234,7 +228,7 @@ int sysv_add_link(struct dentry *dentry, struct inode *inode)
...
@@ -234,7 +228,7 @@ int sysv_add_link(struct dentry *dentry, struct inode *inode)
mark_inode_dirty
(
dir
);
mark_inode_dirty
(
dir
);
err
=
sysv_handle_dirsync
(
dir
);
err
=
sysv_handle_dirsync
(
dir
);
out_page:
out_page:
dir_put
_page
(
page
,
kaddr
);
put_and_unmap
_page
(
page
,
kaddr
);
return
err
;
return
err
;
out_unlock:
out_unlock:
unlock_page
(
page
);
unlock_page
(
page
);
...
@@ -327,12 +321,12 @@ int sysv_empty_dir(struct inode * inode)
...
@@ -327,12 +321,12 @@ int sysv_empty_dir(struct inode * inode)
if
(
de
->
name
[
1
]
!=
'.'
||
de
->
name
[
2
])
if
(
de
->
name
[
1
]
!=
'.'
||
de
->
name
[
2
])
goto
not_empty
;
goto
not_empty
;
}
}
dir_put
_page
(
page
,
kaddr
);
put_and_unmap
_page
(
page
,
kaddr
);
}
}
return
1
;
return
1
;
not_empty:
not_empty:
dir_put
_page
(
page
,
kaddr
);
put_and_unmap
_page
(
page
,
kaddr
);
return
0
;
return
0
;
}
}
...
@@ -358,7 +352,7 @@ int sysv_set_link(struct sysv_dir_entry *de, struct page *page,
...
@@ -358,7 +352,7 @@ int sysv_set_link(struct sysv_dir_entry *de, struct page *page,
}
}
/*
/*
* Calls to dir_get_page()/
dir_put
_page() must be nested according to the
* Calls to dir_get_page()/
put_and_unmap
_page() must be nested according to the
* rules documented in mm/highmem.rst.
* rules documented in mm/highmem.rst.
*
*
* sysv_dotdot() acts as a call to dir_get_page() and must be treated
* sysv_dotdot() acts as a call to dir_get_page() and must be treated
...
@@ -382,7 +376,7 @@ ino_t sysv_inode_by_name(struct dentry *dentry)
...
@@ -382,7 +376,7 @@ ino_t sysv_inode_by_name(struct dentry *dentry)
if
(
de
)
{
if
(
de
)
{
res
=
fs16_to_cpu
(
SYSV_SB
(
dentry
->
d_sb
),
de
->
inode
);
res
=
fs16_to_cpu
(
SYSV_SB
(
dentry
->
d_sb
),
de
->
inode
);
dir_put
_page
(
page
,
de
);
put_and_unmap
_page
(
page
,
de
);
}
}
return
res
;
return
res
;
}
}
fs/sysv/namei.c
View file @
ede3ef5c
...
@@ -164,7 +164,7 @@ static int sysv_unlink(struct inode * dir, struct dentry * dentry)
...
@@ -164,7 +164,7 @@ static int sysv_unlink(struct inode * dir, struct dentry * dentry)
inode
->
i_ctime
=
dir
->
i_ctime
;
inode
->
i_ctime
=
dir
->
i_ctime
;
inode_dec_link_count
(
inode
);
inode_dec_link_count
(
inode
);
}
}
dir_put
_page
(
page
,
de
);
put_and_unmap
_page
(
page
,
de
);
return
err
;
return
err
;
}
}
...
@@ -227,7 +227,7 @@ static int sysv_rename(struct mnt_idmap *idmap, struct inode *old_dir,
...
@@ -227,7 +227,7 @@ static int sysv_rename(struct mnt_idmap *idmap, struct inode *old_dir,
if
(
!
new_de
)
if
(
!
new_de
)
goto
out_dir
;
goto
out_dir
;
err
=
sysv_set_link
(
new_de
,
new_page
,
old_inode
);
err
=
sysv_set_link
(
new_de
,
new_page
,
old_inode
);
dir_put
_page
(
new_page
,
new_de
);
put_and_unmap
_page
(
new_page
,
new_de
);
if
(
err
)
if
(
err
)
goto
out_dir
;
goto
out_dir
;
new_inode
->
i_ctime
=
current_time
(
new_inode
);
new_inode
->
i_ctime
=
current_time
(
new_inode
);
...
@@ -256,9 +256,9 @@ static int sysv_rename(struct mnt_idmap *idmap, struct inode *old_dir,
...
@@ -256,9 +256,9 @@ static int sysv_rename(struct mnt_idmap *idmap, struct inode *old_dir,
out_dir:
out_dir:
if
(
dir_de
)
if
(
dir_de
)
dir_put
_page
(
dir_page
,
dir_de
);
put_and_unmap
_page
(
dir_page
,
dir_de
);
out_old:
out_old:
dir_put
_page
(
old_page
,
old_de
);
put_and_unmap
_page
(
old_page
,
old_de
);
out:
out:
return
err
;
return
err
;
}
}
...
...
fs/sysv/sysv.h
View file @
ede3ef5c
...
@@ -148,7 +148,6 @@ extern void sysv_destroy_icache(void);
...
@@ -148,7 +148,6 @@ extern void sysv_destroy_icache(void);
/* dir.c */
/* dir.c */
extern
void
dir_put_page
(
struct
page
*
page
,
void
*
vaddr
);
extern
struct
sysv_dir_entry
*
sysv_find_entry
(
struct
dentry
*
,
struct
page
**
);
extern
struct
sysv_dir_entry
*
sysv_find_entry
(
struct
dentry
*
,
struct
page
**
);
extern
int
sysv_add_link
(
struct
dentry
*
,
struct
inode
*
);
extern
int
sysv_add_link
(
struct
dentry
*
,
struct
inode
*
);
extern
int
sysv_delete_entry
(
struct
sysv_dir_entry
*
,
struct
page
*
);
extern
int
sysv_delete_entry
(
struct
sysv_dir_entry
*
,
struct
page
*
);
...
...
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