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
f4947fbc
Commit
f4947fbc
authored
Jan 10, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coda: switch coda_cnode_make() to sane API as well, clean coda_lookup()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
0b2c4e39
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
31 deletions
+27
-31
fs/coda/cnode.c
fs/coda/cnode.c
+7
-10
fs/coda/coda_fs_i.h
fs/coda/coda_fs_i.h
+1
-1
fs/coda/dir.c
fs/coda/dir.c
+13
-16
fs/coda/inode.c
fs/coda/inode.c
+6
-4
No files found.
fs/coda/cnode.c
View file @
f4947fbc
...
@@ -88,24 +88,21 @@ struct inode * coda_iget(struct super_block * sb, struct CodaFid * fid,
...
@@ -88,24 +88,21 @@ struct inode * coda_iget(struct super_block * sb, struct CodaFid * fid,
- link the two up if this is needed
- link the two up if this is needed
- fill in the attributes
- fill in the attributes
*/
*/
int
coda_cnode_make
(
struct
inode
**
inode
,
struct
CodaFid
*
fid
,
struct
super_block
*
sb
)
struct
inode
*
coda_cnode_make
(
struct
CodaFid
*
fid
,
struct
super_block
*
sb
)
{
{
struct
coda_vattr
attr
;
struct
coda_vattr
attr
;
struct
inode
*
inode
;
int
error
;
int
error
;
/* We get inode numbers from Venus -- see venus source */
/* We get inode numbers from Venus -- see venus source */
error
=
venus_getattr
(
sb
,
fid
,
&
attr
);
error
=
venus_getattr
(
sb
,
fid
,
&
attr
);
if
(
error
)
{
if
(
error
)
*
inode
=
NULL
;
return
ERR_PTR
(
error
);
return
error
;
}
*
inode
=
coda_iget
(
sb
,
fid
,
&
attr
);
inode
=
coda_iget
(
sb
,
fid
,
&
attr
);
if
(
IS_ERR
(
*
inode
)
)
{
if
(
IS_ERR
(
inode
))
printk
(
"coda_cnode_make: coda_iget failed
\n
"
);
printk
(
"coda_cnode_make: coda_iget failed
\n
"
);
return
PTR_ERR
(
*
inode
);
return
inode
;
}
return
0
;
}
}
...
...
fs/coda/coda_fs_i.h
View file @
f4947fbc
...
@@ -49,7 +49,7 @@ struct coda_file_info {
...
@@ -49,7 +49,7 @@ struct coda_file_info {
#define C_DYING 0x4
/* from venus (which died) */
#define C_DYING 0x4
/* from venus (which died) */
#define C_PURGE 0x8
#define C_PURGE 0x8
int
coda_cnode_make
(
struct
inode
**
,
struct
CodaFid
*
,
struct
super_block
*
);
struct
inode
*
coda_cnode_make
(
struct
CodaFid
*
,
struct
super_block
*
);
struct
inode
*
coda_iget
(
struct
super_block
*
sb
,
struct
CodaFid
*
fid
,
struct
coda_vattr
*
attr
);
struct
inode
*
coda_iget
(
struct
super_block
*
sb
,
struct
CodaFid
*
fid
,
struct
coda_vattr
*
attr
);
struct
inode
*
coda_cnode_makectl
(
struct
super_block
*
sb
);
struct
inode
*
coda_cnode_makectl
(
struct
super_block
*
sb
);
struct
inode
*
coda_fid_to_inode
(
struct
CodaFid
*
fid
,
struct
super_block
*
sb
);
struct
inode
*
coda_fid_to_inode
(
struct
CodaFid
*
fid
,
struct
super_block
*
sb
);
...
...
fs/coda/dir.c
View file @
f4947fbc
...
@@ -96,12 +96,11 @@ const struct file_operations coda_dir_operations = {
...
@@ -96,12 +96,11 @@ const struct file_operations coda_dir_operations = {
/* access routines: lookup, readlink, permission */
/* access routines: lookup, readlink, permission */
static
struct
dentry
*
coda_lookup
(
struct
inode
*
dir
,
struct
dentry
*
entry
,
struct
nameidata
*
nd
)
static
struct
dentry
*
coda_lookup
(
struct
inode
*
dir
,
struct
dentry
*
entry
,
struct
nameidata
*
nd
)
{
{
struct
inode
*
inode
=
NULL
;
struct
super_block
*
sb
=
dir
->
i_sb
;
struct
CodaFid
resfid
=
{
{
0
,
}
};
int
type
=
0
;
int
error
=
0
;
const
char
*
name
=
entry
->
d_name
.
name
;
const
char
*
name
=
entry
->
d_name
.
name
;
size_t
length
=
entry
->
d_name
.
len
;
size_t
length
=
entry
->
d_name
.
len
;
struct
inode
*
inode
;
int
type
=
0
;
if
(
length
>
CODA_MAXNAMLEN
)
{
if
(
length
>
CODA_MAXNAMLEN
)
{
printk
(
KERN_ERR
"name too long: lookup, %s (%*s)
\n
"
,
printk
(
KERN_ERR
"name too long: lookup, %s (%*s)
\n
"
,
...
@@ -111,23 +110,21 @@ static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, struc
...
@@ -111,23 +110,21 @@ static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, struc
/* control object, create inode on the fly */
/* control object, create inode on the fly */
if
(
coda_isroot
(
dir
)
&&
coda_iscontrol
(
name
,
length
))
{
if
(
coda_isroot
(
dir
)
&&
coda_iscontrol
(
name
,
length
))
{
inode
=
coda_cnode_makectl
(
dir
->
i_
sb
);
inode
=
coda_cnode_makectl
(
sb
);
type
=
CODA_NOCACHE
;
type
=
CODA_NOCACHE
;
goto
exit
;
}
else
{
struct
CodaFid
fid
=
{
{
0
,
}
};
int
error
=
venus_lookup
(
sb
,
coda_i2f
(
dir
),
name
,
length
,
&
type
,
&
fid
);
inode
=
!
error
?
coda_cnode_make
(
&
fid
,
sb
)
:
ERR_PTR
(
error
);
}
}
error
=
venus_lookup
(
dir
->
i_sb
,
coda_i2f
(
dir
),
name
,
length
,
if
(
!
IS_ERR
(
inode
)
&&
(
type
&
CODA_NOCACHE
))
&
type
,
&
resfid
);
if
(
!
error
)
error
=
coda_cnode_make
(
&
inode
,
&
resfid
,
dir
->
i_sb
);
if
(
error
&&
error
!=
-
ENOENT
)
return
ERR_PTR
(
error
);
exit:
if
(
inode
&&
!
IS_ERR
(
inode
)
&&
(
type
&
CODA_NOCACHE
))
coda_flag_inode
(
inode
,
C_VATTR
|
C_PURGE
);
coda_flag_inode
(
inode
,
C_VATTR
|
C_PURGE
);
if
(
inode
==
ERR_PTR
(
-
ENOENT
))
inode
=
NULL
;
return
d_splice_alias
(
inode
,
entry
);
return
d_splice_alias
(
inode
,
entry
);
}
}
...
...
fs/coda/inode.c
View file @
f4947fbc
...
@@ -204,9 +204,11 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
...
@@ -204,9 +204,11 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
printk
(
"coda_read_super: rootfid is %s
\n
"
,
coda_f2s
(
&
fid
));
printk
(
"coda_read_super: rootfid is %s
\n
"
,
coda_f2s
(
&
fid
));
/* make root inode */
/* make root inode */
error
=
coda_cnode_make
(
&
root
,
&
fid
,
sb
);
root
=
coda_cnode_make
(
&
fid
,
sb
);
if
(
error
||
!
root
)
{
if
(
IS_ERR
(
root
))
{
error
=
PTR_ERR
(
root
);
printk
(
"Failure of coda_cnode_make for root: error %d
\n
"
,
error
);
printk
(
"Failure of coda_cnode_make for root: error %d
\n
"
,
error
);
root
=
NULL
;
goto
error
;
goto
error
;
}
}
...
...
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