Lines Matching defs:vol
89 static int fstrim_clusters(ntfs_volume *vol, LCN lcn, s64 length)
91 struct ntfs_device *dev = vol->dev;
97 range[0] = lcn << vol->cluster_size_bits;
98 range[1] = length << vol->cluster_size_bits;
138 static int fstrim_limits(ntfs_volume *vol,
149 if (stat(vol->dev->d_name, &statbuf) == -1) {
151 vol->dev->d_name);
229 static inline LCN align_up(ntfs_volume *vol, LCN lcn, u64 granularity)
233 aligned = (lcn << vol->cluster_size_bits) + granularity - 1;
235 return (aligned >> vol->cluster_size_bits);
238 static inline u64 align_down(ntfs_volume *vol, u64 count, u64 granularity)
242 aligned = count << vol->cluster_size_bits;
244 return (aligned >> vol->cluster_size_bits);
255 static int fstrim(ntfs_volume *vol, void *data, u64 *trimmed)
280 if (minlen > vol->cluster_size) {
290 if (!NDevBlock(vol->dev)) {
295 ret = fstrim_limits(vol, &discard_alignment,
310 ret = ntfs_device_sync(vol->dev);
318 for (start_buf = 0; start_buf < vol->nr_clusters;
328 if (end_buf > vol->nr_clusters)
329 end_buf = vol->nr_clusters;
332 br = ntfs_attr_pread(vol->lcnbmp_na, start_buf/8, count, buf);
356 (u64) (end_lcn-start_lcn) << vol->cluster_size_bits
360 aligned_lcn = align_up(vol, start_lcn,
366 align_down(vol,
371 ret = fstrim_clusters(vol,
377 << vol->cluster_size_bits;
407 ret = fstrim(ni->vol, data, &trimmed);