From: wangdi Date: Mon, 19 Jan 2004 07:44:38 +0000 (+0000) Subject: some minor fix in delete snapshot X-Git-Tag: v1_7_100~2750 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=4d3e4bf7484ce05e33064fd7becdd42292ded82e;p=fs%2Flustre-release.git some minor fix in delete snapshot --- diff --git a/lustre/snapfs/snaptable.c b/lustre/snapfs/snaptable.c index 5788524..0af46c3 100644 --- a/lustre/snapfs/snaptable.c +++ b/lustre/snapfs/snaptable.c @@ -306,7 +306,7 @@ static int delete_inode(struct inode *primary, void *param) my_table[slot - delete_slot] = table->snap_items[slot].index; } next_ind = snap_get_indirect - (primary, my_table, table->tbl_count - delete_slot ); + (primary, my_table, table->tbl_count - delete_slot ); if (next_ind && (next_ind->i_ino == primary->i_ino)) { iput(next_ind); next_ind = NULL; @@ -719,8 +719,7 @@ int snap_get_index_from_name(int tableno, char *name) table = &snap_tables[tableno]; for ( slot = 0 ; slot < SNAP_MAX ; slot++ ) { - if(strncmp (&table->snap_items[slot].name[0], name, - SNAP_MAX_NAMELEN) == 0 ) { + if (!strcmp(&table->snap_items[slot].name[0], name)) { return table->snap_items[slot].index; } } @@ -754,7 +753,7 @@ int snap_iterate_func( struct ioc_snap_tbl_data *data, unsigned int cmd) sb = cache->cache_sb; table = &snap_tables[tableno]; - index = get_index_of_item(table, data->snaps[0].name); + index = snap_get_index_from_name(tableno, data->snaps[0].name); if (index < 0) RETURN(-EINVAL);