@@ -779,14 +779,13 @@ switch_to_data1_zone: search_zone = 2;
779779
780780/**
781781 * __ntfs_cluster_free - free clusters on an ntfs volume
782- * @vi : vfs inode whose runlist describes the clusters to free
783- * @start_vcn: vcn in the runlist of @vi at which to start freeing clusters
782+ * @ni : ntfs inode whose runlist describes the clusters to free
783+ * @start_vcn: vcn in the runlist of @ni at which to start freeing clusters
784784 * @count: number of clusters to free or -1 for all clusters
785- * @write_locked: true if the runlist is locked for writing
786785 * @is_rollback: true if this is a rollback operation
787786 *
788787 * Free @count clusters starting at the cluster @start_vcn in the runlist
789- * described by the vfs inode @vi .
788+ * described by the vfs inode @ni .
790789 *
791790 * If @count is -1, all clusters from @start_vcn to the end of the runlist are
792791 * deallocated. Thus, to completely free all clusters in a runlist, use
@@ -801,31 +800,28 @@ switch_to_data1_zone: search_zone = 2;
801800 * Return the number of deallocated clusters (not counting sparse ones) on
802801 * success and -errno on error.
803802 *
804- * Locking: - The runlist described by @vi must be locked on entry and is
805- * locked on return. Note if the runlist is locked for reading the
806- * lock may be dropped and reacquired. Note the runlist may be
807- * modified when needed runlist fragments need to be mapped.
803+ * Locking: - The runlist described by @ni must be locked for writing on entry
804+ * and is locked on return. Note the runlist may be modified when
805+ * needed runlist fragments need to be mapped.
808806 * - The volume lcn bitmap must be unlocked on entry and is unlocked
809807 * on return.
810808 * - This function takes the volume lcn bitmap lock for writing and
811809 * modifies the bitmap contents.
812810 */
813- s64 __ntfs_cluster_free (struct inode * vi , const VCN start_vcn , s64 count ,
814- const BOOL write_locked , const BOOL is_rollback )
811+ s64 __ntfs_cluster_free (ntfs_inode * ni , const VCN start_vcn , s64 count ,
812+ const BOOL is_rollback )
815813{
816814 s64 delta , to_free , total_freed , real_freed ;
817- ntfs_inode * ni ;
818815 ntfs_volume * vol ;
819816 struct inode * lcnbmp_vi ;
820817 runlist_element * rl ;
821818 int err ;
822819
823- BUG_ON (!vi );
820+ BUG_ON (!ni );
824821 ntfs_debug ("Entering for i_ino 0x%lx, start_vcn 0x%llx, count "
825- "0x%llx.%s" , vi -> i_ino , (unsigned long long )start_vcn ,
822+ "0x%llx.%s" , ni -> mft_no , (unsigned long long )start_vcn ,
826823 (unsigned long long )count ,
827824 is_rollback ? " (rollback)" : "" );
828- ni = NTFS_I (vi );
829825 vol = ni -> vol ;
830826 lcnbmp_vi = vol -> lcnbmp_ino ;
831827 BUG_ON (!lcnbmp_vi );
@@ -843,7 +839,7 @@ s64 __ntfs_cluster_free(struct inode *vi, const VCN start_vcn, s64 count,
843839
844840 total_freed = real_freed = 0 ;
845841
846- rl = ntfs_attr_find_vcn_nolock (ni , start_vcn , write_locked );
842+ rl = ntfs_attr_find_vcn_nolock (ni , start_vcn , TRUE );
847843 if (IS_ERR (rl )) {
848844 if (!is_rollback )
849845 ntfs_error (vol -> sb , "Failed to find first runlist "
@@ -897,7 +893,7 @@ s64 __ntfs_cluster_free(struct inode *vi, const VCN start_vcn, s64 count,
897893
898894 /* Attempt to map runlist. */
899895 vcn = rl -> vcn ;
900- rl = ntfs_attr_find_vcn_nolock (ni , vcn , write_locked );
896+ rl = ntfs_attr_find_vcn_nolock (ni , vcn , TRUE );
901897 if (IS_ERR (rl )) {
902898 err = PTR_ERR (rl );
903899 if (!is_rollback )
@@ -965,8 +961,7 @@ s64 __ntfs_cluster_free(struct inode *vi, const VCN start_vcn, s64 count,
965961 * If rollback fails, set the volume errors flag, emit an error
966962 * message, and return the error code.
967963 */
968- delta = __ntfs_cluster_free (vi , start_vcn , total_freed , write_locked ,
969- TRUE);
964+ delta = __ntfs_cluster_free (ni , start_vcn , total_freed , TRUE);
970965 if (delta < 0 ) {
971966 ntfs_error (vol -> sb , "Failed to rollback (error %i). Leaving "
972967 "inconsistent metadata! Unmount and run "
0 commit comments