Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192345
b: refs/heads/master
c: f013574
h: refs/heads/master
i:
  192343: 8938986
v: v3
  • Loading branch information
J. Bruce Fields committed Mar 6, 2010
1 parent cf03c29 commit a852520
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 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: f958a1320ff7a1e0e861d3c90de6da12a88839dc
refs/heads/master: f013574014816c7a557b3c52233f3620463f0b9b
29 changes: 17 additions & 12 deletions trunk/fs/nfsd/nfsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1203,26 +1203,36 @@ static ssize_t write_maxblksize(struct file *file, char *buf, size_t size)
}

#ifdef CONFIG_NFSD_V4
static ssize_t __write_leasetime(struct file *file, char *buf, size_t size)
static ssize_t __nfsd4_write_time(struct file *file, char *buf, size_t size, time_t *time)
{
/* if size > 10 seconds, call
* nfs4_reset_lease() then write out the new lease (seconds) as reply
*/
char *mesg = buf;
int rv, lease;
int rv, i;

if (size > 0) {
if (nfsd_serv)
return -EBUSY;
rv = get_int(&mesg, &lease);
rv = get_int(&mesg, &i);
if (rv)
return rv;
if (lease < 10 || lease > 3600)
if (i < 10 || i > 3600)
return -EINVAL;
nfsd4_lease = lease;
*time = i;
}

return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%ld\n", nfsd4_lease);
return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%ld\n", *time);
}

static ssize_t nfsd4_write_time(struct file *file, char *buf, size_t size, time_t *time)
{
ssize_t rv;

mutex_lock(&nfsd_mutex);
rv = __nfsd4_write_time(file, buf, size, time);
mutex_unlock(&nfsd_mutex);
return rv;
}

/**
Expand All @@ -1248,12 +1258,7 @@ static ssize_t __write_leasetime(struct file *file, char *buf, size_t size)
*/
static ssize_t write_leasetime(struct file *file, char *buf, size_t size)
{
ssize_t rv;

mutex_lock(&nfsd_mutex);
rv = __write_leasetime(file, buf, size);
mutex_unlock(&nfsd_mutex);
return rv;
return nfsd4_write_time(file, buf, size, &nfsd4_lease);
}

extern char *nfs4_recoverydir(void);
Expand Down

0 comments on commit a852520

Please sign in to comment.