summaryrefslogtreecommitdiff
path: root/fs/nfs/objlayout/objlayout.c
diff options
context:
space:
mode:
authorBenny Halevy <bhalevy@panasas.com>2011-05-22 19:51:48 +0300
committerBoaz Harrosh <bharrosh@panasas.com>2011-05-29 20:53:51 +0300
commite51b841dd0be9ff53f740c44c32c32679edcb7c8 (patch)
tree03e46d6013fa2a45ad22b3f510267d11e5f8d25a /fs/nfs/objlayout/objlayout.c
parent636fb9c89d7e216aac3d406e458864420057e981 (diff)
pnfs-obj: define per-inode private structure
allocate and deallocate per-inode private pnfs_layout_hdr in preparation for I/O implementation. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Diffstat (limited to 'fs/nfs/objlayout/objlayout.c')
-rw-r--r--fs/nfs/objlayout/objlayout.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/fs/nfs/objlayout/objlayout.c b/fs/nfs/objlayout/objlayout.c
index 10e5fca3b7fb..f14b4da34052 100644
--- a/fs/nfs/objlayout/objlayout.c
+++ b/fs/nfs/objlayout/objlayout.c
@@ -42,6 +42,32 @@
#define NFSDBG_FACILITY NFSDBG_PNFS_LD
/*
+ * Create a objlayout layout structure for the given inode and return it.
+ */
+struct pnfs_layout_hdr *
+objlayout_alloc_layout_hdr(struct inode *inode, gfp_t gfp_flags)
+{
+ struct objlayout *objlay;
+
+ objlay = kzalloc(sizeof(struct objlayout), gfp_flags);
+ dprintk("%s: Return %p\n", __func__, objlay);
+ return &objlay->pnfs_layout;
+}
+
+/*
+ * Free an objlayout layout structure
+ */
+void
+objlayout_free_layout_hdr(struct pnfs_layout_hdr *lo)
+{
+ struct objlayout *objlay = OBJLAYOUT(lo);
+
+ dprintk("%s: objlay %p\n", __func__, objlay);
+
+ kfree(objlay);
+}
+
+/*
* Unmarshall layout and store it in pnfslay.
*/
struct pnfs_layout_segment *