nfs42proc.c (c10a75145febb588d96c6adda6eb5ae2338e4e32) | nfs42proc.c (95ad37f90c338e3fd4abf61cecfe02b6f3e080f0) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (c) 2014 Anna Schumaker <Anna.Schumaker@Netapp.com> 4 */ 5#include <linux/fs.h> 6#include <linux/sunrpc/addr.h> 7#include <linux/sunrpc/sched.h> 8#include <linux/nfs.h> --- 1168 unchanged lines hidden (view full) --- 1177 }; 1178 int ret, np; 1179 1180 ret = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, 1181 &res.seq_res, 0); 1182 if (ret < 0) 1183 return ret; 1184 | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (c) 2014 Anna Schumaker <Anna.Schumaker@Netapp.com> 4 */ 5#include <linux/fs.h> 6#include <linux/sunrpc/addr.h> 7#include <linux/sunrpc/sched.h> 8#include <linux/nfs.h> --- 1168 unchanged lines hidden (view full) --- 1177 }; 1178 int ret, np; 1179 1180 ret = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, 1181 &res.seq_res, 0); 1182 if (ret < 0) 1183 return ret; 1184 |
1185 /* 1186 * Normally, the caching is done one layer up, but for successful 1187 * RPCS, always cache the result here, even if the caller was 1188 * just querying the length, or if the reply was too big for 1189 * the caller. This avoids a second RPC in the case of the 1190 * common query-alloc-retrieve cycle for xattrs. 1191 * 1192 * Note that xattr_len is always capped to XATTR_SIZE_MAX. 1193 */ 1194 1195 nfs4_xattr_cache_add(inode, name, NULL, pages, res.xattr_len); 1196 |
|
1185 if (buflen) { 1186 if (res.xattr_len > buflen) 1187 return -ERANGE; 1188 _copy_from_pages(buf, pages, 0, res.xattr_len); 1189 } 1190 1191 np = DIV_ROUND_UP(res.xattr_len, PAGE_SIZE); 1192 while (--np >= 0) --- 134 unchanged lines hidden --- | 1197 if (buflen) { 1198 if (res.xattr_len > buflen) 1199 return -ERANGE; 1200 _copy_from_pages(buf, pages, 0, res.xattr_len); 1201 } 1202 1203 np = DIV_ROUND_UP(res.xattr_len, PAGE_SIZE); 1204 while (--np >= 0) --- 134 unchanged lines hidden --- |