mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-03-02 17:37:04 +00:00
coda: cleanup downcall handler
Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
ed36f72367
commit
5fd31e9a67
107
fs/coda/upcall.c
107
fs/coda/upcall.c
@ -859,77 +859,66 @@ exit:
|
|||||||
|
|
||||||
int coda_downcall(int opcode, union outputArgs * out, struct super_block *sb)
|
int coda_downcall(int opcode, union outputArgs * out, struct super_block *sb)
|
||||||
{
|
{
|
||||||
|
struct inode *inode = NULL;
|
||||||
|
struct CodaFid *fid, *newfid;
|
||||||
|
|
||||||
/* Handle invalidation requests. */
|
/* Handle invalidation requests. */
|
||||||
if ( !sb || !sb->s_root || !sb->s_root->d_inode)
|
if ( !sb || !sb->s_root)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
|
case CODA_FLUSH:
|
||||||
|
coda_cache_clear_all(sb);
|
||||||
|
shrink_dcache_sb(sb);
|
||||||
|
if (sb->s_root->d_inode)
|
||||||
|
coda_flag_inode(sb->s_root->d_inode, C_FLUSH);
|
||||||
|
break;
|
||||||
|
|
||||||
case CODA_FLUSH : {
|
case CODA_PURGEUSER:
|
||||||
coda_cache_clear_all(sb);
|
coda_cache_clear_all(sb);
|
||||||
shrink_dcache_sb(sb);
|
break;
|
||||||
coda_flag_inode(sb->s_root->d_inode, C_FLUSH);
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
case CODA_PURGEUSER : {
|
case CODA_ZAPDIR:
|
||||||
coda_cache_clear_all(sb);
|
fid = &out->coda_zapdir.CodaFid;
|
||||||
return(0);
|
inode = coda_fid_to_inode(fid, sb);
|
||||||
}
|
if (inode) {
|
||||||
|
coda_flag_inode_children(inode, C_PURGE);
|
||||||
|
coda_flag_inode(inode, C_VATTR);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case CODA_ZAPDIR : {
|
case CODA_ZAPFILE:
|
||||||
struct inode *inode;
|
fid = &out->coda_zapfile.CodaFid;
|
||||||
struct CodaFid *fid = &out->coda_zapdir.CodaFid;
|
inode = coda_fid_to_inode(fid, sb);
|
||||||
|
if (inode)
|
||||||
|
coda_flag_inode(inode, C_VATTR);
|
||||||
|
break;
|
||||||
|
|
||||||
inode = coda_fid_to_inode(fid, sb);
|
case CODA_PURGEFID:
|
||||||
if (inode) {
|
fid = &out->coda_purgefid.CodaFid;
|
||||||
coda_flag_inode_children(inode, C_PURGE);
|
inode = coda_fid_to_inode(fid, sb);
|
||||||
coda_flag_inode(inode, C_VATTR);
|
if (inode) {
|
||||||
iput(inode);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
case CODA_ZAPFILE : {
|
|
||||||
struct inode *inode;
|
|
||||||
struct CodaFid *fid = &out->coda_zapfile.CodaFid;
|
|
||||||
inode = coda_fid_to_inode(fid, sb);
|
|
||||||
if ( inode ) {
|
|
||||||
coda_flag_inode(inode, C_VATTR);
|
|
||||||
iput(inode);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
case CODA_PURGEFID : {
|
|
||||||
struct inode *inode;
|
|
||||||
struct CodaFid *fid = &out->coda_purgefid.CodaFid;
|
|
||||||
inode = coda_fid_to_inode(fid, sb);
|
|
||||||
if ( inode ) {
|
|
||||||
coda_flag_inode_children(inode, C_PURGE);
|
coda_flag_inode_children(inode, C_PURGE);
|
||||||
|
|
||||||
/* catch the dentries later if some are still busy */
|
/* catch the dentries later if some are still busy */
|
||||||
coda_flag_inode(inode, C_PURGE);
|
coda_flag_inode(inode, C_PURGE);
|
||||||
d_prune_aliases(inode);
|
d_prune_aliases(inode);
|
||||||
|
|
||||||
iput(inode);
|
}
|
||||||
}
|
break;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
case CODA_REPLACE : {
|
case CODA_REPLACE:
|
||||||
struct inode *inode;
|
fid = &out->coda_replace.OldFid;
|
||||||
struct CodaFid *oldfid = &out->coda_replace.OldFid;
|
newfid = &out->coda_replace.NewFid;
|
||||||
struct CodaFid *newfid = &out->coda_replace.NewFid;
|
inode = coda_fid_to_inode(fid, sb);
|
||||||
inode = coda_fid_to_inode(oldfid, sb);
|
if (inode)
|
||||||
if ( inode ) {
|
coda_replace_fid(inode, fid, newfid);
|
||||||
coda_replace_fid(inode, oldfid, newfid);
|
break;
|
||||||
iput(inode);
|
}
|
||||||
}
|
|
||||||
return 0;
|
if (inode)
|
||||||
}
|
iput(inode);
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user