History

NFS: discard NFS_RPC_SWAPFLAGS and RPC_TASK_ROOTCREDS

NFS_RPC_SWAPFLAGS is only used for READ requests. It sets RPC_TASK_SWAPPER which gives some memory-allocation priority to requests. This is not needed for swap READ - though it is for writes where it is set via a different mechanism. RPC_TASK_ROOTCREDS causes the 'machine' credential to be used. This is not needed as the root credential is saved when the swap file is opened, and this is used for all IO. So NFS_RPC_SWAPFLAGS isn't needed, and as it is the only user of RPC_TASK_ROOTCREDS, that isn't needed either. Remove both.

NeilBrown committed 4 years ago

Commit 89c2be81 parent a80a8465 files · +1 −12Browse files

Unified · Split

5 files
  1. fs/nfs/read.c +0 −4
  2. include/linux/nfs_fs.h +0 −5
  3. include/linux/sunrpc/sched.h +0 −1
  4. include/trace/events/sunrpc.h +0 −1
  5. net/sunrpc/auth.c +1 −1
fs/nfs/read.c+0−4
@@ -194,10 +194,6 @@ static void nfs_initiate_read(struct nfs_pgio_header *hdr, · 193 unmodified lines
194194 const struct nfs_rpc_ops *rpc_ops,
195195 struct rpc_task_setup *task_setup_data, int how)
196196 {
197− struct inode *inode = hdr->inode;
198− int swap_flags = IS_SWAPFILE(inode) ? NFS_RPC_SWAPFLAGS : 0;
199−
200− task_setup_data->flags |= swap_flags;
201197 rpc_ops->read_setup(hdr, msg);
202198 trace_nfs_initiate_read(hdr);
203199 }
include/linux/nfs_fs.h+0−5
@@ -45,11 +45,6 @@ · 44 unmodified lines
4545 */
4646 #define NFS_MAX_TRANSPORTS 16
4747
48−/*
49− * These are the default flags for swap requests
50− */
51−#define NFS_RPC_SWAPFLAGS (RPC_TASK_SWAPPER|RPC_TASK_ROOTCREDS)
52−
5348 /*
5449 * Size of the NFS directory verifier
5550 */
include/linux/sunrpc/sched.h+0−1
@@ -124,7 +124,6 @@ struct rpc_task_setup { · 123 unmodified lines
124124 #define RPC_TASK_MOVEABLE 0x0004 /* nfs4.1+ rpc tasks */
125125 #define RPC_TASK_NULLCREDS 0x0010 /* Use AUTH_NULL credential */
126126 #define RPC_CALL_MAJORSEEN 0x0020 /* major timeout seen */
127−#define RPC_TASK_ROOTCREDS 0x0040 /* force root creds */
128127 #define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */
129128 #define RPC_TASK_NO_ROUND_ROBIN 0x0100 /* send requests on "main" xprt */
130129 #define RPC_TASK_SOFT 0x0200 /* Use soft timeouts */
include/trace/events/sunrpc.h+0−1
@@ -311,7 +311,6 @@ TRACE_EVENT(rpc_request, · 310 unmodified lines
311311 { RPC_TASK_MOVEABLE, "MOVEABLE" }, \
312312 { RPC_TASK_NULLCREDS, "NULLCREDS" }, \
313313 { RPC_CALL_MAJORSEEN, "MAJORSEEN" }, \
314− { RPC_TASK_ROOTCREDS, "ROOTCREDS" }, \
315314 { RPC_TASK_DYNAMIC, "DYNAMIC" }, \
316315 { RPC_TASK_NO_ROUND_ROBIN, "NO_ROUND_ROBIN" }, \
317316 { RPC_TASK_SOFT, "SOFT" }, \
net/sunrpc/auth.c+1−1
@@ -670,7 +670,7 @@ rpcauth_bindcred(struct rpc_task *task, const struct cred *cred, int flags) · 669 unmodified lines
670670 /* If machine cred couldn't be bound, try a root cred */
671671 if (new)
672672 ;
673− else if (cred == &machine_cred || (flags & RPC_TASK_ROOTCREDS))
673+ else if (cred == &machine_cred)
674674 new = rpcauth_bind_root_cred(task, lookupflags);
675675 else if (flags & RPC_TASK_NULLCREDS)
676676 new = authnull_ops.lookup_cred(NULL, NULL, 0);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t