/[hurd]/hurd/ext2fs/truncate.c
ViewVC logotype

Diff of /hurd/ext2fs/truncate.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.38 by roland, Sun Dec 3 04:41:37 2000 UTC revision 1.38.2.1 by ams, Thu Aug 25 18:34:18 2005 UTC
# Line 1  Line 1 
1  /* File truncation  /* File truncation
2    
3     Copyright (C) 1995,96,97,99,2000 Free Software Foundation, Inc.     Copyright (C) 1995,96,97,99,2000,05 Free Software Foundation, Inc.
4    
5     Written by Miles Bader <miles@gnu.org>     Written by Miles Bader <miles@gnu.org>
6    
# Line 124  trunc_indirect (struct node *node, block Line 124  trunc_indirect (struct node *node, block
124      {      {
125        unsigned index;        unsigned index;
126        int modified = 0, all_freed = 1;        int modified = 0, all_freed = 1;
127        block_t *ind_bh = (block_t *)bptr (*p);        block_t *ind_bh = (block_t *)buffer_lookup (*p);
128        unsigned first = end < offset ? 0 : end - offset;        unsigned first = end < offset ? 0 : end - offset;
129    
130        for (index = first; index < addr_per_block; index++)        for (index = first; index < addr_per_block; index++)
# Line 139  trunc_indirect (struct node *node, block Line 139  trunc_indirect (struct node *node, block
139    
140        if (first == 0 && all_freed)        if (first == 0 && all_freed)
141          {          {
142            pager_flush_some (diskfs_disk_pager, boffs (*p), block_size, 1);            pager_flush_some (diskfs_disk_pager,
143                                bptr_index (ind_bh) << log2_block_size,
144                                block_size, 1);
145            free_block_run_free_ptr (fbr, p);            free_block_run_free_ptr (fbr, p);
146              buffer_put (ind_bh);
147          }          }
148        else if (modified)        else if (modified)
149          record_indir_poke (node, ind_bh);          record_indir_poke (node, ind_bh);
150          else
151            buffer_put (ind_bh);
152      }      }
153  }  }
154    
# Line 218  poke_pages (memory_object_t obj, vm_offs Line 223  poke_pages (memory_object_t obj, vm_offs
223  /* Flush all the data past the new size from the kernel.  Also force any  /* Flush all the data past the new size from the kernel.  Also force any
224     delayed copies of this data to take place immediately.  (We are implicitly     delayed copies of this data to take place immediately.  (We are implicitly
225     changing the data to zeros and doing it without the kernel's immediate     changing the data to zeros and doing it without the kernel's immediate
226     knowledge; accordingl we must help out the kernel thusly.) */     knowledge; accordingly we must help out the kernel thusly.) */
227  static void  static void
228  force_delayed_copies (struct node *node, off_t length)  force_delayed_copies (struct node *node, off_t length)
229  {  {

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.38.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26