struct item_head * p_le_ih = PATH_PITEM_HEAD(p_s_path);
struct buffer_head * p_s_bh = PATH_PLAST_BUFFER(p_s_path);
- BUG_ON (!th->t_trans_id);
-
/* Stat_data item. */
if ( is_statdata_le_ih (p_le_ih) ) {
struct path * p_s_path,
int n_size
) {
-
- BUG_ON (!th->t_trans_id);
-
memset (p_s_tb,'\0',sizeof(struct tree_balance));
p_s_tb->transaction_handle = th ;
p_s_tb->tb_sb = p_s_sb;
int n_iter = 0;
#endif
- BUG_ON (!th->t_trans_id);
-
init_tb_struct(th, &s_del_balance, p_s_sb, p_s_path, 0/*size is unknown*/);
while ( 1 ) {
struct cpu_key cpu_key;
int retval;
int quota_cut_bytes = 0;
-
- BUG_ON (!th->t_trans_id);
le_key2cpu_key (&cpu_key, key);
}
-int reiserfs_delete_object (struct reiserfs_transaction_handle *th, struct inode * inode)
+void reiserfs_delete_object (struct reiserfs_transaction_handle *th, struct inode * inode)
{
- int err;
inode->i_size = 0;
- BUG_ON (!th->t_trans_id);
/* for directory this deletes item containing "." and ".." */
- err = reiserfs_do_truncate (th, inode, NULL, 0/*no timestamp updates*/);
- if (err)
- return err;
+ reiserfs_do_truncate (th, inode, NULL, 0/*no timestamp updates*/);
#if defined( USE_INODE_GENERATION_COUNTER )
if( !old_format_only ( th -> t_super ) )
/* USE_INODE_GENERATION_COUNTER */
#endif
reiserfs_delete_solid_item (th, inode, INODE_PKEY (inode));
-
- return err;
}
static void
struct super_block * p_s_sb = p_s_inode->i_sb;
int n_block_size = p_s_sb->s_blocksize;
int cut_bytes;
- BUG_ON (!th->t_trans_id);
if (n_new_file_size != p_s_inode->i_size)
BUG ();
struct cpu_key tail_key;
int tail_len;
int removed;
- BUG_ON (!th->t_trans_id);
make_cpu_key (&tail_key, inode, inode->i_size + 1, TYPE_DIRECT, 4);// !!!!
tail_key.key_length = 4;
int retval2 = -1;
int quota_cut_bytes;
loff_t tail_pos = 0;
-
- BUG_ON (!th->t_trans_id);
init_tb_struct(th, &s_cut_balance, p_s_inode->i_sb, p_s_path, n_cut_size);
static void truncate_directory (struct reiserfs_transaction_handle *th, struct inode * inode)
{
- BUG_ON (!th->t_trans_id);
if (inode->i_nlink)
reiserfs_warning (inode->i_sb,
"vs-5655: truncate_directory: link count != 0");
/* Truncate file to the new size. Note, this must be called with a transaction
already started */
-int reiserfs_do_truncate (struct reiserfs_transaction_handle *th,
+void reiserfs_do_truncate (struct reiserfs_transaction_handle *th,
struct inode * p_s_inode, /* ->i_size contains new
size */
struct page *page, /* up to date for last block */
n_new_file_size;/* New file size. */
int n_deleted; /* Number of deleted or truncated bytes. */
int retval;
- int err = 0;
- BUG_ON (!th->t_trans_id);
if ( ! (S_ISREG(p_s_inode->i_mode) || S_ISDIR(p_s_inode->i_mode) || S_ISLNK(p_s_inode->i_mode)) )
- return 0;
+ return;
if (S_ISDIR(p_s_inode->i_mode)) {
// deletion of directory - no need to update timestamps
truncate_directory (th, p_s_inode);
- return 0;
+ return;
}
/* Get new file size. */
if (retval == IO_ERROR) {
reiserfs_warning (p_s_inode->i_sb, "vs-5657: reiserfs_do_truncate: "
"i/o failure occurred trying to truncate %K", &s_item_key);
- err = -EIO;
- goto out;
+ return;
}
if (retval == POSITION_FOUND || retval == FILE_NOT_FOUND) {
+ pathrelse (&s_search_path);
reiserfs_warning (p_s_inode->i_sb, "PAP-5660: reiserfs_do_truncate: "
"wrong result %d of search for %K", retval, &s_item_key);
-
- err = -EIO;
- goto out;
+ return;
}
s_search_path.pos_in_item --;
if (n_deleted < 0) {
reiserfs_warning (p_s_inode->i_sb, "vs-5665: reiserfs_do_truncate: reiserfs_cut_from_item failed");
reiserfs_check_path(&s_search_path) ;
- return 0;
+ return;
}
RFALSE( n_deleted > n_file_size,
}
reiserfs_update_sd(th, p_s_inode) ;
- err = journal_end(th, p_s_inode->i_sb, orig_len_alloc) ;
- if (err)
- goto out;
- err = journal_begin (th, p_s_inode->i_sb,
- JOURNAL_PER_BALANCE_CNT * 6);
- if (err)
- goto out;
+ journal_end(th, p_s_inode->i_sb, orig_len_alloc) ;
+ journal_begin(th, p_s_inode->i_sb, JOURNAL_PER_BALANCE_CNT * 6) ;
reiserfs_update_inode_transaction(p_s_inode) ;
}
} while ( n_file_size > ROUND_UP (n_new_file_size) &&
}
reiserfs_update_sd (th, p_s_inode);
-out:
pathrelse(&s_search_path) ;
- return err;
}
int retval;
int fs_gen;
- BUG_ON (!th->t_trans_id);
-
fs_gen = get_generation(inode->i_sb) ;
#ifdef REISERQUOTA_DEBUG
int fs_gen = 0 ;
int quota_bytes = 0 ;
- BUG_ON (!th->t_trans_id);
-
if (inode) { /* Do we count quotas for item? */
fs_gen = get_generation(inode->i_sb);
quota_bytes = ih_item_len(p_s_ih);