aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4recover.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-08-02 01:03:36 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-10-23 05:12:51 -0400
commita63bb99660d82dfe7c51588e1f9aadefb756ba51 (patch)
tree25417bd44a2646ecc2d314450afb13be9550d339 /fs/nfsd/nfs4recover.c
parentc1a2a4756df01d72b6f7a0563218b23b63a6d4ed (diff)
[PATCH] switch nfsd to kern_path()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nfsd/nfs4recover.c')
-rw-r--r--fs/nfsd/nfs4recover.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index 145b3c877a27..bb93946ace22 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -51,7 +51,7 @@
51#define NFSDDBG_FACILITY NFSDDBG_PROC 51#define NFSDDBG_FACILITY NFSDDBG_PROC
52 52
53/* Globals */ 53/* Globals */
54static struct nameidata rec_dir; 54static struct path rec_dir;
55static int rec_dir_init = 0; 55static int rec_dir_init = 0;
56 56
57static void 57static void
@@ -121,9 +121,9 @@ out_no_tfm:
121static void 121static void
122nfsd4_sync_rec_dir(void) 122nfsd4_sync_rec_dir(void)
123{ 123{
124 mutex_lock(&rec_dir.path.dentry->d_inode->i_mutex); 124 mutex_lock(&rec_dir.dentry->d_inode->i_mutex);
125 nfsd_sync_dir(rec_dir.path.dentry); 125 nfsd_sync_dir(rec_dir.dentry);
126 mutex_unlock(&rec_dir.path.dentry->d_inode->i_mutex); 126 mutex_unlock(&rec_dir.dentry->d_inode->i_mutex);
127} 127}
128 128
129int 129int
@@ -143,9 +143,9 @@ nfsd4_create_clid_dir(struct nfs4_client *clp)
143 nfs4_save_user(&uid, &gid); 143 nfs4_save_user(&uid, &gid);
144 144
145 /* lock the parent */ 145 /* lock the parent */
146 mutex_lock(&rec_dir.path.dentry->d_inode->i_mutex); 146 mutex_lock(&rec_dir.dentry->d_inode->i_mutex);
147 147
148 dentry = lookup_one_len(dname, rec_dir.path.dentry, HEXDIR_LEN-1); 148 dentry = lookup_one_len(dname, rec_dir.dentry, HEXDIR_LEN-1);
149 if (IS_ERR(dentry)) { 149 if (IS_ERR(dentry)) {
150 status = PTR_ERR(dentry); 150 status = PTR_ERR(dentry);
151 goto out_unlock; 151 goto out_unlock;
@@ -155,15 +155,15 @@ nfsd4_create_clid_dir(struct nfs4_client *clp)
155 dprintk("NFSD: nfsd4_create_clid_dir: DIRECTORY EXISTS\n"); 155 dprintk("NFSD: nfsd4_create_clid_dir: DIRECTORY EXISTS\n");
156 goto out_put; 156 goto out_put;
157 } 157 }
158 status = mnt_want_write(rec_dir.path.mnt); 158 status = mnt_want_write(rec_dir.mnt);
159 if (status) 159 if (status)
160 goto out_put; 160 goto out_put;
161 status = vfs_mkdir(rec_dir.path.dentry->d_inode, dentry, S_IRWXU); 161 status = vfs_mkdir(rec_dir.dentry->d_inode, dentry, S_IRWXU);
162 mnt_drop_write(rec_dir.path.mnt); 162 mnt_drop_write(rec_dir.mnt);
163out_put: 163out_put:
164 dput(dentry); 164 dput(dentry);
165out_unlock: 165out_unlock:
166 mutex_unlock(&rec_dir.path.dentry->d_inode->i_mutex); 166 mutex_unlock(&rec_dir.dentry->d_inode->i_mutex);
167 if (status == 0) { 167 if (status == 0) {
168 clp->cl_firststate = 1; 168 clp->cl_firststate = 1;
169 nfsd4_sync_rec_dir(); 169 nfsd4_sync_rec_dir();
@@ -226,7 +226,7 @@ nfsd4_list_rec_dir(struct dentry *dir, recdir_func *f)
226 226
227 nfs4_save_user(&uid, &gid); 227 nfs4_save_user(&uid, &gid);
228 228
229 filp = dentry_open(dget(dir), mntget(rec_dir.path.mnt), O_RDONLY); 229 filp = dentry_open(dget(dir), mntget(rec_dir.mnt), O_RDONLY);
230 status = PTR_ERR(filp); 230 status = PTR_ERR(filp);
231 if (IS_ERR(filp)) 231 if (IS_ERR(filp))
232 goto out; 232 goto out;
@@ -291,9 +291,9 @@ nfsd4_unlink_clid_dir(char *name, int namlen)
291 291
292 dprintk("NFSD: nfsd4_unlink_clid_dir. name %.*s\n", namlen, name); 292 dprintk("NFSD: nfsd4_unlink_clid_dir. name %.*s\n", namlen, name);
293 293
294 mutex_lock(&rec_dir.path.dentry->d_inode->i_mutex); 294 mutex_lock(&rec_dir.dentry->d_inode->i_mutex);
295 dentry = lookup_one_len(name, rec_dir.path.dentry, namlen); 295 dentry = lookup_one_len(name, rec_dir.dentry, namlen);
296 mutex_unlock(&rec_dir.path.dentry->d_inode->i_mutex); 296 mutex_unlock(&rec_dir.dentry->d_inode->i_mutex);
297 if (IS_ERR(dentry)) { 297 if (IS_ERR(dentry)) {
298 status = PTR_ERR(dentry); 298 status = PTR_ERR(dentry);
299 return status; 299 return status;
@@ -302,7 +302,7 @@ nfsd4_unlink_clid_dir(char *name, int namlen)
302 if (!dentry->d_inode) 302 if (!dentry->d_inode)
303 goto out; 303 goto out;
304 304
305 status = nfsd4_clear_clid_dir(rec_dir.path.dentry, dentry); 305 status = nfsd4_clear_clid_dir(rec_dir.dentry, dentry);
306out: 306out:
307 dput(dentry); 307 dput(dentry);
308 return status; 308 return status;
@@ -318,7 +318,7 @@ nfsd4_remove_clid_dir(struct nfs4_client *clp)
318 if (!rec_dir_init || !clp->cl_firststate) 318 if (!rec_dir_init || !clp->cl_firststate)
319 return; 319 return;
320 320
321 status = mnt_want_write(rec_dir.path.mnt); 321 status = mnt_want_write(rec_dir.mnt);
322 if (status) 322 if (status)
323 goto out; 323 goto out;
324 clp->cl_firststate = 0; 324 clp->cl_firststate = 0;
@@ -327,7 +327,7 @@ nfsd4_remove_clid_dir(struct nfs4_client *clp)
327 nfs4_reset_user(uid, gid); 327 nfs4_reset_user(uid, gid);
328 if (status == 0) 328 if (status == 0)
329 nfsd4_sync_rec_dir(); 329 nfsd4_sync_rec_dir();
330 mnt_drop_write(rec_dir.path.mnt); 330 mnt_drop_write(rec_dir.mnt);
331out: 331out:
332 if (status) 332 if (status)
333 printk("NFSD: Failed to remove expired client state directory" 333 printk("NFSD: Failed to remove expired client state directory"
@@ -357,17 +357,17 @@ nfsd4_recdir_purge_old(void) {
357 357
358 if (!rec_dir_init) 358 if (!rec_dir_init)
359 return; 359 return;
360 status = mnt_want_write(rec_dir.path.mnt); 360 status = mnt_want_write(rec_dir.mnt);
361 if (status) 361 if (status)
362 goto out; 362 goto out;
363 status = nfsd4_list_rec_dir(rec_dir.path.dentry, purge_old); 363 status = nfsd4_list_rec_dir(rec_dir.dentry, purge_old);
364 if (status == 0) 364 if (status == 0)
365 nfsd4_sync_rec_dir(); 365 nfsd4_sync_rec_dir();
366 mnt_drop_write(rec_dir.path.mnt); 366 mnt_drop_write(rec_dir.mnt);
367out: 367out:
368 if (status) 368 if (status)
369 printk("nfsd4: failed to purge old clients from recovery" 369 printk("nfsd4: failed to purge old clients from recovery"
370 " directory %s\n", rec_dir.path.dentry->d_name.name); 370 " directory %s\n", rec_dir.dentry->d_name.name);
371} 371}
372 372
373static int 373static int
@@ -387,10 +387,10 @@ int
387nfsd4_recdir_load(void) { 387nfsd4_recdir_load(void) {
388 int status; 388 int status;
389 389
390 status = nfsd4_list_rec_dir(rec_dir.path.dentry, load_recdir); 390 status = nfsd4_list_rec_dir(rec_dir.dentry, load_recdir);
391 if (status) 391 if (status)
392 printk("nfsd4: failed loading clients from recovery" 392 printk("nfsd4: failed loading clients from recovery"
393 " directory %s\n", rec_dir.path.dentry->d_name.name); 393 " directory %s\n", rec_dir.dentry->d_name.name);
394 return status; 394 return status;
395} 395}
396 396
@@ -412,7 +412,7 @@ nfsd4_init_recdir(char *rec_dirname)
412 412
413 nfs4_save_user(&uid, &gid); 413 nfs4_save_user(&uid, &gid);
414 414
415 status = path_lookup(rec_dirname, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, 415 status = kern_path(rec_dirname, LOOKUP_FOLLOW | LOOKUP_DIRECTORY,
416 &rec_dir); 416 &rec_dir);
417 if (status) 417 if (status)
418 printk("NFSD: unable to find recovery directory %s\n", 418 printk("NFSD: unable to find recovery directory %s\n",
@@ -429,5 +429,5 @@ nfsd4_shutdown_recdir(void)
429 if (!rec_dir_init) 429 if (!rec_dir_init)
430 return; 430 return;
431 rec_dir_init = 0; 431 rec_dir_init = 0;
432 path_put(&rec_dir.path); 432 path_put(&rec_dir);
433} 433}