Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174706
b: refs/heads/master
c: 8908b2f
h: refs/heads/master
v: v3
  • Loading branch information
Ryusuke Konishi committed Nov 20, 2009
1 parent 2b4dbc5 commit 6f68cab
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: db38d5ad323362bfca118b52fe5906f97a69fb45
refs/heads/master: 8908b2f70b795299d21706b5a97676cfe7f9056a
18 changes: 16 additions & 2 deletions trunk/fs/nilfs2/dat.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@
#define NILFS_CNO_MIN ((__u64)1)
#define NILFS_CNO_MAX (~(__u64)0)

struct nilfs_dat_info {
struct nilfs_mdt_info mi;
struct nilfs_palloc_cache palloc_cache;
};

static inline struct nilfs_dat_info *NILFS_DAT_I(struct inode *dat)
{
return (struct nilfs_dat_info *)NILFS_MDT(dat);
}

static int nilfs_dat_prepare_entry(struct inode *dat,
struct nilfs_palloc_req *req, int create)
{
Expand Down Expand Up @@ -445,16 +455,20 @@ struct inode *nilfs_dat_new(struct the_nilfs *nilfs, size_t entry_size)
{
static struct lock_class_key dat_lock_key;
struct inode *dat;
struct nilfs_dat_info *di;
int err;

dat = nilfs_mdt_new(nilfs, NULL, NILFS_DAT_INO, 0);
dat = nilfs_mdt_new(nilfs, NULL, NILFS_DAT_INO, sizeof(*di));
if (dat) {
err = nilfs_palloc_init_blockgroup(dat, entry_size);
if (unlikely(err)) {
nilfs_mdt_destroy(dat);
return NULL;
}
lockdep_set_class(&NILFS_MDT(dat)->mi_sem, &dat_lock_key);

di = NILFS_DAT_I(dat);
lockdep_set_class(&di->mi.mi_sem, &dat_lock_key);
nilfs_palloc_setup_cache(dat, &di->palloc_cache);
}
return dat;
}

0 comments on commit 6f68cab

Please sign in to comment.