summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/dir.h
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2014-01-06 12:28:41 +0100
committerSteven Whitehouse <swhiteho@redhat.com>2014-01-06 12:28:41 +0100
commit3c1c0ae1db74b1f3e606f42158b5dadd89105c1f (patch)
treea3731a3e3ff2d6e76a3411e55a7de6749b3b129c /fs/gfs2/dir.h
parentGFS2: Use only a single address space for rgrps (diff)
downloadlinux-3c1c0ae1db74b1f3e606f42158b5dadd89105c1f.tar.xz
linux-3c1c0ae1db74b1f3e606f42158b5dadd89105c1f.zip
GFS2: Add directory addition info structure
The intent is that this structure will hold the information required when adding entries to a directory (linking). To start with, it will contain only the number of blocks which are required to link the new entry into the directory. The current calculation returns either 0 or the maximim number of blocks that can ever be requested by such a transaction. The intent is that in a later patch, we can update the dir code to calculate this value more accurately. In addition further patches will also add further fields to the new structure to increase its utility. In addition this patch fixes a bug where the link used during inode creation was adding requesting too many blocks in some cases. This is harmless unless the fs is close to being full. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/dir.h')
-rw-r--r--fs/gfs2/dir.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/gfs2/dir.h b/fs/gfs2/dir.h
index 4f03bbd1873f..c5573e703a7a 100644
--- a/fs/gfs2/dir.h
+++ b/fs/gfs2/dir.h
@@ -17,6 +17,10 @@ struct inode;
struct gfs2_inode;
struct gfs2_inum;
+struct gfs2_diradd {
+ unsigned nr_blocks;
+};
+
extern struct inode *gfs2_dir_search(struct inode *dir,
const struct qstr *filename,
bool fail_on_exist);
@@ -33,7 +37,8 @@ extern int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename,
extern int gfs2_dir_exhash_dealloc(struct gfs2_inode *dip);
extern int gfs2_diradd_alloc_required(struct inode *dir,
- const struct qstr *filename);
+ const struct qstr *filename,
+ struct gfs2_diradd *da);
extern int gfs2_dir_get_new_buffer(struct gfs2_inode *ip, u64 block,
struct buffer_head **bhp);
extern void gfs2_dir_hash_inval(struct gfs2_inode *ip);