aboutsummaryrefslogtreecommitdiffstats
path: root/fs/coda
diff options
context:
space:
mode:
authorJan Harkes <jaharkes@cs.cmu.edu>2007-07-19 04:48:49 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:48 -0400
commit5fd31e9a67dd6c80e49240514cf854c1f054aca2 (patch)
tree85f123d5896d9fb983f60df90df1189d9993af0a /fs/coda
parented36f723676b208053d0655cee7e7f1601a2d356 (diff)
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>
Diffstat (limited to 'fs/coda')
-rw-r--r--fs/coda/upcall.c119
1 files changed, 54 insertions, 65 deletions
diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
index 097dbb2fd6f5..87601e147644 100644
--- a/fs/coda/upcall.c
+++ b/fs/coda/upcall.c
@@ -859,77 +859,66 @@ exit:
859 859
860int coda_downcall(int opcode, union outputArgs * out, struct super_block *sb) 860int coda_downcall(int opcode, union outputArgs * out, struct super_block *sb)
861{ 861{
862 struct inode *inode = NULL;
863 struct CodaFid *fid, *newfid;
864
862 /* Handle invalidation requests. */ 865 /* Handle invalidation requests. */
863 if ( !sb || !sb->s_root || !sb->s_root->d_inode) 866 if ( !sb || !sb->s_root)
864 return 0; 867 return 0;
865 868
866 switch (opcode) { 869 switch (opcode) {
867 870 case CODA_FLUSH:
868 case CODA_FLUSH : { 871 coda_cache_clear_all(sb);
869 coda_cache_clear_all(sb); 872 shrink_dcache_sb(sb);
870 shrink_dcache_sb(sb); 873 if (sb->s_root->d_inode)
871 coda_flag_inode(sb->s_root->d_inode, C_FLUSH); 874 coda_flag_inode(sb->s_root->d_inode, C_FLUSH);
872 return(0); 875 break;
873 } 876
874 877 case CODA_PURGEUSER:
875 case CODA_PURGEUSER : { 878 coda_cache_clear_all(sb);
876 coda_cache_clear_all(sb); 879 break;
877 return(0); 880
878 } 881 case CODA_ZAPDIR:
879 882 fid = &out->coda_zapdir.CodaFid;
880 case CODA_ZAPDIR : { 883 inode = coda_fid_to_inode(fid, sb);
881 struct inode *inode; 884 if (inode) {
882 struct CodaFid *fid = &out->coda_zapdir.CodaFid; 885 coda_flag_inode_children(inode, C_PURGE);
883 886 coda_flag_inode(inode, C_VATTR);
884 inode = coda_fid_to_inode(fid, sb); 887 }
885 if (inode) { 888 break;
886 coda_flag_inode_children(inode, C_PURGE); 889
887 coda_flag_inode(inode, C_VATTR); 890 case CODA_ZAPFILE:
888 iput(inode); 891 fid = &out->coda_zapfile.CodaFid;
889 } 892 inode = coda_fid_to_inode(fid, sb);
890 893 if (inode)
891 return(0); 894 coda_flag_inode(inode, C_VATTR);
892 } 895 break;
893 896
894 case CODA_ZAPFILE : { 897 case CODA_PURGEFID:
895 struct inode *inode; 898 fid = &out->coda_purgefid.CodaFid;
896 struct CodaFid *fid = &out->coda_zapfile.CodaFid; 899 inode = coda_fid_to_inode(fid, sb);
897 inode = coda_fid_to_inode(fid, sb); 900 if (inode) {
898 if ( inode ) {
899 coda_flag_inode(inode, C_VATTR);
900 iput(inode);
901 }
902 return 0;
903 }
904
905 case CODA_PURGEFID : {
906 struct inode *inode;
907 struct CodaFid *fid = &out->coda_purgefid.CodaFid;
908 inode = coda_fid_to_inode(fid, sb);
909 if ( inode ) {
910 coda_flag_inode_children(inode, C_PURGE); 901 coda_flag_inode_children(inode, C_PURGE);
911 902
912 /* catch the dentries later if some are still busy */ 903 /* catch the dentries later if some are still busy */
913 coda_flag_inode(inode, C_PURGE); 904 coda_flag_inode(inode, C_PURGE);
914 d_prune_aliases(inode); 905 d_prune_aliases(inode);
915 906
916 iput(inode); 907 }
917 } 908 break;
918 return 0; 909
919 } 910 case CODA_REPLACE:
920 911 fid = &out->coda_replace.OldFid;
921 case CODA_REPLACE : { 912 newfid = &out->coda_replace.NewFid;
922 struct inode *inode; 913 inode = coda_fid_to_inode(fid, sb);
923 struct CodaFid *oldfid = &out->coda_replace.OldFid; 914 if (inode)
924 struct CodaFid *newfid = &out->coda_replace.NewFid; 915 coda_replace_fid(inode, fid, newfid);
925 inode = coda_fid_to_inode(oldfid, sb); 916 break;
926 if ( inode ) { 917 }
927 coda_replace_fid(inode, oldfid, newfid); 918
928 iput(inode); 919 if (inode)
929 } 920 iput(inode);
930 return 0; 921
931 } 922 return 0;
932 }
933 return 0;
934} 923}
935 924