diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2011-05-09 17:42:37 +0200 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-05-09 17:42:37 +0200 |
commit | 855d23ce2665c56437bd88fa6a0d45b6713bd194 (patch) | |
tree | 0678f8d0e93dfafd783bf9782f457bc7235b2128 /fs/gfs2/dir.h | |
parent | GFS2: Don't use gfs2_change_nlink in link syscall (diff) | |
download | linux-855d23ce2665c56437bd88fa6a0d45b6713bd194.tar.xz linux-855d23ce2665c56437bd88fa6a0d45b6713bd194.zip |
GFS2: Make gfs2_dir_del update link count when required
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: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/dir.h')
-rw-r--r-- | fs/gfs2/dir.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/dir.h b/fs/gfs2/dir.h index a98f644bd3df..66831f1d23ea 100644 --- a/fs/gfs2/dir.h +++ b/fs/gfs2/dir.h @@ -23,7 +23,7 @@ extern int gfs2_dir_check(struct inode *dir, const struct qstr *filename, const struct gfs2_inode *ip); extern int gfs2_dir_add(struct inode *inode, const struct qstr *filename, const struct gfs2_inode *ip, unsigned int type); -extern int gfs2_dir_del(struct gfs2_inode *dip, const struct qstr *filename); +extern int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry); extern int gfs2_dir_read(struct inode *inode, u64 *offset, void *opaque, filldir_t filldir); extern int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename, |