IP Library Granted Patent US 7,805,471
Granted Patent B2
US 7,805,471 · App. 12/013,504 · Granted Sep 28, 2010

Method and apparatus to perform incremental truncates in a file system

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,805,471
App. No.
12/013,504
Granted
Sep 28, 2010
Kind
B2
Abstract

The present invention provides a computer implemented method for truncating a file in a file system. The file system receives a request to truncate a file to a target size, the file having a first inode. The file system creates a second inode to a transient directory, wherein the second inode holds a plurality of in-progress entries. The file system sets a target size in the first inode. The file system writes a truncate entry to a journal, the truncate entry comprising a predetermined size. The file system truncates the file by up to the predetermined size. The file system determines that the file is above the target size. Responsive to a determination that the file is above the target size, the file system repeats the truncating step and the determining step. Responsive to a determination that the file is not above the target size, the file system applies the in-progress entries from the transient directory.

Claims (24)

1. A computer implemented method for truncating a file in a file system, the method comprising:

receiving a request to truncate the file to a target size, the file having a primary inode;

creating a transient directory inode, wherein the transient directory inode holds a plurality of in-progress entries;

setting a target size in the primary inode;

writing a truncate entry to a journal, the truncate entry comprising a predetermined size;

truncating the file by up to the predetermined size;

determining that the file is above the target size;

responsive to a determination that the file is above the target size, repeating the truncating step and the determining step;

responsive to a determination that the file is not above the target size, apply the in-progress entries from the transient directory inode;

determining whether a used buffer count is equal to a maximum buffer count;

responsive to a determination that the used buffer count is not equal to the maximum buffer count, obtaining a lock to at least one entity;

responsive to a determination that the used buffer count is equal to the maximum buffer count, increasing the used buffer count;

responsive to a determination that the used buffer count is equal to the maximum buffer count, performing the receiving, creating, setting, writing, determining, repeating, and removing steps;

releasing the lock; and

decreasing the used buffer count of a buffer cache, whereby the buffer cache is not exhausted.

2. The computer implemented method of claim 1 further comprising:

setting an operation flag in the primary inode to track buffers in use.

3. The computer implemented method of claim 2 further comprising:

removing the file.

4. The computer implemented method of claim 1 further comprising:

determining that a used buffer count is equal to a maximum buffer count;

responsive to a determination that the used buffer count is equal to a maximum buffer count, queuing a thread; and

awakening the thread.

5. The computer implemented method of claim 4 , wherein the step of increasing the used buffer count comprises increasing the used buffer count by one.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 13, 2015
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: LINKEDIN CORPORATION
Reel/Frame 035201/0479 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 14, 2008
From: BOMMA, SHASHIDHAR; CHANG, JOON; VEERAMALLA, RAMESH; MAKINEEDI, SREENIVAS
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 020358/0188 →