Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4378
b: refs/heads/master
c: a6ccbbb
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jul 8, 2005
1 parent b09e7b5 commit 8211147
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 23 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: 463090294e1e460cf97f5ade376d4b1e62bc5263
refs/heads/master: a6ccbbb8865101d83c2e716f08feae1da1c48584
29 changes: 8 additions & 21 deletions trunk/fs/nfsd/nfs4recover.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,25 +119,12 @@ nfs4_make_rec_clidname(char *dname, struct xdr_netobj *clname)
return status;
}

static int
nfsd4_rec_fsync(struct dentry *dentry)
static void
nfsd4_sync_rec_dir(void)
{
struct file *filp;
int status = nfs_ok;

dprintk("NFSD: nfs4_fsync_rec_dir\n");
filp = dentry_open(dget(dentry), mntget(rec_dir.mnt), O_RDWR);
if (IS_ERR(filp)) {
status = PTR_ERR(filp);
goto out;
}
if (filp->f_op && filp->f_op->fsync)
status = filp->f_op->fsync(filp, filp->f_dentry, 0);
fput(filp);
out:
if (status)
printk("nfsd4: unable to sync recovery directory\n");
return status;
down(&rec_dir.dentry->d_inode->i_sem);
nfsd_sync_dir(rec_dir.dentry);
up(&rec_dir.dentry->d_inode->i_sem);
}

int
Expand Down Expand Up @@ -176,7 +163,7 @@ nfsd4_create_clid_dir(struct nfs4_client *clp)
up(&rec_dir.dentry->d_inode->i_sem);
if (status == 0) {
clp->cl_firststate = 1;
status = nfsd4_rec_fsync(rec_dir.dentry);
nfsd4_sync_rec_dir();
}
nfs4_reset_user(uid, gid);
dprintk("NFSD: nfsd4_create_clid_dir returns %d\n", status);
Expand Down Expand Up @@ -331,7 +318,7 @@ nfsd4_remove_clid_dir(struct nfs4_client *clp)
status = nfsd4_unlink_clid_dir(clp->cl_recdir, HEXDIR_LEN-1);
nfs4_reset_user(uid, gid);
if (status == 0)
status = nfsd4_rec_fsync(rec_dir.dentry);
nfsd4_sync_rec_dir();
if (status)
printk("NFSD: Failed to remove expired client state directory"
" %.*s\n", HEXDIR_LEN, clp->cl_recdir);
Expand Down Expand Up @@ -362,7 +349,7 @@ nfsd4_recdir_purge_old(void) {
return;
status = nfsd4_list_rec_dir(rec_dir.dentry, purge_old);
if (status == 0)
status = nfsd4_rec_fsync(rec_dir.dentry);
nfsd4_sync_rec_dir();
if (status)
printk("nfsd4: failed to purge old clients from recovery"
" directory %s\n", rec_dir.dentry->d_name.name);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/nfsd/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ nfsd_sync(struct file *filp)
up(&inode->i_sem);
}

static void
void
nfsd_sync_dir(struct dentry *dp)
{
nfsd_dosync(NULL, dp, dp->d_inode->i_fop);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/nfsd/nfsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ int nfsd_statfs(struct svc_rqst *, struct svc_fh *,

int nfsd_notify_change(struct inode *, struct iattr *);
int nfsd_permission(struct svc_export *, struct dentry *, int);
void nfsd_sync_dir(struct dentry *dp);

#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
#ifdef CONFIG_NFSD_V2_ACL
Expand Down

0 comments on commit 8211147

Please sign in to comment.