CVS: intermezzo/fs24 cache.c,1.20,1.21 dcache.c,1.33,1.34 dir.c,1.81,1.82 fileset.c,1.17,1.18 psdev.c,1.48,1.49 replicator.c,1.19,1.20 super.c,1.41,1.42
Chen Yang <[email protected]> Tue, 30 Sep 2003 08:51:54 -0700
| Newsgroups | gmane.comp.file-systems.intermezzo.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/intermezzo/intermezzo/fs24 In directory sc8-pr-cvs1:/tmp/cvs-serv25410/intermezzo/fs24 Modified Files: cache.c dcache.c dir.c fileset.c psdev.c replicator.c super.c Log Message: Applied and tested Domen Puncer's patch to fs25/fs24 part code for list related processing Applied and tested Renaud Duhaut([email protected])'s patch to solve fs24's InterMezzo's SLAB allocator leakage problem, on 2.4 kernel, now it can insmod and run, then rmmod. Insmod again won't cause Oops any more. :-) Index: cache.c =================================================================== RCS file: /cvsroot/intermezzo/intermezzo/fs24/cache.c,v retrieving revision 1.20 retrieving revision 1.21 diff -U2 -r1.20 -r1.21 --- cache.c 4 Apr 2002 04:54:37 -0000 1.20 +++ cache.c 30 Sep 2003 15:51:52 -0000 1.21 @@ -156,4 +156,7 @@ } + if (cache->cache_type) + PRESTO_FREE(cache->cache_type, strlen(cache->cache_type) + 1 ); + PRESTO_FREE(cache, sizeof(struct presto_cache)); } Index: dcache.c =================================================================== RCS file: /cvsroot/intermezzo/intermezzo/fs24/dcache.c,v retrieving revision 1.33 retrieving revision 1.34 diff -U2 -r1.33 -r1.34 --- dcache.c 23 Oct 2002 12:44:37 -0000 1.33 +++ dcache.c 30 Sep 2003 15:51:52 -0000 1.34 @@ -325,4 +325,9 @@ dentry->d_fsdata); unlock_kernel(); + + filter_setup_dentry_ops(fset->fset_cache->cache_filter, + dentry->d_op, &presto_dentry_ops); + dentry->d_op = filter_c2udops(fset->fset_cache->cache_filter); + return error; } Index: dir.c =================================================================== RCS file: /cvsroot/intermezzo/intermezzo/fs24/dir.c,v retrieving revision 1.81 retrieving revision 1.82 diff -U2 -r1.81 -r1.82 --- dir.c 23 Sep 2002 22:10:06 -0000 1.81 +++ dir.c 30 Sep 2003 15:51:52 -0000 1.82 @@ -301,8 +301,5 @@ if (dentry->d_inode) presto_set_ops(dentry->d_inode, cache->cache_filter); - - filter_setup_dentry_ops(cache->cache_filter, - dentry->d_op, &presto_dentry_ops); - dentry->d_op = filter_c2udops(cache->cache_filter); + /* dentry->d_op is now hooked in dcache.c:presto_set_dd */ /* In lookup we will tolerate EROFS return codes from presto_set_dd Index: fileset.c =================================================================== RCS file: /cvsroot/intermezzo/intermezzo/fs24/fileset.c,v retrieving revision 1.17 retrieving revision 1.18 diff -U2 -r1.17 -r1.18 --- fileset.c 3 Oct 2002 03:50:49 -0000 1.17 +++ fileset.c 30 Sep 2003 15:51:52 -0000 1.18 @@ -160,5 +160,5 @@ } - PRESTO_FREE(path, strlen(path)); + PRESTO_FREE(path, strlen(path)+1); EXIT; @@ -260,4 +260,5 @@ goto out_free; } + presto_d2d(dentry)->dd_fset = fset; list_add(&fset->fset_list, &cache->cache_fset_list); @@ -344,4 +345,5 @@ mntput(fset->fset_mnt); + izo_rep_cache_clean(fset); PRESTO_FREE(fset->fset_name, strlen(fset->fset_name) + 1); PRESTO_FREE(fset->fset_reint_buf, 64 * 1024); Index: psdev.c =================================================================== RCS file: /cvsroot/intermezzo/intermezzo/fs24/psdev.c,v retrieving revision 1.48 retrieving revision 1.49 diff -U2 -r1.48 -r1.49 --- psdev.c 23 Sep 2002 22:10:06 -0000 1.48 +++ psdev.c 30 Sep 2003 15:51:52 -0000 1.49 @@ -103,6 +103,5 @@ struct upc_req *req; CERROR("WARNING: setpid & processing not empty!\n"); - lh = &channel->uc_processing; - while ( (lh = lh->next) != &channel->uc_processing) { + list_for_each(lh, &channel->uc_processing) { req = list_entry(lh, struct upc_req, rq_chain); /* freeing of req and data is done by the sleeper */ @@ -209,6 +208,5 @@ spin_lock(&channel->uc_lock); /* Look for the message on the processing queue. */ - lh = &channel->uc_processing; - while ( (lh = lh->next) != &channel->uc_processing ) { + list_for_each(lh, &channel->uc_processing) { tmp = list_entry(lh, struct upc_req , rq_chain); if (tmp->rq_unique == hdr.unique) { @@ -341,6 +339,5 @@ CDEBUG(D_PSDEV, "Wake up clients sleeping for pending.\n"); spin_lock(&channel->uc_lock); - lh = &channel->uc_pending; - while ( (lh = lh->next) != &channel->uc_pending) { + list_for_each(lh, &channel->uc_pending) { req = list_entry(lh, struct upc_req, rq_chain); @@ -355,6 +352,5 @@ CDEBUG(D_PSDEV, "Wake up clients sleeping for processing\n"); - lh = &channel->uc_processing; - while ( (lh = lh->next) != &channel->uc_processing) { + list_for_each(lh, &channel->uc_processing) { req = list_entry(lh, struct upc_req, rq_chain); /* freeing of req and data is done by the sleeper */ @@ -422,5 +418,5 @@ for ( i = 0 ; i < MAX_CHANNEL ; i++ ) { struct upc_channel *channel = &(izo_channels[i]); - struct list_head *lh; + struct list_head *lh, *next; spin_lock(&channel->uc_lock); @@ -434,10 +430,8 @@ CERROR("Weird, tell Peter: module cleanup and cache listnot empty dev %d\n", i); } - lh = channel->uc_pending.next; - while ( lh != &channel->uc_pending) { + list_for_each_safe(lh, next, &channel->uc_pending) { struct upc_req *req; req = list_entry(lh, struct upc_req, rq_chain); - lh = lh->next; if ( req->rq_flags & REQ_ASYNC ) { list_del(&(req->rq_chain)); @@ -451,6 +445,5 @@ } } - lh = &channel->uc_processing; - while ( (lh = lh->next) != &channel->uc_processing ) { + list_for_each(lh, &channel->uc_processing) { struct upc_req *req; req = list_entry(lh, struct upc_req, rq_chain); Index: replicator.c =================================================================== RCS file: /cvsroot/intermezzo/intermezzo/fs24/replicator.c,v retrieving revision 1.19 retrieving revision 1.20 diff -U2 -r1.19 -r1.20 --- replicator.c 30 Apr 2002 02:17:49 -0000 1.19 +++ replicator.c 30 Sep 2003 15:51:52 -0000 1.20 @@ -71,5 +71,5 @@ } -static void +void izo_rep_cache_clean(struct presto_file_set *fset) { @@ -81,16 +81,14 @@ return; for (i = 0; i < RCACHE_SIZE; i++) { - tmp = bucket = &fset->fset_clients[i]; - tmp = tmp->next; - while (tmp != bucket) { - struct izo_offset_rec *offrec; - tmp = tmp->next; - list_del(tmp); - offrec = list_entry(tmp, struct izo_offset_rec, - or_list); - PRESTO_FREE(offrec, sizeof(struct izo_offset_rec)); + list_for_each_safe(tmp,bucket,&fset->fset_clients[i]) + { + struct izo_offset_rec *offrec; + list_del(tmp); + offrec = list_entry(tmp, struct izo_offset_rec,or_list); + PRESTO_FREE(offrec, sizeof(struct izo_offset_rec)); + } } - } + PRESTO_FREE(fset->fset_clients,sizeof(struct list_head) * RCACHE_SIZE); } @@ -98,9 +96,8 @@ izo_rep_cache_find(struct presto_file_set *fset, char *uuid) { - struct list_head *buck = izo_rep_hash(fset->fset_clients, uuid); - struct list_head *tmp = buck; + struct list_head *tmp, *buck = izo_rep_hash(fset->fset_clients, uuid); struct izo_offset_rec *rec = NULL; - while ( (tmp = tmp->next) != buck ) { + list_for_each(tmp, buck) { rec = list_entry(tmp, struct izo_offset_rec, or_list); if ( memcmp(rec->or_uuid, uuid, sizeof(rec->or_uuid)) == 0 ) Index: super.c =================================================================== RCS file: /cvsroot/intermezzo/intermezzo/fs24/super.c,v retrieving revision 1.41 retrieving revision 1.42 diff -U2 -r1.41 -r1.42 --- super.c 3 Oct 2002 03:50:49 -0000 1.41 +++ super.c 30 Sep 2003 15:51:52 -0000 1.42 @@ -173,4 +173,5 @@ } else { minor = simple_strtoul(channel, NULL, 0); + PRESTO_FREE(channel, strlen(channel) + 1); } if (minor < 0 || minor >= MAX_CHANNEL) { @@ -287,4 +288,7 @@ presto_cache_add(cache, sb->s_dev); err = izo_prepare_fileset(sb->s_root, fileset); + + if (fileset) + PRESTO_FREE(fileset, strlen(fileset) + 1); filter_setup_journal_ops(cache->cache_filter, cache->cache_type); ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf