1. 09 May, 2011 3 commits
    • Steven Whitehouse's avatar
      GFS2: When adding a new dir entry, inc link count if it is a subdir · 3d6ecb7d
      Steven Whitehouse authored
      This adds an increment of the link count when we add a new directory
      entry, if that entry is itself a directory. This means that we no
      longer need separate code to perform this operation.
      
      Now that both adding and removing directory entries automatically
      update the parent directory's link count if required, that makes
      the code shorter and simpler than before.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      3d6ecb7d
    • Steven Whitehouse's avatar
      GFS2: Make gfs2_dir_del update link count when required · 855d23ce
      Steven Whitehouse authored
      When we remove an entry from a directory, we can save ourselves
      some trouble if we know the type of the entry in question, since
      if it is itself a directory, we can update the link count of the
      parent at the same time as removing the directory entry.
      
      In addition this patch also merges the rmdir and unlink code which
      was almost identical anyway. This eliminates the calls to remove
      the . and .. directory entries on each rmdir (not needed since the
      directory will be deallocated, anyway) which was the only thing preventing
      passing the dentry to gfs2_dir_del(). The passing of the dentry
      rather than just the name allows us to figure out the type of the entry
      which is being removed, and thus adjust the link count when required.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      855d23ce
    • Steven Whitehouse's avatar
      GFS2: Don't use gfs2_change_nlink in link syscall · 2baee03f
      Steven Whitehouse authored
      There are three users of gfs2_change_nlink which add to the link
      count. Two of these are about to be removed in later patches, so
      this means that there will no callers, when that happens allowing
      removal of that function, also in a later patch.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      2baee03f
  2. 05 May, 2011 2 commits
    • Steven Whitehouse's avatar
      GFS2: Don't use a try lock when promoting to a higher mode · 588da3b3
      Steven Whitehouse authored
      Previously we marked all locks being promoted to a higher mode
      with the try flag to avoid any potential deadlocks issues. The
      DLM is able to detect these and report them in way that GFS2 can
      deal with them correctly. So we can just request the required mode
      and wait for a response without needing to perform this check.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      588da3b3
    • Steven Whitehouse's avatar
      GFS2: Double check link count under glock · d192a8e5
      Steven Whitehouse authored
      To avoid any possible races relating to the link count, we need to
      recheck it under the inode's glock in all cases where it matters.
      Also to ensure we never get any nasty surprises, this patch also
      ensures that once the link count has hit zero it can never be
      elevated by rereading in data from disk.
      
      The only place we cannot provide a proper solution is in rename
      in the case where we are removing a target inode and we discover
      that the target inode has been already unlinked on another node.
      The race window is very small, and we return EAGAIN in this case
      to indicate what has happened. The proper solution would be to move
      the lookup parts of rename from the vfs into library calls which
      the fs could call directly, but that is potentially a very big job
      and this fix should cover most cases for now.
      Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      d192a8e5
  3. 03 May, 2011 3 commits
  4. 20 Apr, 2011 15 commits
  5. 19 Apr, 2011 17 commits