@@ -240,8 +240,8 @@ static struct dentry *ubifs_lookup(struct inode *dir, struct dentry *dentry,
240240 }
241241
242242 if (nm .hash ) {
243- ubifs_assert (fname_len (& nm ) == 0 );
244- ubifs_assert (fname_name (& nm ) == NULL );
243+ ubifs_assert (c , fname_len (& nm ) == 0 );
244+ ubifs_assert (c , fname_name (& nm ) == NULL );
245245 dent_key_init_hash (c , & key , dir -> i_ino , nm .hash );
246246 err = ubifs_tnc_lookup_dh (c , & key , dent , nm .minor_hash );
247247 } else {
@@ -404,7 +404,7 @@ static int do_tmpfile(struct inode *dir, struct dentry *dentry,
404404
405405 if (whiteout ) {
406406 init_special_inode (inode , inode -> i_mode , WHITEOUT_DEV );
407- ubifs_assert (inode -> i_op == & ubifs_file_inode_operations );
407+ ubifs_assert (c , inode -> i_op == & ubifs_file_inode_operations );
408408 }
409409
410410 err = ubifs_init_security (dir , inode , & dentry -> d_name );
@@ -421,7 +421,7 @@ static int do_tmpfile(struct inode *dir, struct dentry *dentry,
421421 } else {
422422 d_tmpfile (dentry , inode );
423423 }
424- ubifs_assert (ui -> dirty );
424+ ubifs_assert (c , ui -> dirty );
425425
426426 instantiated = 1 ;
427427 mutex_unlock (& ui -> ui_mutex );
@@ -556,7 +556,7 @@ static int ubifs_readdir(struct file *file, struct dir_context *ctx)
556556
557557 /* File positions 0 and 1 correspond to "." and ".." */
558558 if (ctx -> pos < 2 ) {
559- ubifs_assert (!file -> private_data );
559+ ubifs_assert (c , !file -> private_data );
560560 if (!dir_emit_dots (file , ctx )) {
561561 if (encrypted )
562562 fscrypt_fname_free_buffer (& fstr );
@@ -597,7 +597,7 @@ static int ubifs_readdir(struct file *file, struct dir_context *ctx)
597597 dbg_gen ("ino %llu, new f_pos %#x" ,
598598 (unsigned long long )le64_to_cpu (dent -> inum ),
599599 key_hash_flash (c , & dent -> key ));
600- ubifs_assert (le64_to_cpu (dent -> ch .sqnum ) >
600+ ubifs_assert (c , le64_to_cpu (dent -> ch .sqnum ) >
601601 ubifs_inode (dir )-> creat_sqnum );
602602
603603 fname_len (& nm ) = le16_to_cpu (dent -> nlen );
@@ -716,8 +716,8 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir,
716716 dbg_gen ("dent '%pd' to ino %lu (nlink %d) in dir ino %lu" ,
717717 dentry , inode -> i_ino ,
718718 inode -> i_nlink , dir -> i_ino );
719- ubifs_assert (inode_is_locked (dir ));
720- ubifs_assert (inode_is_locked (inode ));
719+ ubifs_assert (c , inode_is_locked (dir ));
720+ ubifs_assert (c , inode_is_locked (inode ));
721721
722722 err = fscrypt_prepare_link (old_dentry , dir , dentry );
723723 if (err )
@@ -804,8 +804,8 @@ static int ubifs_unlink(struct inode *dir, struct dentry *dentry)
804804
805805 sz_change = CALC_DENT_SIZE (fname_len (& nm ));
806806
807- ubifs_assert (inode_is_locked (dir ));
808- ubifs_assert (inode_is_locked (inode ));
807+ ubifs_assert (c , inode_is_locked (dir ));
808+ ubifs_assert (c , inode_is_locked (inode ));
809809 err = dbg_check_synced_i_size (c , inode );
810810 if (err )
811811 goto out_fname ;
@@ -896,8 +896,8 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry)
896896
897897 dbg_gen ("directory '%pd', ino %lu in dir ino %lu" , dentry ,
898898 inode -> i_ino , dir -> i_ino );
899- ubifs_assert (inode_is_locked (dir ));
900- ubifs_assert (inode_is_locked (inode ));
899+ ubifs_assert (c , inode_is_locked (dir ));
900+ ubifs_assert (c , inode_is_locked (inode ));
901901 err = ubifs_check_dir_empty (d_inode (dentry ));
902902 if (err )
903903 return err ;
@@ -1295,7 +1295,7 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry,
12951295 new_dentry , new_dir -> i_ino , flags );
12961296
12971297 if (unlink )
1298- ubifs_assert (inode_is_locked (new_inode ));
1298+ ubifs_assert (c , inode_is_locked (new_inode ));
12991299
13001300 if (unlink && is_dir ) {
13011301 err = ubifs_check_dir_empty (new_inode );
@@ -1349,7 +1349,7 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry,
13491349 whiteout_ui = ubifs_inode (whiteout );
13501350 whiteout_ui -> data = dev ;
13511351 whiteout_ui -> data_len = ubifs_encode_dev (dev , MKDEV (0 , 0 ));
1352- ubifs_assert (!whiteout_ui -> dirty );
1352+ ubifs_assert (c , !whiteout_ui -> dirty );
13531353 }
13541354
13551355 lock_4_inodes (old_dir , new_dir , new_inode , whiteout );
@@ -1509,7 +1509,7 @@ static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry,
15091509 int err ;
15101510 struct fscrypt_name fst_nm , snd_nm ;
15111511
1512- ubifs_assert (fst_inode && snd_inode );
1512+ ubifs_assert (c , fst_inode && snd_inode );
15131513
15141514 err = fscrypt_setup_filename (old_dir , & old_dentry -> d_name , 0 , & fst_nm );
15151515 if (err )
@@ -1556,12 +1556,13 @@ static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,
15561556 unsigned int flags )
15571557{
15581558 int err ;
1559+ struct ubifs_info * c = old_dir -> i_sb -> s_fs_info ;
15591560
15601561 if (flags & ~(RENAME_NOREPLACE | RENAME_WHITEOUT | RENAME_EXCHANGE ))
15611562 return - EINVAL ;
15621563
1563- ubifs_assert (inode_is_locked (old_dir ));
1564- ubifs_assert (inode_is_locked (new_dir ));
1564+ ubifs_assert (c , inode_is_locked (old_dir ));
1565+ ubifs_assert (c , inode_is_locked (new_dir ));
15651566
15661567 err = fscrypt_prepare_rename (old_dir , old_dentry , new_dir , new_dentry ,
15671568 flags );
0 commit comments