X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fptlrpc%2Fsec_ctx.c;h=c93e87dcc56d21aa3db165574cf7eb075d2f29fd;hb=64a4f85ccd0af921ca2ffe2eab12c09e3f4338b4;hp=431f4b37a41476cfe81ac95850735763c728a0d2;hpb=3000a83dcd3c201f383c0507d33e7861fc695997;p=fs%2Flustre-release.git diff --git a/lustre/ptlrpc/sec_ctx.c b/lustre/ptlrpc/sec_ctx.c index 431f4b3..c93e87d 100644 --- a/lustre/ptlrpc/sec_ctx.c +++ b/lustre/ptlrpc/sec_ctx.c @@ -20,13 +20,18 @@ * * GPL HEADER END */ -#ifdef __KERNEL__ +/* + * Copyright (c) 2014, Intel Corporation. + */ #define DEBUG_SUBSYSTEM S_FILTER #include #include #include +#include + +#include "ptlrpc_internal.h" /* refine later and change to seqlock or simlar from libcfs */ /* Debugging check only needed during development */ @@ -92,35 +97,3 @@ void pop_ctxt(struct lvfs_run_ctxt *saved, struct lvfs_run_ctxt *new_ctx) current->fs->umask = saved->umask; } EXPORT_SYMBOL(pop_ctxt); - -/* utility to rename a file */ -int lustre_rename(struct dentry *dir, struct vfsmount *mnt, - char *oldname, char *newname) -{ - struct dentry *dchild_old, *dchild_new; - int err = 0; - ENTRY; - - ASSERT_KERNEL_CTXT("kernel doing rename outside kernel context\n"); - CDEBUG(D_INODE, "renaming file %.*s to %.*s\n", - (int)strlen(oldname), oldname, (int)strlen(newname), newname); - - dchild_old = ll_lookup_one_len(oldname, dir, strlen(oldname)); - if (IS_ERR(dchild_old)) - RETURN(PTR_ERR(dchild_old)); - - if (!dchild_old->d_inode) - GOTO(put_old, err = -ENOENT); - - dchild_new = ll_lookup_one_len(newname, dir, strlen(newname)); - if (IS_ERR(dchild_new)) - GOTO(put_old, err = PTR_ERR(dchild_new)); - - err = ll_vfs_rename(dir->d_inode, dchild_old, dir->d_inode, dchild_new); - - dput(dchild_new); -put_old: - dput(dchild_old); - RETURN(err); -} -#endif /* __KERNEL__ */