• Home
  • Raw
  • Download

Lines Matching +full:multi +full:- +full:function

2  * mst.c - NTFS multi sector transfer protection handling code. Part of the
3 * Linux-NTFS project.
5 * Copyright (c) 2001-2004 Anton Altaparmakov
18 * along with this program (in the main directory of the Linux-NTFS
20 * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * post_read_mst_fixup - deprotect multi sector transfer protected data
30 * Perform the necessary post read multi sector transfer fixup and detect the
31 * presence of incomplete multi sector transfers. - In that case, overwrite the
35 * Return 0 on success and -EINVAL on error ("BAAD" magic will be present).
48 usa_ofs = le16_to_cpu(b->usa_ofs); in post_read_mst_fixup()
50 usa_count = le16_to_cpu(b->usa_count) - 1; in post_read_mst_fixup()
52 if ( size & (NTFS_BLOCK_SIZE - 1) || in post_read_mst_fixup()
63 * structures which means the data is consistent. - If it is in post_read_mst_fixup()
70 data_pos = (u16*)b + NTFS_BLOCK_SIZE/sizeof(u16) - 1; in post_read_mst_fixup()
72 * Check for incomplete multi sector transfer(s). in post_read_mst_fixup()
74 while (usa_count--) { in post_read_mst_fixup()
77 * Incomplete multi sector transfer detected! )-: in post_read_mst_fixup()
81 b->magic = magic_BAAD; in post_read_mst_fixup()
82 return -EINVAL; in post_read_mst_fixup()
86 /* Re-setup the variables. */ in post_read_mst_fixup()
87 usa_count = le16_to_cpu(b->usa_count) - 1; in post_read_mst_fixup()
88 data_pos = (u16*)b + NTFS_BLOCK_SIZE/sizeof(u16) - 1; in post_read_mst_fixup()
90 while (usa_count--) { in post_read_mst_fixup()
103 * pre_write_mst_fixup - apply multi sector transfer protection
107 * Perform the necessary pre write multi sector transfer fixup on the data
110 * Return 0 if fixup applied (success) or -EINVAL if no fixup was performed
116 * array header in the ntfs record before calling this function, otherwise it
119 * initialise the update sequence number before calling this function
130 if (!b || ntfs_is_baad_record(b->magic) || in pre_write_mst_fixup()
131 ntfs_is_hole_record(b->magic)) in pre_write_mst_fixup()
132 return -EINVAL; in pre_write_mst_fixup()
134 usa_ofs = le16_to_cpu(b->usa_ofs); in pre_write_mst_fixup()
136 usa_count = le16_to_cpu(b->usa_count) - 1; in pre_write_mst_fixup()
138 if ( size & (NTFS_BLOCK_SIZE - 1) || in pre_write_mst_fixup()
142 return -EINVAL; in pre_write_mst_fixup()
147 * (skipping 0 and -1, i.e. 0xffff). in pre_write_mst_fixup()
155 data_pos = (le16*)b + NTFS_BLOCK_SIZE/sizeof(le16) - 1; in pre_write_mst_fixup()
157 while (usa_count--) { in pre_write_mst_fixup()
172 * post_write_mst_fixup - fast deprotect multi sector transfer protected data
175 * Perform the necessary post write multi sector transfer fixup, not checking
183 u16 usa_ofs = le16_to_cpu(b->usa_ofs); in post_write_mst_fixup()
184 u16 usa_count = le16_to_cpu(b->usa_count) - 1; in post_write_mst_fixup()
190 data_pos = (le16*)b + NTFS_BLOCK_SIZE/sizeof(le16) - 1; in post_write_mst_fixup()
193 while (usa_count--) { in post_write_mst_fixup()