catalog.c (4ba24fef3eb3b142197135223b90ced2f319cd53) catalog.c (2c35dea279351f2ad74a99126b29f9f5394ccc04)
1/*
2 * linux/fs/hfs/catalog.c
3 *
4 * Copyright (C) 1995-1997 Paul H. Hargrove
5 * (C) 2003 Ardis Technologies <roman@ardistech.com>
6 * This file may be distributed under the terms of the GNU General Public License.
7 *
8 * This file contains the functions related to the catalog B-tree.

--- 200 unchanged lines hidden (view full) ---

209 *
210 * Delete the indicated file or directory.
211 * The associated thread is also removed unless ('with_thread'==0).
212 */
213int hfs_cat_delete(u32 cnid, struct inode *dir, struct qstr *str)
214{
215 struct super_block *sb;
216 struct hfs_find_data fd;
1/*
2 * linux/fs/hfs/catalog.c
3 *
4 * Copyright (C) 1995-1997 Paul H. Hargrove
5 * (C) 2003 Ardis Technologies <roman@ardistech.com>
6 * This file may be distributed under the terms of the GNU General Public License.
7 *
8 * This file contains the functions related to the catalog B-tree.

--- 200 unchanged lines hidden (view full) ---

209 *
210 * Delete the indicated file or directory.
211 * The associated thread is also removed unless ('with_thread'==0).
212 */
213int hfs_cat_delete(u32 cnid, struct inode *dir, struct qstr *str)
214{
215 struct super_block *sb;
216 struct hfs_find_data fd;
217 struct list_head *pos;
217 struct hfs_readdir_data *rd;
218 int res, type;
219
220 hfs_dbg(CAT_MOD, "delete_cat: %s,%u\n", str ? str->name : NULL, cnid);
221 sb = dir->i_sb;
222 res = hfs_find_init(HFS_SB(sb)->cat_tree, &fd);
223 if (res)
224 return res;
225

--- 9 unchanged lines hidden (view full) ---

235 if (be32_to_cpu(file.FlNum) == cnid) {
236#if 0
237 hfs_free_fork(sb, &file, HFS_FK_DATA);
238#endif
239 hfs_free_fork(sb, &file, HFS_FK_RSRC);
240 }
241 }
242
218 int res, type;
219
220 hfs_dbg(CAT_MOD, "delete_cat: %s,%u\n", str ? str->name : NULL, cnid);
221 sb = dir->i_sb;
222 res = hfs_find_init(HFS_SB(sb)->cat_tree, &fd);
223 if (res)
224 return res;
225

--- 9 unchanged lines hidden (view full) ---

235 if (be32_to_cpu(file.FlNum) == cnid) {
236#if 0
237 hfs_free_fork(sb, &file, HFS_FK_DATA);
238#endif
239 hfs_free_fork(sb, &file, HFS_FK_RSRC);
240 }
241 }
242
243 list_for_each(pos, &HFS_I(dir)->open_dir_list) {
244 struct hfs_readdir_data *rd =
245 list_entry(pos, struct hfs_readdir_data, list);
243 list_for_each_entry(rd, &HFS_I(dir)->open_dir_list, list) {
246 if (fd.tree->keycmp(fd.search_key, (void *)&rd->key) < 0)
247 rd->file->f_pos--;
248 }
249
250 res = hfs_brec_remove(&fd);
251 if (res)
252 goto out;
253

--- 113 unchanged lines hidden ---
244 if (fd.tree->keycmp(fd.search_key, (void *)&rd->key) < 0)
245 rd->file->f_pos--;
246 }
247
248 res = hfs_brec_remove(&fd);
249 if (res)
250 goto out;
251

--- 113 unchanged lines hidden ---