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
nexedi
linux
Commits
bfee7169
Commit
bfee7169
authored
May 17, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[readdir] convert isofs
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
0312fa7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
22 deletions
+20
-22
fs/isofs/dir.c
fs/isofs/dir.c
+20
-22
No files found.
fs/isofs/dir.c
View file @
bfee7169
...
@@ -78,8 +78,8 @@ int get_acorn_filename(struct iso_directory_record *de,
...
@@ -78,8 +78,8 @@ int get_acorn_filename(struct iso_directory_record *de,
/*
/*
* This should _really_ be cleaned up some day..
* This should _really_ be cleaned up some day..
*/
*/
static
int
do_isofs_readdir
(
struct
inode
*
inode
,
struct
file
*
fil
p
,
static
int
do_isofs_readdir
(
struct
inode
*
inode
,
struct
file
*
fil
e
,
void
*
dirent
,
filldir_t
filldir
,
struct
dir_context
*
ctx
,
char
*
tmpname
,
struct
iso_directory_record
*
tmpde
)
char
*
tmpname
,
struct
iso_directory_record
*
tmpde
)
{
{
unsigned
long
bufsize
=
ISOFS_BUFFER_SIZE
(
inode
);
unsigned
long
bufsize
=
ISOFS_BUFFER_SIZE
(
inode
);
...
@@ -94,10 +94,10 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
...
@@ -94,10 +94,10 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
struct
iso_directory_record
*
de
;
struct
iso_directory_record
*
de
;
struct
isofs_sb_info
*
sbi
=
ISOFS_SB
(
inode
->
i_sb
);
struct
isofs_sb_info
*
sbi
=
ISOFS_SB
(
inode
->
i_sb
);
offset
=
filp
->
f_
pos
&
(
bufsize
-
1
);
offset
=
ctx
->
pos
&
(
bufsize
-
1
);
block
=
filp
->
f_
pos
>>
bufbits
;
block
=
ctx
->
pos
>>
bufbits
;
while
(
filp
->
f_
pos
<
inode
->
i_size
)
{
while
(
ctx
->
pos
<
inode
->
i_size
)
{
int
de_len
;
int
de_len
;
if
(
!
bh
)
{
if
(
!
bh
)
{
...
@@ -108,7 +108,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
...
@@ -108,7 +108,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
de
=
(
struct
iso_directory_record
*
)
(
bh
->
b_data
+
offset
);
de
=
(
struct
iso_directory_record
*
)
(
bh
->
b_data
+
offset
);
de_len
=
*
(
unsigned
char
*
)
de
;
de_len
=
*
(
unsigned
char
*
)
de
;
/*
/*
* If the length byte is zero, we should move on to the next
* If the length byte is zero, we should move on to the next
...
@@ -119,8 +119,8 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
...
@@ -119,8 +119,8 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
if
(
de_len
==
0
)
{
if
(
de_len
==
0
)
{
brelse
(
bh
);
brelse
(
bh
);
bh
=
NULL
;
bh
=
NULL
;
filp
->
f_pos
=
(
filp
->
f_
pos
+
ISOFS_BLOCK_SIZE
)
&
~
(
ISOFS_BLOCK_SIZE
-
1
);
ctx
->
pos
=
(
ctx
->
pos
+
ISOFS_BLOCK_SIZE
)
&
~
(
ISOFS_BLOCK_SIZE
-
1
);
block
=
filp
->
f_
pos
>>
bufbits
;
block
=
ctx
->
pos
>>
bufbits
;
offset
=
0
;
offset
=
0
;
continue
;
continue
;
}
}
...
@@ -164,16 +164,16 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
...
@@ -164,16 +164,16 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
if
(
de
->
flags
[
-
sbi
->
s_high_sierra
]
&
0x80
)
{
if
(
de
->
flags
[
-
sbi
->
s_high_sierra
]
&
0x80
)
{
first_de
=
0
;
first_de
=
0
;
filp
->
f_
pos
+=
de_len
;
ctx
->
pos
+=
de_len
;
continue
;
continue
;
}
}
first_de
=
1
;
first_de
=
1
;
/* Handle the case of the '.' directory */
/* Handle the case of the '.' directory */
if
(
de
->
name_len
[
0
]
==
1
&&
de
->
name
[
0
]
==
0
)
{
if
(
de
->
name_len
[
0
]
==
1
&&
de
->
name
[
0
]
==
0
)
{
if
(
filldir
(
dirent
,
"."
,
1
,
filp
->
f_pos
,
inode
->
i_ino
,
DT_DIR
)
<
0
)
if
(
!
dir_emit_dot
(
file
,
ctx
)
)
break
;
break
;
filp
->
f_
pos
+=
de_len
;
ctx
->
pos
+=
de_len
;
continue
;
continue
;
}
}
...
@@ -181,10 +181,9 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
...
@@ -181,10 +181,9 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
/* Handle the case of the '..' directory */
/* Handle the case of the '..' directory */
if
(
de
->
name_len
[
0
]
==
1
&&
de
->
name
[
0
]
==
1
)
{
if
(
de
->
name_len
[
0
]
==
1
&&
de
->
name
[
0
]
==
1
)
{
inode_number
=
parent_ino
(
filp
->
f_path
.
dentry
);
if
(
!
dir_emit_dotdot
(
file
,
ctx
))
if
(
filldir
(
dirent
,
".."
,
2
,
filp
->
f_pos
,
inode_number
,
DT_DIR
)
<
0
)
break
;
break
;
filp
->
f_
pos
+=
de_len
;
ctx
->
pos
+=
de_len
;
continue
;
continue
;
}
}
...
@@ -198,7 +197,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
...
@@ -198,7 +197,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
if
((
sbi
->
s_hide
&&
(
de
->
flags
[
-
sbi
->
s_high_sierra
]
&
1
))
||
if
((
sbi
->
s_hide
&&
(
de
->
flags
[
-
sbi
->
s_high_sierra
]
&
1
))
||
(
!
sbi
->
s_showassoc
&&
(
!
sbi
->
s_showassoc
&&
(
de
->
flags
[
-
sbi
->
s_high_sierra
]
&
4
)))
{
(
de
->
flags
[
-
sbi
->
s_high_sierra
]
&
4
)))
{
filp
->
f_
pos
+=
de_len
;
ctx
->
pos
+=
de_len
;
continue
;
continue
;
}
}
...
@@ -230,10 +229,10 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
...
@@ -230,10 +229,10 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
}
}
}
}
if
(
len
>
0
)
{
if
(
len
>
0
)
{
if
(
filldir
(
dirent
,
p
,
len
,
filp
->
f_pos
,
inode_number
,
DT_UNKNOWN
)
<
0
)
if
(
!
dir_emit
(
ctx
,
p
,
len
,
inode_number
,
DT_UNKNOWN
)
)
break
;
break
;
}
}
filp
->
f_
pos
+=
de_len
;
ctx
->
pos
+=
de_len
;
continue
;
continue
;
}
}
...
@@ -247,13 +246,12 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
...
@@ -247,13 +246,12 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
* handling split directory entries.. The real work is done by
* handling split directory entries.. The real work is done by
* "do_isofs_readdir()".
* "do_isofs_readdir()".
*/
*/
static
int
isofs_readdir
(
struct
file
*
filp
,
static
int
isofs_readdir
(
struct
file
*
file
,
struct
dir_context
*
ctx
)
void
*
dirent
,
filldir_t
filldir
)
{
{
int
result
;
int
result
;
char
*
tmpname
;
char
*
tmpname
;
struct
iso_directory_record
*
tmpde
;
struct
iso_directory_record
*
tmpde
;
struct
inode
*
inode
=
file_inode
(
fil
p
);
struct
inode
*
inode
=
file_inode
(
fil
e
);
tmpname
=
(
char
*
)
__get_free_page
(
GFP_KERNEL
);
tmpname
=
(
char
*
)
__get_free_page
(
GFP_KERNEL
);
if
(
tmpname
==
NULL
)
if
(
tmpname
==
NULL
)
...
@@ -261,7 +259,7 @@ static int isofs_readdir(struct file *filp,
...
@@ -261,7 +259,7 @@ static int isofs_readdir(struct file *filp,
tmpde
=
(
struct
iso_directory_record
*
)
(
tmpname
+
1024
);
tmpde
=
(
struct
iso_directory_record
*
)
(
tmpname
+
1024
);
result
=
do_isofs_readdir
(
inode
,
fil
p
,
dirent
,
filldir
,
tmpname
,
tmpde
);
result
=
do_isofs_readdir
(
inode
,
fil
e
,
ctx
,
tmpname
,
tmpde
);
free_page
((
unsigned
long
)
tmpname
);
free_page
((
unsigned
long
)
tmpname
);
return
result
;
return
result
;
...
@@ -271,7 +269,7 @@ const struct file_operations isofs_dir_operations =
...
@@ -271,7 +269,7 @@ const struct file_operations isofs_dir_operations =
{
{
.
llseek
=
generic_file_llseek
,
.
llseek
=
generic_file_llseek
,
.
read
=
generic_read_dir
,
.
read
=
generic_read_dir
,
.
readdir
=
isofs_readdir
,
.
iterate
=
isofs_readdir
,
};
};
/*
/*
...
...
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