projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
qstr: constify instances in ext2
[cascardo/linux.git]
/
fs
/
ext2
/
dir.c
diff --git
a/fs/ext2/dir.c
b/fs/ext2/dir.c
index
7ff6fcf
..
61ad490
100644
(file)
--- a/
fs/ext2/dir.c
+++ b/
fs/ext2/dir.c
@@
-110,7
+110,7
@@
static int ext2_commit_chunk(struct page *page, loff_t pos, unsigned len)
return err;
}
return err;
}
-static
void
ext2_check_page(struct page *page, int quiet)
+static
bool
ext2_check_page(struct page *page, int quiet)
{
struct inode *dir = page->mapping->host;
struct super_block *sb = dir->i_sb;
{
struct inode *dir = page->mapping->host;
struct super_block *sb = dir->i_sb;
@@
-148,7
+148,7
@@
static void ext2_check_page(struct page *page, int quiet)
goto Eend;
out:
SetPageChecked(page);
goto Eend;
out:
SetPageChecked(page);
- return;
+ return
true
;
/* Too bad, we had an error */
/* Too bad, we had an error */
@@
-190,8
+190,8
@@
Eend:
(unsigned long) le32_to_cpu(p->inode));
}
fail:
(unsigned long) le32_to_cpu(p->inode));
}
fail:
- SetPageChecked(page);
SetPageError(page);
SetPageError(page);
+ return false;
}
static struct page * ext2_get_page(struct inode *dir, unsigned long n,
}
static struct page * ext2_get_page(struct inode *dir, unsigned long n,
@@
-201,10
+201,10
@@
static struct page * ext2_get_page(struct inode *dir, unsigned long n,
struct page *page = read_mapping_page(mapping, n, NULL);
if (!IS_ERR(page)) {
kmap(page);
struct page *page = read_mapping_page(mapping, n, NULL);
if (!IS_ERR(page)) {
kmap(page);
- if (
!PageChecked(page))
- ext2_check_page(page, quiet);
- if (PageError(page))
- goto fail;
+ if (
unlikely(!PageChecked(page))) {
+ if (PageError(page) || !ext2_check_page(page, quiet))
+ goto fail;
+ }
}
return page;
}
return page;
@@
-358,8
+358,8
@@
ext2_readdir(struct file *file, struct dir_context *ctx)
* and the entry itself. Page is returned mapped and unlocked.
* Entry is guaranteed to be valid.
*/
* and the entry itself. Page is returned mapped and unlocked.
* Entry is guaranteed to be valid.
*/
-struct ext2_dir_entry_2 *ext2_find_entry (struct inode *
dir,
-
struct qstr *child, struct page **
res_page)
+struct ext2_dir_entry_2 *ext2_find_entry (struct inode *dir,
+
const struct qstr *child, struct page **
res_page)
{
const char *name = child->name;
int namelen = child->len;
{
const char *name = child->name;
int namelen = child->len;
@@
-435,7
+435,7
@@
struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p)
return de;
}
return de;
}
-ino_t ext2_inode_by_name(struct inode *dir, struct qstr *child)
+ino_t ext2_inode_by_name(struct inode *dir,
const
struct qstr *child)
{
ino_t res = 0;
struct ext2_dir_entry_2 *de;
{
ino_t res = 0;
struct ext2_dir_entry_2 *de;
@@
-716,7
+716,7
@@
not_empty:
const struct file_operations ext2_dir_operations = {
.llseek = generic_file_llseek,
.read = generic_read_dir,
const struct file_operations ext2_dir_operations = {
.llseek = generic_file_llseek,
.read = generic_read_dir,
- .iterate
= ext2_readdir,
+ .iterate
_shared
= ext2_readdir,
.unlocked_ioctl = ext2_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = ext2_compat_ioctl,
.unlocked_ioctl = ext2_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = ext2_compat_ioctl,