Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252902
b: refs/heads/master
c: e51b841
h: refs/heads/master
v: v3
  • Loading branch information
Benny Halevy authored and Boaz Harrosh committed May 29, 2011
1 parent 7ad3faa commit cf02632
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 636fb9c89d7e216aac3d406e458864420057e981
refs/heads/master: e51b841dd0be9ff53f740c44c32c32679edcb7c8
3 changes: 3 additions & 0 deletions trunk/fs/nfs/objlayout/objio_osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ static struct pnfs_layoutdriver_type objlayout_type = {
.id = LAYOUT_OSD2_OBJECTS,
.name = "LAYOUT_OSD2_OBJECTS",

.alloc_layout_hdr = objlayout_alloc_layout_hdr,
.free_layout_hdr = objlayout_free_layout_hdr,

.alloc_lseg = objlayout_alloc_lseg,
.free_lseg = objlayout_free_lseg,

Expand Down
26 changes: 26 additions & 0 deletions trunk/fs/nfs/objlayout/objlayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,32 @@
#include "objlayout.h"

#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.
*/
Expand Down
17 changes: 17 additions & 0 deletions trunk/fs/nfs/objlayout/objlayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@
#include <linux/pnfs_osd_xdr.h>
#include "../pnfs.h"

/*
* per-inode layout
*/
struct objlayout {
struct pnfs_layout_hdr pnfs_layout;
};

static inline struct objlayout *
OBJLAYOUT(struct pnfs_layout_hdr *lo)
{
return container_of(lo, struct objlayout, pnfs_layout);
}

/*
* Raid engine I/O API
*/
Expand All @@ -66,6 +79,10 @@ extern void objlayout_put_deviceinfo(struct pnfs_osd_deviceaddr *deviceaddr);
/*
* exported generic objects function vectors
*/

extern struct pnfs_layout_hdr *objlayout_alloc_layout_hdr(struct inode *, gfp_t gfp_flags);
extern void objlayout_free_layout_hdr(struct pnfs_layout_hdr *);

extern struct pnfs_layout_segment *objlayout_alloc_lseg(
struct pnfs_layout_hdr *,
struct nfs4_layoutget_res *,
Expand Down

0 comments on commit cf02632

Please sign in to comment.